generator: The target toolchain is still needed to build a package-based SDK #182
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.
PR #177 was intended to skip unnecessary toolchain downloads, making it possible to build a container-based SDK offline if all its requirements had already been dowloaded. The change was too broad and also broke building package-based SDKs.
PR #177 skips calling generator.downloadArtifacts() when building
an SDK without an embedded host toolchain (the default). In
addition to downloading the host toolchain (and LLVM, if needed),
generator.downloadArtifacts() is also responsible for downloading
the target toolchain. This is not needed when building a container-based
SDK but is required when building a package-based SDK, which combines
an SDK from swift.org with supporting libraries extracted from
Debian packages.
In fact, generator.downloadArtifacts() already avoids downloading toolchains when building a container-based SDK without an embedded
toolchain. The only network call which caused offline builds to
fail was an unconditional check for a suitable LLVM binary from
GitHub.
This PR restores the call to generator.downloadArtifacts() and only makes the LLVM check if LLVM is in the list of required downloads. This allows the EndToEnd tests to pass again (with PR #170 temporarily reverted because of issue #181).