Skip to content

Finalized the new-bootstrap script #2437

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

Closed
wants to merge 1 commit into from

Conversation

hartbit
Copy link
Contributor

@hartbit hartbit commented Dec 4, 2019

This is a fairly substantial change to the new-bootstrap script, so here's a recap of the changes:

  • Split the different actions (clean, build, test, build-runtimes) into separate subparsers and implementation functions.
  • Created several helpers functions to avoid code duplication, including a build_with_cmake function that calls cmake with default + custom arguments (if no CMakeCache.txt) and then calls ninja.
  • Renamed a few functions to try to try to document them for future contributors (bootstrap becomes build_swiftpm_with_cmake, build_swiftpm becomes build_swiftpm_with_swiftpm).
  • Re-implemented a --verbose option that outputs all shell commands executed, and modified non-verbose behaviour to be less verbose in concequence.
  • Implemented the missing clean and test actions.

Let me know what you think 🙂

I replaced the code that figures out the target triple with the previous implementation from bootstrap, because clang --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 vs new-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 pass args.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 rebuild llbuild from scratch (when not linking to an llbuild framework).

SDKROOT

  • bootstrap: /Applications/Xcode.app/.../MacOSX10.15.sdk
  • new-bootstrap: nothing

We don't set this environment variable anymore, and I'm not sure if this is intended.

DYLD_LIBRARY_PATH and LD_LIBRARY_PATH

  • bootstrap: nothing
  • new-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 rebuild llbuild (see SWIFTPM_BOOTSTRAP).

Options

--disable-sandbox

  • bootstrap: is set
  • new-bootstrap: is not set

We 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 set
  • new-bootstrap: is not set

We don't set this option anymore. Not sure if its needed or not.

-Xswiftc -Xcc -Xswiftc -DSPM_BUILD_IDENT=c3252208

  • bootstrap: is set
  • new-bootstrap: is not set

We 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 set
  • new-bootstrap: are not set

We don't set theses option anymore. But it seems like the would be necessary when building a CI toolchain?

@hartbit hartbit requested a review from aciidgh as a code owner December 4, 2019 08:33
@hartbit hartbit force-pushed the new-bootstrap branch 2 times, most recently from c325220 to 172d0b6 Compare December 4, 2019 09:12
@hartbit hartbit force-pushed the new-bootstrap branch 14 times, most recently from 12f9ec0 to afb7b6d Compare December 9, 2019 10:12
@hartbit hartbit force-pushed the new-bootstrap branch 6 times, most recently from b66084b to 33e5071 Compare December 9, 2019 15:22
@aciidgh
Copy link
Contributor

aciidgh commented Dec 11, 2019

Taking over for now with #2447

@aciidgh aciidgh closed this Dec 11, 2019
@hartbit hartbit deleted the new-bootstrap branch December 11, 2019 21:27
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.

2 participants