-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distribute bootstrap in CI #98483
Distribute bootstrap in CI #98483
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
r? @jyn514 |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks like roughly the right approach - I left a couple comments, but I'll go ahead and do a try run to confirm this works in CI.
@bors try |
⌛ Trying commit 57612869a0995361c9d9bbac8014b449608369d5 with merge 374196694bb6c1d561fe1ee38206a7e5a13bd4f7... |
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit b648737caf442c51ffe61a942774e68f6b82ffbb with merge e9b1f9380fec42aa93b6998a1e1a1dc2ae9adaff... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
643f118
to
4afd45d
Compare
This is looking pretty good to me except for the defaults. @Mark-Simulacrum I'd appreciate if you could take a look at #98483 (comment). |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (3f83906): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Warning ⚠: The following benchmark(s) failed to build:
Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
This restores functionality broken by rust-lang#98483. Unfortunately, it doesn't add a test to verify this works, but in this case we notice pretty quickly as perf uses this functionality and so reports breakage immediately after merging.
…jyn514 Support overriding initial rustc and cargo paths This restores functionality broken by rust-lang#98483. Unfortunately, it doesn't add a test to verify this works, but in this case we notice pretty quickly as perf uses this functionality and so reports breakage immediately after merging. r? `@jyn514` cc https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/rustc.20and.20cargo.20option.20broken.20in.20config.2Etoml, https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/Rustc.20benchmark.20broken
This PR seems to break my workflow that configures the Rust nightly tarball inside a Git-tracked directory. For example: $ git init my-project
$ mkdir my-project/rust-nightly
$ curl -sL https://static.rust-lang.org/dist/2022-09-28/rustc-nightly-src.tar.xz | tar xJC my-project/rust-nightly --strip-components=1
$ cd my-project/rust-nightly
$ git rev-parse --show-toplevel
/home/kleisauke/my-project
$ cp config.toml.example config.toml
$ ./x.py install --stage 1 -v
running: /home/kleisauke/my-project/rust-nightly/build/bootstrap/debug/bootstrap install --stage 1 -v
thread 'main' panicked at 'std::fs::read(&config.src.join("src").join("stage0.json")) failed with No such file or directory (os error 2)', config.rs:848:27
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
File "./x.py", line 28, in <module>
bootstrap.main()
File "/home/kleisauke/my-project/rust-nightly/src/bootstrap/bootstrap.py", line 936, in main
bootstrap(help_triggered)
File "/home/kleisauke/my-project/rust-nightly/src/bootstrap/bootstrap.py", line 922, in bootstrap
run(args, env=env, verbose=build.verbose, is_bootstrap=True)
File "/home/kleisauke/my-project/rust-nightly/src/bootstrap/bootstrap.py", line 166, in run
raise RuntimeError(err)
RuntimeError: failed to run: /home/kleisauke/my-project/rust-nightly/build/bootstrap/debug/bootstrap install --stage 1 -v (this is a simplified example from our Rust build script based on MXE) Is there a way to skip this logic? |
@kleisauke we can fix your issue by using |
@jyn514 IIUC, that wouldn't fix the above issue (+ I don't run the build script outside the source directory). The thing is that my parent directory is a Git-tracked directory and Perhaps |
Oh I see, you've unpacked a source tarball in a subdirectory of another git project. I highly suspect there's several other things that will be broken for you with that setup (like the commit hash we detect for the compiler version), it's not something we've ever considered or tested. I'm willing to take a PR that falls back to the tarball behavior when |
Sounds reasonable. Fixed with commit libvips/build-win64-mxe@9b293bc instead, thanks! |
I appear to be in the same boat as @kleisauke. I build rust in a directory called However, right now, my scripts for building Rust/LLVM only support building in the immediate subdirectory of where my scripts live. Because the bootstrap logic doesn't know were in the subdirectory of a different repo, this commit makes it impossible for me to build Rust using my workflow unless I do Perhaps a PR for overriding the |
|
FWIW, doing
If by "tarball" you mean "the Rust source" and not "the downloaded bootstrap compiler", I don't think this applies to me since I'm building Rust from the In other words, I think a PR that falls back to the tarball behavior is the only option I have unless you can think of a method to support my use case w/ a downloaded bootstrap. That said, I use I'll make a PR when I get the chance. |
Ok, you have a slightly different case: the build directory is within an unrelated git repo, not the source directory. I agree we should support that. |
This pre-compiles bootstrap from source and adds it to the existing
rust-dev
component. There are two main goals here:There are also several changes to make bootstrap able to run on a machine other than the one it was built (particularly around
config.src
andconfig.out
detection). I (@jyn514) am slightly concerned these will regress unless tested - maybe we should add an automated test that runs bootstrap in a chroot or something? Unclear whether the effort is worth the test coverage.Helps with #94829.