[5.6][build] Allow cross-compiling build-script products for non-Darwin hosts too #40525
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.
Cherrypick of #36917
Explanation: This pull consists of a handful of
build-script
changes that enable cross-compiling later Pythonbuild-script
products like SPM and swift-driver for non-Darwin hosts, just as is currently possible when cross-compiling the toolchain for macOS arm64, including generating a cross-compilation destination JSON config file to use with SPM for Android. Most of the pull is scoped to non-Darwin cross-compilation or specifically to Android, with the exception of some install prefix refactoring, because cross-compilation for non-Darwin hosts installs the toolchains separately under a directory named for each host.Scope: Since this is only build-related and mostly for non-Darwin cross-compilation, most is not even run on the CI, with the exception of the install prefix refactoring.
SR Issue: None
Risk: Almost none, only the simple install prefix changes even affect the normal host builds.
Testing: I've been using earlier versions of this pull for a while to cross-compile the toolchain for Android and recently added it to my Android CI so I can cross-compile SPM for Android with every trunk snapshot.
Reviewer: @gottesmm