Finalized the new-bootstrap script #2437
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a fairly substantial change to the
new-bootstrap
script, so here's a recap of the changes:build_with_cmake
function that callscmake
with default + custom arguments (if noCMakeCache.txt
) and then callsninja
.bootstrap
becomesbuild_swiftpm_with_cmake
,build_swiftpm
becomesbuild_swiftpm_with_swiftpm
).--verbose
option that outputs all shell commands executed, and modified non-verbose behaviour to be less verbose in concequence.clean
andtest
actions.Let me know what you think 🙂
I replaced the code that figures out the target triple with the previous implementation from
bootstrap
, becauseclang --print-target-triple
kept failing on the Linux CI. If you have any idea why, please let me know.To help document the differences between the old
bootstrap
swift-build shell invocations vsnew-bootstrap
, and to make sure we don't overlook anything, here's a recap:Environment variables
SWIFT_EXEC
bootstrap
:/.../.build/{target}/debug/swiftc
new-bootstrap
:args.swiftc_path
We don't symlink
swiftc
anymore as it isn't necessary. Instead, we passargs.swiftc_path
directly.SWIFTPM_BUILD_DIR
bootstrap
:/.../.build
new-bootstrap
:/.../.build
No change.
SWIFTPM_BOOTSTRAP
bootstrap
:1
new-bootstrap
:1
(only when linking to an llbuild framework)We don't pass it anymore as want to let
swift-build
rebuildllbuild
from scratch (when not linking to an llbuild framework).SDKROOT
bootstrap
:/Applications/Xcode.app/.../MacOSX10.15.sdk
new-bootstrap
: nothingWe don't set this environment variable anymore, and I'm not sure if this is intended.
DYLD_LIBRARY_PATH
andLD_LIBRARY_PATH
bootstrap
: nothingnew-bootstrap
:/.../.build/{target}/bootstrap/lib:/.../.build/{target}/llbuild/lib
I'm not sure why we set these environment variables in the new script if we let
swift-build
rebuildllbuild
(seeSWIFTPM_BOOTSTRAP
).Options
--disable-sandbox
bootstrap
: is setnew-bootstrap
: is not setWe don't set this option anymore and it doesn't seem to have an impact, so I think its worth leaving out.
-Xlinker -rpath -Xlinker @executable_path/../lib/swift/macosx
bootstrap
: is setnew-bootstrap
: is not setWe don't set this option anymore. Not sure if its needed or not.
-Xswiftc -Xcc -Xswiftc -DSPM_BUILD_IDENT=c3252208
bootstrap
: is setnew-bootstrap
: is not setWe don't set this option anymore. Not sure if its needed or not.
-Xswiftc -I/.../.build/{target}/debug/llbuild/products/llbuildSwift
-Xswiftc -I/.../llbuild/products/libllbuild/include
-Xlinker -rpath -Xlinker @executable_path/../lib/swift/pm/llbuild
-Xlinker -L/.../.build/{target}/debug/llbuild/lib
-Xlinker -rpath -Xlinker /.../.build/{target}/debug/llbuild/lib
bootstrap
: are setnew-bootstrap
: are not setWe don't set theses option anymore. But it seems like the would be necessary when building a CI toolchain?