-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make sure we actually use swift-driver
#5842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| throw StringError("empty commandline for Swift compilation") | ||
| } | ||
|
|
||
| // TODO: `--driver-mode=swiftc` needs to be the first argument, but going through `SwiftCompilerTool` does not allow that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To fix this we'd need to move off llbuild's built-in tool and instead create a shell command (which is probably better anyway).
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
|
@swift-ci please smoke test |
| extraFlags.swiftCompilerFlags | ||
| } | ||
|
|
||
| private static func commandLineForCompilation(compilerPath: AbsolutePath, fileSystem: FileSystem) -> [String] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: reverse order of arguments
| } | ||
|
|
||
| /// Helper function to determine whether serialized diagnostics work properly in the current environment. | ||
| public func supportsSerializedDiagnostics(otherSwiftFlags: [String] = []) -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the hope/goal since this was needed because we were using the old driver in CI contexts (which apparently has a bug triggered by some of our tests).
|
@swift-ci please smoke test |
|
Looks like right now we're not even installing the driver, so we'd need to change that in the preset / CI job first. |
|
swiftlang/swift#61766 |
|
swiftlang/swift#61766 |
|
swiftlang/swift#61766 |
|
Doesn't look like |
|
What happened to the integrated swift driver that was added last year, #2736, did that not work out? Seems a waste to include that when building SPM and then not use it. |
I'm not 100% sure (cc @artemcm), but either way we cannot use it for manifest compilation / plugin loading since they happen separately from the build system. |
|
I think my Swift PR might be incorrect and install swift-driver after building SwiftPM, so that's why it is missing here. |
|
Yes, SPM is built and installed first because it is then used to build and install swift-driver, at least on linux and Android. |
|
swiftlang/swift#61766 |
|
OK, I added a |
|
The order of the flags is irrelevant, as SPM is used to build swift-driver, so it is always built and tested before. |
Ah interesting, that seems unfortunate. We're actually already building the driver as part of the first bootstrapping stage, maybe we can just change things to re-use the built products from that. |
|
Only the macOS CI builds the early swift-driver, the linux CI doesn't as it doesn't have a prebuilt Swift compiler installed. |
|
Oh, if you mean when bootstrapping SPM itself, not sure what executables that generates. |
|
So I think a viable path here could be:
|
This tries to use the swift-driver built during the first-stage for the "fake" toolchain we're constructing for bootstrapping. Basically a variation on #5842. Trying first whether it is sufficient to just have the symlink, if not we should be able to combine the approach from #5842 and this together.
In many cases, we're directly executing `swiftc` which means we are relying on the old driver. This switches us to calling `swift-driver --driver-mode=swiftc` instead if available.
|
@swift-ci please smoke test |
1 similar comment
|
@swift-ci please smoke test |
|
Probably time to abandon this, actually. Failures on self-hosted are proving that even explicitly using |
In many cases, we're directly executing
swiftcwhich means we are relying on the old driver. This switches us to callingswift-driver --driver-mode=swiftcinstead if available.