Skip to content

The distributed compiler sources do not come with an up-to-date lockfile #116229

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 Sep 28, 2023 · 3 comments
Open
Labels
A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-release Relevant to the release subteam, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

After installing the rustc-src component, trying to run cargo metadata on them will fail if the sources are installed in a read-only location (such as on Nix, or when cargo metadata is run in a sandbox). This could be avoided by either fixing cargo (rust-lang/cargo#10096), or by adjusting the rustc-src component to work around this behavior of cargo, by shipping an up-to-date lockfile.

Part of the problem seems to be that the cargo crates are not in a workspace any more when they are inside rustc-src. However, sadly, even if one puts a Cargo.toml (with all references to library/ and src/tools/ removed) into the right place, Cargo is still not happy with the lockfile -- it insists on removing everything unnecessary from this lockfile. So producing a lockfile that cargo is happy with could be rather tricky.

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 28, 2023
@workingjubilee workingjubilee added the A-reproducibility Area: Reproducible / deterministic builds label Sep 28, 2023
@jonhoo
Copy link
Contributor

jonhoo commented Oct 3, 2023

This feels somewhat-related to #95736

@RalfJung
Copy link
Member Author

RalfJung commented Oct 3, 2023

Yeah this is kind of the rustc-src version of that rust-src issue (note the rustc vs rust).

Somehow the rust-src issue doesn't seem to affect rust-analyzer or it has another way to work on a read-only file system; it's only with rustc-src that I am having trouble.

@jonhoo
Copy link
Contributor

jonhoo commented Oct 3, 2023

Now that you mention it, I seem to remember there's some special handling for rust-src in RA iirc for exactly this reason 🤔

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 31, 2023
@jieyouxu jieyouxu added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. T-release Relevant to the release subteam, which will review and decide on the PR/issue. labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-reproducibility Area: Reproducible / deterministic builds C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants