Skip to content

download-rustc downloads rustc-dev even when it is not needed #142013

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
RalfJung opened this issue Jun 4, 2025 · 5 comments
Open

download-rustc downloads rustc-dev even when it is not needed #142013

RalfJung opened this issue Jun 4, 2025 · 5 comments
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-discussion Category: Discussion or questions that doesn't represent real issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

RalfJung commented Jun 4, 2025

The typical reason to download nightly rustc in ./x is to build the standard library. That only needs rustc + std. However, bootstrap currently also downloads rustc-dev. To minimize download time, mobile data usage, and disk space consumption, it'd be nice to avoid the download when it is not needed.

Cc @onur-ozkan

@RalfJung RalfJung added the C-bug Category: This is a bug. label Jun 4, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 4, 2025
@onur-ozkan onur-ozkan added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-discussion Category: Discussion or questions that doesn't represent real issues. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 4, 2025
@onur-ozkan
Copy link
Member

This will add a lot of complexity on bootstrap such as having different download, extract and copy logic depending on whether ci-rustc is enabled and whether it's running on a library or non-library step.

Also, you only download it once per HEAD so unless you frequently run git pull, it shouldn't significantly affect your network usage. I also wonder if there is any space for increasing the compression level (if it's not the highest one already) before uploading them.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 4, 2025 via email

@jyn514
Copy link
Member

jyn514 commented Jun 4, 2025

@onur-ozkan i think this should be simpler to implement than you imagine. rustc-dev can have its own stamp file and directory, and we only add it to the sysroot if someone calls builder.ensure(RustcDev). (in fact I thought we did that already, but maybe I am misremembering).

@rustbot label A-download-rustc

@onur-ozkan
Copy link
Member

The part I was concerned more was to update/replace current if download_rustc() on for non-tools and tools spots. I feel like it will be quite easy to use the wrong one instead of the other accidently.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 5, 2025

So the build system does not currently know whether a build needs the rustc libs?

I think ideally, a build step needs to say "I need rustc libs". If it doesn't do that, the libs are not in the search path and hence the build fails. If it does do that, that informs the download_rustc check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-download-rustc Area: The `rust.download-rustc` build option. C-discussion Category: Discussion or questions that doesn't represent real issues. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants