[build-script] New option: "--install-all"

Hey everyone!

Since we moved build-script to the "New Model" (the one where we are always installing into a toolchain and building from that toolchain), in order to build later build-script projects, one needed to ensure to pass in --install-* for each project one needed to install. This is a bit of a pain in the butt for normal usage.

In this PR: https://github.com/apple/swift/pull/31747, I am implementing some QoI around this that I think will be valuable to everyone. Specifically, I added a new build-script option called --install-all. The idea is that --install-all tells build-script to install every project that it builds. This can massively reduce the size of build-script command lines. For instance, consider the following command line to build swiftpm from the swiftpm bot:

# NOTE: I removed all skip-test-* options and to make it fair, I removed --swift-install-components.
# Those are both on the command line to ease bot maintenance.
./swift/utils/build-script --build-ninja --libcxx --llbuild --swiftpm
--install-swift --install-llbuild --install-swiftpm --install-libcxx
'--llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-resource-headers;compiler-rt;clangd;lld'
--libdispatch --libicu --foundation --xctest --install-libicu
--install-foundation --install-libdispatch --install-xctest --release
--assertions --sourcekit-lsp --toolchain-benchmarks 

Can now become:

./swift/utils/build-script --install-all --build-ninja --libcxx --llbuild
--swiftpm --libdispatch --libicu --foundation --xctest --release --assertions
--sourcekit-lsp --toolchain-benchmarks

That being said, even that is too long. I have a few thoughts on how to fix that... but lets see how hard it is. Stay tuned and I hope this helps peoples fingers!

5 Likes

This sounds great! If I wanted more than compiler & stdlib, I've mostly started using build-toolchain because I couldn't be bothered with all the install stuff :slight_smile:

1 Like
Terms of Service

Privacy Policy

Cookie Policy