-
Notifications
You must be signed in to change notification settings - Fork 30
Build host toolchain w/o copying it from snapshots #1024
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
@kateinoigakukun I've verified that both Linux and macOS distributions produce valid and working binaries with SwiftPM, the PR is now ready for review 🙂 |
@MaxDesiatov Looks good! Building host toolchain from same source is cleaner than before. |
@kateinoigakukun No, it didn't reach the limit even once during my testing. Only the |
Ok, I see that you're asking "when there is no cache", even in that case I don't think the build time would drastically increase. For the same reason, the only additional time spent here is on building the target SDK, the rest is cached locally during the same build. |
Build both host and target toolchains on CI Both `libPackageDescription.dylib` and `swiftc` used to compile package manifests should come from the same toolchain for SwiftPM to work on macOS. This is resolved here by re-reverting the previous change #1024 to build both host and target toolchain in one go on CI. I'm wary of the disk space/time limit constraints, but I think those should be resolved separately when they appear, otherwise SwiftPM is completely broken on macOS currently. Resolves #1365.
Currently the host toolchain is copied over to the target WASI toolchain from snapshots downloaded from swift.org. This is not ideal as snapshots on swift.org are not always fresh and don't always match what we have in the
swiftwasm
branch or even in the upstreammaster
branch. This causes issues similar to what can be seen in #1000, where the host toolchain and SDK don't match the target toolchain with this error:The solution is to:
$SOURCE_PATH/host-toolchain-sdk
directory$SOURCE_PATH/install
directory$SOURCE_PATH/host-toolchain-sdk
directory$SOURCE_PATH/host-toolchain-sdk
directory$SOURCE_PATH/host-toolchain-sdk
directoryThus
build-swiftpm.sh
script is no longer needed as SwiftPM is already compiled as a part of the host toolchain, which also avoids similar issues where SwiftPM from upstream snapshots can also be out of sync from what we build here on CI.