-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SourceKit] Pass the main swift executable path when constructing a compiler invocation #58852
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
@swift-ci Please smoke test |
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.
Looks like a part of the change got lost so it doesn't compile, other than that LGTM, thanks!
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.
Couple questions:
- Why is this only a problem on Ubuntu 22.04 AArch64?
- This seems to imply that for testing both the regular compilation and SourceKit requests fail to find Clang, which seems... not ideal. The directory is optionally passed in
swift-ide-test
, but since this ends up affecting arguments I'm not sure that's really enough. @egorzhdan probably more of a question for you.
…ompiler invocation swiftlang#58786 (rdar://93030932) was failing because the `swift-frontend` invocations passed a `swiftExecutablePath` to `Invocation.parseArgs`. This caused the `ClangImporter` instance to point to a `clang` binary next to the `swift-frontend` executable while SourceKit used PATH to find `clang`. The clang executable next to `swift-frontend` doesn’t actually exist because `clang` lives in `llvm-linux-aarch64/bin` and `swift-frontend` lives in `swift-linux-aarch64/bin`. So some checks for a minimum clang verison failed for the normal build (because the executable doesn’t actually exists) while they pass during the SourceKit build (which used `clang` from `PATH`). This in turn caused the `outline-atomics` to be enabled to the SourceKit clang compiler arguments but not the clang compiler arguments for a normal build and thus resulted in two separate module cache directories (which includes the enabled features in the module directory hash). To fix this issue, also set the swift executable path for compiler invocations created from SourceKit. Fixes swiftlang#58786 (rdar://93030932)
89383c8
to
1525f6b
Compare
It’s only an issue on AArch64 because I haven’t checked why it’s not an issue on Ubuntu 20.04 but I assume it’s because because the
My intention with this patch was to make SourceKit match the normal compilation behavior. I filed #58885 to point |
@swift-ci Please smoke test |
Yep, to be clear, I wasn't suggesting you fix that in this PR - just wanted to know what's going on there. |
#58786 (rdar://93030932) was failing because the
swift-frontend
invocations passed aswiftExecutablePath
toInvocation.parseArgs
. This caused theClangImporter
instance to point to aclang
binary next to theswift-frontend
executable while SourceKit used PATH to findclang
. The clang executable next toswift-frontend
doesn’t actually exist becauseclang
lives inllvm-linux-aarch64/bin
andswift-frontend
lives inswift-linux-aarch64/bin
.So some checks for a minimum clang verison failed for the normal build (because the executable doesn’t actually exists) while they pass during the SourceKit build (which used
clang
fromPATH
). This in turn caused theoutline-atomics
to be enabled to the SourceKit clang compiler arguments but not the clang compiler arguments for a normal build and thus resulted in two separate module cache directories (which includes the enabled features in the module directory hash).To fix this issue, also set the swift executable path for compiler invocations created from SourceKit.
Fixes rdar://93030932 #58786