Skip to content
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

Manifests in rustc-src distributed package are not valid any more #138304

Closed
RalfJung opened this issue Mar 10, 2025 · 7 comments
Closed

Manifests in rustc-src distributed package are not valid any more #138304

RalfJung opened this issue Mar 10, 2025 · 7 comments
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@RalfJung
Copy link
Member

The Miri build against latest rustc master is failing with the following error:

error: failed to parse manifest at `/home/runner/.rustup/toolchains/miri/lib/rustlib/rustc-src/rust/compiler/rustc/Cargo.toml`

Caused by:
  error inheriting `lints` from workspace root manifest's `workspace.lints`

The problem is that that Cargo.toml file appears inside a workspace in this repo, but not in rustc-src. So this breaks every useage of cargo on the distributed rustc-src artifacts.

This is caused by #138084. Cc @nnethercote @jieyouxu. I think that PR should be reverted to minimize downstream breakage while we consider our options.

@RalfJung RalfJung added the C-bug Category: This is a bug. label Mar 10, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 10, 2025
@jieyouxu
Copy link
Member

... Yeah. I'll post a revert to buy time to reconsider this.

jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 10, 2025
Revert <rust-lang#138084> to buy time to
consider options that avoids breaking downstream usages of cargo on
distributed `rustc-src` artifacts, where such cargo invocations fail due
to inability to inherit `lints` from workspace root manifest's
`workspace.lints` (this is only valid for the source rust-lang/rust
workspace, but not really the distributed `rustc-src` artifacts).

This breakage was reported in
<rust-lang#138304>.

This reverts commit 48caf81, reversing
changes made to c666287.
@jieyouxu
Copy link
Member

jieyouxu commented Mar 10, 2025

Revert: #138306.

Looks like we may have to go the magical-env-var-hack or sth (cf. #138106) afterall...

@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 10, 2025
@bjorn3
Copy link
Member

bjorn3 commented Mar 10, 2025

Why is the root Cargo.toml not included in rustc-src? Is it because rustc-src doesn't contain other projects that are part of the root workspace too?

@jieyouxu
Copy link
Member

jieyouxu commented Mar 10, 2025

Why is the root Cargo.toml not included in rustc-src? Is it because rustc-src doesn't contain other projects that are part of the root workspace too?

I suspect this is the case if rustc-src wants to focus on being the compiler sources, because the root manifest also has stuff for tools, bootstrap bits and library bits.

@RalfJung
Copy link
Member Author

yeah the root Cargo.toml contains a lot of members that are not part of rustc-src. If we wanted to include it, we'd have to filter the members list, as cargo AFAIK will error out when a member does not exist.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2025
…=Noratrieb

Revert "Use workspace lints for crates in `compiler/` rust-lang#138084"

Revert <rust-lang#138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). The problem is that the `rustc-src` component doesn't include the root `Cargo.toml` manifest.

This breakage was reported in rust-lang#138304.

This reverts commit 48caf81, reversing changes made to c666287.

cc `@RalfJung`

r? `@nnethercote` (sorry, I didn't consider this being a thing 💀)
@tgross35
Copy link
Contributor

In addition to lints, workspace dependencies may be nice in the future. If fixing up the workspace Cargo.toml before release is an option, that seems like a nice way forward so we keep its advantages.

It may also be possible to split the workspaces based on what gets distributed, like Bjorn did for library/ somewhat recently.

rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 10, 2025
Rollup merge of rust-lang#138306 - jieyouxu:revert-workspace-lints, r=Noratrieb

Revert "Use workspace lints for crates in `compiler/` rust-lang#138084"

Revert <rust-lang#138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). The problem is that the `rustc-src` component doesn't include the root `Cargo.toml` manifest.

This breakage was reported in rust-lang#138304.

This reverts commit 48caf81, reversing changes made to c666287.

cc `@RalfJung`

r? `@nnethercote` (sorry, I didn't consider this being a thing 💀)
@jieyouxu
Copy link
Member

The revert landed so closing this specific instance as fixed. However, this is one of those general #136822 problems.

And yeah, having multiple dist components that serve different consumers but that we don't really test is really not great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants