Skip to content

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

Merged
artemcm merged 1 commit into
swiftlang:mainfrom
artemcm:TryEarlyDriverCopyNoSymlink
Oct 22, 2021
Merged

[SR-15135] Copy over early swift-driver executable to the build dir instead of creating a symlink#39822
artemcm merged 1 commit into
swiftlang:mainfrom
artemcm:TryEarlyDriverCopyNoSymlink

Conversation

@artemcm

@artemcm artemcm commented Oct 20, 2021

Copy link
Copy Markdown
Contributor

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

artemcm commented Oct 20, 2021

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@swift-ci

Copy link
Copy Markdown
Contributor

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

@finagolfin

Copy link
Copy Markdown
Member

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

artemcm commented Oct 20, 2021

Copy link
Copy Markdown
Contributor Author

@swift-ci please test macOS platform

@artemcm

artemcm commented Oct 20, 2021

Copy link
Copy Markdown
Contributor Author

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 requested review from compnerd and gottesmm October 20, 2021 17:53
@artemcm
artemcm marked this pull request as ready for review October 20, 2021 17:54
Comment thread cmake/modules/SwiftUtils.cmake Outdated
@artemcm
artemcm force-pushed the TryEarlyDriverCopyNoSymlink branch from 77436f9 to 9b3e02c Compare October 22, 2021 15:47
@artemcm

artemcm commented Oct 22, 2021

Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@artemcm

artemcm commented Oct 22, 2021

Copy link
Copy Markdown
Contributor Author

@compnerd does this look okay to merge?

Comment thread cmake/modules/SwiftUtils.cmake Outdated
Comment thread cmake/modules/SwiftUtils.cmake Outdated
@compnerd

Copy link
Copy Markdown
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
artemcm force-pushed the TryEarlyDriverCopyNoSymlink branch from 9b3e02c to f842782 Compare October 22, 2021 20:57
@artemcm

artemcm commented Oct 22, 2021

Copy link
Copy Markdown
Contributor Author

@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.

4 participants