rust-lang / rust-lang/rust

Cleanup: make the `self-contained` path within sysroot calculation more principled

Open
#142,361 1 comment 2 reactions 1 assignee View on GitHub

@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 Builder for getting similar paths (invoked through the Libdir step) 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.