Assorted bootstrap LLVM refactors (part 4/N) - #161290
Draft
Kobzol wants to merge 5 commits into
Draft
Conversation
And explicitly depend on building the host LLVM when we need to invoke its `llvm-config` binary.
…uests_download_from_ci`
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Continuation on #161247.
This PR completely removes handling of git changes or LLVM downloads from config parsing, and moves it into the
LlvmFromCistep. Thanks to that, we now also allow downloading LLVM for non-host targets.There is one annoyance related to that, and that is that
download-ci-llvmnow applies to all targets for which you try to build LLVM (d'uh), but that also means that if (for whatever reason) LLVM fails to be downloaded from CI, the build will fail. So if you build for target T2 from target T1:I think that we mostly have four options how to deal with this:
download-ci-llvmper target in the target config section. So that you can say that you want to download for T1, but build for T2.is_ci_llvm_available_for_targetlogic, which hard-codes a bunch of targets to "know" which ones offer LLVM and which don't. We could just try to download, and if the result is 404, then we print a warning and continue with building.I think that 4. would be the best. If we get a 404, there's no way we can download, so we build instead. If we get a different error, we still make the failed download fail the build.
Already before this PR, we did this:
so if LLVM wasn't available, we just silently reverted from
download-ci-llvm=truetodownload-ci-llvm=false. The 4. proposal would just generalize that, to actually check whether the LLVM files are present on the CDN or not.After I opened this PR, the CI failure showed something quite tricky: how to handle LLVM downloads during check builds. Bootstrap has an optimization, where if we are doing
x check:The question is what we should do about downloaded LLVM in this check. Should an LLVM that can be downloaded, but hasn't been downloaded yet, be considered "already built"? This comes up in commands like
x check --target T1, T2, T2 core, where previously we would just consider LLVM to be in "has to be built" mode, and so the build flags were not passed. But not, when LLVM can be actually downloaded, the situation is different.What the (currently two) places who have the check optimization want is something like:
llvm-config, pass the flagsWe could implement this more explicitly, however, there is one issue with checking 1., because for that we have to checkout the
src/llvm-projectsubmodule, to have a fully robust check if the local LLVM has been built or not (unless we want to just check that its local output directory exists or something). And of course checking out that submodule if you only dox checkis something that we also want to avoid...Based on #161247 (last three commits are new).
r? jieyouxu