Skip to content

download bootstrap binary from ci #140069

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Shourya742
Copy link
Contributor

closes: #99989

@rustbot
Copy link
Collaborator

rustbot commented Apr 20, 2025

r? @onur-ozkan

rustbot has assigned @onur-ozkan.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 20, 2025
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan
Copy link
Member

I don't have space to review this.

r? Kobzol (feel free to reroll)

@rustbot rustbot assigned Kobzol and unassigned onur-ozkan Apr 20, 2025
@Shourya742 Shourya742 force-pushed the 2025-04-16-pre-compile-bootstrap branch from c04a7bc to eced81c Compare April 20, 2025 13:20
@rust-log-analyzer

This comment has been minimized.

@Shourya742 Shourya742 force-pushed the 2025-04-16-pre-compile-bootstrap branch from eced81c to 895fe51 Compare April 20, 2025 13:34
@rust-log-analyzer

This comment has been minimized.

@Shourya742 Shourya742 force-pushed the 2025-04-16-pre-compile-bootstrap branch from 895fe51 to 73c500a Compare April 20, 2025 13:48
@Shourya742 Shourya742 marked this pull request as ready for review April 20, 2025 14:15
@jyn514
Copy link
Member

jyn514 commented Apr 21, 2025

this misses the point. the point of precompiled bootstrap is to allow us not to require python at all. if we use the python script to download, all we gain is slightly faster compiles at the cost of a lot more complexity.

@jyn514
Copy link
Member

jyn514 commented Apr 21, 2025

oh, apparently that’s not what i said two years ago. oops.

probably just ignore anything i say then, i don’t have context on this anymore.

@Kobzol
Copy link
Contributor

Kobzol commented Apr 21, 2025

Removing the Python logic is an ongoing process. But even if we get rid of most of the Python scripts, we will still need something that will be responsible for setting up bootstrap. That something can be either shell scripts (but that would suck, as it's not cross-platform), some small amount of Python or e.g. a Rust Cargo script. We could even distribute bootstrap through rustup. That's still up to debate, I guess.

@Shourya742
Copy link
Contributor Author

Should we go ahead and close this, along with the upstream issue?

@onur-ozkan
Copy link
Member

Removing the Python logic is an ongoing process. But even if we get rid of most of the Python scripts, we will still need something that will be responsible for setting up bootstrap. That something can be either shell scripts (but that would suck, as it's not cross-platform), some small amount of Python or e.g. a Rust Cargo script. We could even distribute bootstrap through rustup. That's still up to debate, I guess.

I was planning to keep shell scripts as tiny as possible, (e.g., setting up the bootstrap toolchain and using it to run a program that configures and runs bootstrap).

So, after the migration work, it would look like this:

  1. Handle bootstrap compiler download, extraction and copying tasks with shell script
  2. Run (from shell script) a Rust program (which is a replacement of most of the Python code) that configures bootstrap and runs it
  3. The bootstrap workflow, nothing changes here

I am still waiting for #119899, I don't want to deal with 2 major tasks simultaneously. I did a bit of work on Python removal before (I almost done the most logic of 1. above), I will rebase it and continue from there.

Personally, I am not particularly interested in this work. That is another reason I did not want to review it as I do not feel comfortable engaging with it. It's either not worth, or at

@jieyouxu
Copy link
Member

jieyouxu commented Apr 22, 2025

I can't speak for other bootstrap team members, but I kinda don't want to download a precompiled bootstrap from CI in addition to CI LLVM and CI rustc. IME, for library and compiler workflows, building bootstrap is relatively fast (approx. 22 seconds on a dev desktop fresh). I feel very iffy about downloading bootstrap itself, because if this logic has issues then it becomes very very nasty to debug, what bootstrap binary other contributor runs on their system does not necessarily match what's built from HEAD...

Something like what Onur proposed seems much less risky to me, at least.

@Kobzol
Copy link
Contributor

Kobzol commented Apr 22, 2025

FWIW, we already have Python scripts that predownload Rust and Cargo that is used to build bootstrap, so in terms of download logic bugs, that situation wouldn't become worse here.

We have discussed this sometime in the past on Zulip, but what I would like the most is to simply say that you need to have a recent-ish Rust compiler available locally in order to build rustc. At this day and age, with rustup and Rust compilers being available in distro repositories, I don't think that it's too weird of a requirement (today you need to have a shell interpreter and Python available).

If we consider this requirement to be fine, then we can simply redirect x to first do a cargo build of bootstrap, and then do everything in bootstrap, without requiring any separate shell/Python/Rust scripts. We would also need to avoid bootstrap's compilation to depend on the contents of bootstrap.toml, but I think that's a good idea anyway, it should only contain runtime data. It's quite annoying when I change something (like disable warnings) in bootstrap.toml and bootstrap gets recompiled because of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download a pre-compiled bootstrap from CI
7 participants