Cleanup: make the `self-contained` path within sysroot calculation more principled
Open
@Kobzol is already working on this.
Since Jun 11, 2025.
C-cleanup
T-bootstrap
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
See https://github.com/rust-lang/rust/pull/142357#discussion_r2139930429.
Suggestion (follow-up, not for this PR): maybe pull out a method to do the "path to sysroot target
self-contained" logic.
...
I actually had a commit for that, but it's super tricky (lol). Because:
- There are like 5 places in bootstrap that access the self-contained directory. Some of them need a relative path, some of them absolute, some of them work with a compiler, some don't, it's a mess.
- The functions that we have in
Builderfor getting similar paths (invoked through theLibdirstep) actually delete the directory before returning it to you 🤦 I tried to use it here and it broke everything 😂 I need to clean all of this up eventually, and move the directory clearing to a single step, so that you can get a path to something without bootstrap falling over, lol.-- https://github.com/rust-lang/rust/pull/142357#discussion_r2139952945
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.