Closed
Description
Since there is no -alt
variation of CI action for dist-aarch64-apple, prebuilt llvm is never published for arm macs.
Hence compete bootstrap like > ./x.py build library
will always fail on arm macs with
Copying stage0 library from stage0 (aarch64-apple-darwin -> aarch64-apple-darwin / aarch64-apple-darwin)
downloading https://ci-artifacts.rust-lang.org/rustc-builds-alt/<commit-hash>/rust-dev-nightly-aarch64-apple-darwin.tar.xz
curl: (22) The requested URL returned error: 404
error: failed to download llvm from ci
help: old builds get deleted after a certain time
help: if trying to compile an old commit of rustc, disable `download-ci-llvm` in config.toml:
[llvm]
download-ci-llvm = false
Although it's straightforward to fix by following the hint from error message and finding correct config.codegen.toml
(among other config.toml's), bootstrap experience could be better:
Config::download_ci_llvm()
could point to correct config file, since there are really few of them;Config::llvm_from_ci
could be set tofalse
for those host triplets that have no published llvm;- Prebuilt llvm could be published for
dist-aarch64-apple
ie creatingdist-aarch64-apple-alt
CI action; - Notion of fallback distros could be introduced ie
rust-dev-nightly-x86_64-apple-darwin.tar.xz
is fallback forrust-dev-nightly-aarch64-apple-darwin.tar.xz
.
Activity
albertlarsan68 commentedon Jan 23, 2023
@rustbot label +T-bootstrap +T-infra
config.toml
in the root of your checkout, this is where you should put the config, and not in thesrc/bootstrap/defaults/config.<insert profile here>.toml
Rattenkrieg commentedon Jan 23, 2023
@albertlarsan68 thank you for response! All clear with 1. 3. 4.
Regarding 2: I don't think this is a bug in implementation since the logic is explicitly programmed to stop build (exit the process) on missing remote resource. However this is indeed an unpleasant behavior. So as a user, epecialy first time one, I would prefer process to proceed with llvm build, or depending on configuration, fallback to probing local llvm installation.
albertlarsan68 commentedon Jan 23, 2023
I meant that the default is
if-available
, thus should not fail the build if it can't download CI LLVM, but build it from source as if the config was set tofalse
, and print a warning.jyn514 commentedon Jan 23, 2023
T-infra said in the meeting today that it's intentional that we don't distribute alt artifacts for tier 2 platforms: https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/meeting.202022-01-23/near/323042755. @albertlarsan68 is going to confirm today that this is limited to alt artifacts.
👍 this seems useful as long as the error is a 404, but we shouldn't build from source if static.rust-lang.org is having trouble (people should have to explicitly opt-in).
Separately, we may also want to distinguish tier 1 from tier 2 platforms in bootstrap, and not attempt to download the alt artifacts in the first place for tier 2 platforms.
I don't like this idea, we shouldn't silently change the platform we're building (and mixing x86 with aarch64 won't work anyway I don't think). For this specific case we could suggest setting
llvm-assertions = false
orbuild = "x86_64-apple-darwin"
explicitly in config.toml, but it shouldn't be a silent fallback.[-][BOOTSTRAP] Unable to download stage0 for aarch64-apple-darwin[/-][+]bootstrap: `download-ci-llvm = "if-available"` tries to download alt artifacts that don't exist on tier 2 platforms[/+]Rattenkrieg commentedon Jan 23, 2023
Can confirm, that download attempt and following failure happening when either
[llvm]
section does not havedownload-ci-llvm
entry ordownload-ci-llvm
is set to"if-available"
.Thank you for clarification @jyn514
Seems we may want to remove "aarch64-apple-darwin" from the list of supported platforms. Also bear in mind, that only
-alt
link leads to 404, for instance https://ci-artifacts.rust-lang.org/rustc-builds/5e37043d63bfe2f3be8fa5a05b07d6c0dad5775d/rust-dev-nightly-aarch64-apple-darwin.tar.xz works fine. So I'm not sure how it fit the logic ofsupported_platforms
list referred above.jyn514 commentedon Jan 23, 2023
This isn't the right fix because it will regress the experience for people using llvm without assertions. See my message above for what I think we should do.
Rattenkrieg commentedon Jan 23, 2023
Ah, I believe I'm getting it. The problem is that
supported_platforms
has no idea whether we consulting it with downloading-alt
distribution in mind or a basic one.Rattenkrieg commentedon Jan 23, 2023
Patching
is_ci_llvm_available()
like thatdid the trick for me.
jyn514 commentedon Jan 23, 2023
@Rattenkrieg are you interested in making a patch like that for all the tier 2 targets? :) you can find a list here: https://doc.rust-lang.org/nightly/rustc/platform-support.html
(it will probably be easier to have a separate tier 1 and tier 2 list so you don't have to duplicate the names)
Rattenkrieg commentedon Jan 23, 2023
@jyn514 sure, let me try.
Another option would be to have
supported_platforms
as an array of(&str, bool)
. So we can do the check likeNot sure which one is cleaner/easier to maintain, I'm going to experiment with both.
Rollup merge of rust-lang#107234 - Rattenkrieg:bootstrap-fix-is_ci_ll…
Rollup merge of rust-lang#107234 - Rattenkrieg:bootstrap-fix-is_ci_ll…
download-ci-llvm
on old checkout #107506