Comments (5)
I see that Driver.swift#L1002-L1006 is the reason why I see ["swift-build"]
, but it hides the initial binary path so I still think this is not what's expected.
I tried Process.findExecutable(CommandLine.arguments[0])
instead of Process.findExecutable(arguments[0])
:
// We are running as a subcommand, try to find the subcommand adjacent to the executable we are running as.
// If we didn't find the tool there, let the OS search for it.
print("arguments", arguments)
print("path1", String(describing: Process.findExecutable(arguments[0])?.parentDirectory.appending(component: subcommand)))
+ print("path2", String(describing: Process.findExecutable(CommandLine.arguments[0])?.parentDirectory.appending(component: subcommand)))
- let subcommandPath = Process.findExecutable(arguments[0])?.parentDirectory.appending(component: subcommand)
+ let subcommandPath = Process.findExecutable(CommandLine.arguments[0])?.parentDirectory.appending(component: subcommand)
?? Process.findExecutable(subcommand)
Unfortunately, when running swift build
, it results in Optional(<AbsolutePath:"/usr/host/bin/swift-build">)
, which is still not what I'd expect…
When running /usr/x86_64-pc-linux-gnu/lib/swift-5.7/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swift build
it obviously works, but it's unfortunate I have to use the absolute path…
Could we easily resolve the symlinks? Would you be against the idea for some reason?
from swift-driver.
I tried many different things to patch my issue, but I could not properly resolve the symlink without taking the risk of introducing platform-specific code.
Guess my only option is to add swift-*
binaries to the PATH
…
from swift-driver.
I was about to propose a PR for:
- if subcommandPath == nil || !localFileSystem.exists(subcommandPath!) {
+ guard let subcommandPath = subcommandPath, localFileSystem.exists(subcommandPath) else {
throw Driver.Error.unknownOrMissingSubcommand(subcommand)
}
// Execute the subcommand.
- try exec(path: subcommandPath?.pathString ?? "", args: arguments)
+ try exec(path: subcommandPath.pathString, args: arguments)
then I quickly checked if release/5.9
was still like this and I stumbled upon e0de0af and f207c2a 🙄
Seems like I wasn't the first to have those issues 🥲
Could we then merge them into release/*
branches to fix the issue for previous releases?
from swift-driver.
Those two commits you mention are in 5.8.1, which is the latest release, while 5.7 is no longer updated. Any reason you're not using 5.8.1?
from swift-driver.
Could we then merge them into release/* branches to fix the issue for previous releases?
Depends on the timeline. At this stage issues that corresponding PRs are fixing have to be quite critical if not blocking to be considered for release/5.8
and release/5.9
. No more releases are cut from release/5.7
, so it's highly unlikely any PR would be accepted to a branch that old.
from swift-driver.
Related Issues (20)
- Group CLI options for easier navigation HOT 1
- Cargo Termizi
- Crash due to an assertion in libswiftCore
- Xcode 14.3 RC 2 (14E222b) not pass '-strict-implicit-module-context' flag to swift-frontend
- Windows builds broken when querying target-info from libSwiftScan HOT 2
- Swift Potentially Uses the Wrong Swift Driver HOT 15
- "swift build" command duplicates error messages HOT 8
- iOS get error Dependency for P1: Debug:SwiftDriver Compilation Requirements app normal arm64 com.apple.xcode.tools.swift.compiler is not absolute
- swift help build doesn't work when it's documented to
- Test suite broken on Windows due to CAS HOT 1
- SPM doesn't enumerate source files properly in different configurations HOT 6
- tests crash on windows HOT 1
- `swift run` usage suggestion should be fixed HOT 1
- Program is several times slower when compiled with swiftc than when compiled with XCode due to retain&release calls HOT 1
- “swift ./-” does the same as “swift -” HOT 5
- This driver no longer looks in a passed-in `-sdk` for the Swift modules and libraries HOT 2
- Using -g for non-macho targets can cause driver planning errors
- Leaking temporary directory and file /tmp/TemporaryDirectory.*/dummyInput-*.swift
- Compiling on Terminal generates a warning
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-driver.