Comments (2)
For reference: @asciibomb3r wrote a great post on the Swift.org blog announcing support for the --repl
flag in swift run
.
When combined with the --package-path
option, building in REPL support for swift-sh
could theoretically be as straightforward as invoking the builtin swift run
command directly. Unfortunately, swift run --repl
doesn't seem to support packages generated as executables:
$ swift --version
Apple Swift version 5.0-dev (LLVM 9a8bf9ce12, Clang eba26b8d1c, Swift b74d54a27c)
Target: x86_64-apple-darwin18.2.0
$ swift run --repl --package-path ~/Library/Developer/swift-sh.cache/foo
'foo' /Users/mattt/Library/Developer/swift-sh.cache/foo: error: unable to synthesize a REPL product as there are no library targets in the package
...then again, I'm not sure what the expected behavior would be for an executable. "Start a REPL with all of the top-level declarations in this main.swift
file"?
from swift-sh.
Yeah indeed I wasn’t thinking it through, but I think you're on to the right track with the --package-path
. It probably should checkout each dependency and --package-path
those. Which would be quite useful when developing a script, since you could play with the dependencies.
from swift-sh.
Related Issues (20)
- Scripts don't run on M1 w/ Xcode 12.3 (x86 Homebrew) HOT 2
- Something odd about the 2.2.0 release brew record HOT 2
- Error: reference to member 'v11_1' cannot be resolved without a contextual type.macOS(.v11_1) HOT 3
- Change version to 11 HOT 1
- Fail to import when the package-name and repo-name are not identical HOT 1
- CI won't build linux with swift 5.1
- Brew complaining about outdated formula syntax HOT 1
- Error during installation: Invalid bottle tag symbol HOT 1
- Support scripts w/ `@main` HOT 1
- Dashes in product name breaks dependency resolving HOT 1
- Does not build for release with the Xcode 13 GM HOT 4
- PathKit dependency needs to be updated to 1.0.1 HOT 1
- Error reference to member `v12_1` cannot be resolved HOT 1
- Expose an option that prints the cached build directory? HOT 2
- CI and test failures update & PR links HOT 2
- Editing using `swift sh edit` eventually fails with "The file doesn't exist" HOT 2
- Configurable templates/context HOT 4
- Package not regenerated if you change the import reference HOT 1
- error: The operation couldn’t be completed. (NSPOSIXErrorDomain.13) HOT 6
- Missing support for async entry points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-sh.