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

CARGO_BAZEL_REPIN does not work with lints.workspace = true #2536

Closed
QuentinPerez opened this issue Mar 2, 2024 · 3 comments
Closed

CARGO_BAZEL_REPIN does not work with lints.workspace = true #2536

QuentinPerez opened this issue Mar 2, 2024 · 3 comments

Comments

@QuentinPerez
Copy link
Contributor

Hi 👋

I use the https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html#lint-configuration-through-cargo feature, but it seems it does not work well with cargo-bazel. Here is the error.

> CARGO_BAZEL_REPIN=true bazel query //...
// ... skipped
Caused by:
  error inheriting `lints` from workspace root manifest's `workspace.lints`

Caused by:
  `workspace.lints` was not defined

# Cargo.toml
[workspace]
members = ["api/"]
resolver = "2"

[workspace.package]
edition = "2021"
version = "0.1.0"

[workspace.dependencies]
## External

## Internal

[workspace.lints]
clippy.clear_with_drain = "warn"
# api/Cargo.toml
[package]
name = "api"
edition.workspace = true
version.workspace = true

[dependencies]

[lints]
workspace = true

Do you have an idea ?

@illicitonion
Copy link
Collaborator

We generate a synthetic workspace Cargo.toml for the sake of dependency resolution, and it doesn't have a [workspace.lints] section.

We can make it have one if needed, but I ask https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/lints.2Eworkspace.20requires.20workspace.20to.20define.20lints to get some clarity on whether Cargo should actually be erroring in this case.

@ParkMyCar
Copy link
Contributor

I was running into the same issue, and I'm pretty sure it's because the current version of cargo-toml doesn't parse the workspace [lints] section. Upgrading cargo-toml to > 0.19 fixed it for me: #2434

github-merge-queue bot pushed a commit that referenced this issue Mar 19, 2024
@UebelAndre
Copy link
Collaborator

Addressed in #2551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants