Skip to content
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

[SR-15135] Copy over early swift-driver executable to the build dir instead of creating a symlink #39822

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Oct 20, 2021

The SwiftDriver searches swift-frontend based on Bundle.main.executablePath (which internally uses CFGetProcessPath). This search dir is resolved differently on macOS and Linux so swift-frontend can't be found on Linux, forcing the driver to fallback to using the host system toolchain instead of the just-built one.

@artemcm
Copy link
Contributor Author

artemcm commented Oct 20, 2021

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 77436f95bc24e947b0d90ef7ae0fdf147ef3e05a

@finagolfin
Copy link
Contributor

I think this will work, but one problem is that this isn't tested on the linux CI, as there is no prebuilt host toolchain installed on there:

 ('-- Warning: {}', 'Host toolchain could not locate a compiler to build swift-driver. (Try `--skip-early-swift-driver`)')

@artemcm
Copy link
Contributor Author

artemcm commented Oct 20, 2021

@swift-ci please test macOS platform

@artemcm
Copy link
Contributor Author

artemcm commented Oct 20, 2021

I think this will work, but one problem is that this isn't tested on the linux CI, as there is no prebuilt host toolchain installed on there:

 ('-- Warning: {}', 'Host toolchain could not locate a compiler to build swift-driver. (Try `--skip-early-swift-driver`)')

Ah, that's pretty unfortunate.
I've tested this locally on an Ubuntu 20.04 machine with a host toolchain installed and stdlib builds correctly using the just-built compiler.

@artemcm artemcm marked this pull request as ready for review October 20, 2021 17:54
@artemcm
Copy link
Contributor Author

artemcm commented Oct 22, 2021

@swift-ci please test

@artemcm
Copy link
Contributor Author

artemcm commented Oct 22, 2021

@compnerd does this look okay to merge?

cmake/modules/SwiftUtils.cmake Show resolved Hide resolved
cmake/modules/SwiftUtils.cmake Show resolved Hide resolved
@compnerd
Copy link
Member

Yeah, I think that its safe, minor note request, but a follow up is just as fine, no need to wait for the CI times.

… instead of creating a symlink

The SwiftDriver searches `swift-frontend` based on `Bundle.main.executablePath` (which internally uses `CFGetProcessPath`). This search dir is resolved differently on macOS and Linux so swift-frontend can't be found on Linux, forcing the driver to fallback to using the host system toolchain instead of the just-built one.
@artemcm
Copy link
Contributor Author

artemcm commented Oct 22, 2021

@swift-ci please smoke test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants