fix(install): Run cargo lints like rustc lints#17107
Conversation
|
r? @ehuss rustbot has assigned @ehuss. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| let mut stats = GlobalDiagnosticStats::new(); | ||
|
|
||
| emit_parse_ws_diagnostics(workspace, rules, &mut stats)?; | ||
| // HACK: we are assuming that virtual manifests are always local |
There was a problem hiding this comment.
If you do cargo install --git https://example.com/foo.git bar where the root of the git repo is a virtual workspace containing the bar crate, will workspace here refer to said virtual workspace, or will it refer to a workspace with the bar crate as sole member?
There was a problem hiding this comment.
Good call. Switched to checking the members
This will get messy as we move existing diagnostics to the diagnostic system because - deferred errors from TOML parsing are capped - existing diagnostics (like rust-version check) are not
c7f03cc to
6cdf779
Compare
| [UPDATING] git repository `https://github.com/rust-lang/bitflags.git` | ||
| [INSTALLING] bitflags-smoke-test [..] | ||
| [WARNING] Cargo.toml: unused manifest key: dependencies.bitflags.all-features | ||
| [WARNING] `bitflags-smoke-test` (manifest) generated 1 warning |
There was a problem hiding this comment.
Note: there is an existing bug in cargo install --git where we download the git source and then load it as a path source so it is considered local and rustc and cargo lints are shown.
There was a problem hiding this comment.
See
cargo/src/cargo/ops/cargo_install.rs
Lines 925 to 926 in d3b55f8
| [WARNING] Cargo.toml: unused manifest key: dependencies.bitflags.all-features | ||
| [WARNING] `bitflags-smoke-test` (manifest) generated 1 warning |
There was a problem hiding this comment.
This looks like a bug in its manifest.
Since now we have more dependencies on the shape of bigflags, should we install a specific commit install of HEAD?
There was a problem hiding this comment.
I would say that is something for us to look into separately.
Update cargo submodule 8 commits in 598ab48ec328e3e4f5e4e373d8df7264bc8e27cd..71e52e6ef695518c3a7d166fdde0dc3650c2fedd 2026-06-17 02:39:50 +0000 to 2026-06-19 16:23:18 +0000 - chore(deps): update msrv to v1.94 (rust-lang/cargo#17121) - test(update): show cross-registry multi-spec precise (rust-lang/cargo#17119) - fix(resolver): hint how to resolve too-new versions (rust-lang/cargo#17118) - fix(add): list too-new versions and how to override (rust-lang/cargo#17117) - feat: `-Zmin-publish-age` (RFC 3923) (rust-lang/cargo#17012) - feat(diag): Support `build.warnings` for cargo lints (rust-lang/cargo#17112) - Remove windows-sys dependencies older than 0.61 (rust-lang/cargo#17115) - fix(install): Run cargo lints like rustc lints (rust-lang/cargo#17107) r? ghost
Update cargo submodule 9 commits in 598ab48ec328e3e4f5e4e373d8df7264bc8e27cd..a595d0da21f228b7fdae64d3d5c0e527ea66bb59 2026-06-17 02:39:50 +0000 to 2026-06-20 13:42:59 +0000 - fix(host-config): dont apply target config to host artifacts (rust-lang/cargo#17123) - chore(deps): update msrv to v1.94 (rust-lang/cargo#17121) - test(update): show cross-registry multi-spec precise (rust-lang/cargo#17119) - fix(resolver): hint how to resolve too-new versions (rust-lang/cargo#17118) - fix(add): list too-new versions and how to override (rust-lang/cargo#17117) - feat: `-Zmin-publish-age` (RFC 3923) (rust-lang/cargo#17012) - feat(diag): Support `build.warnings` for cargo lints (rust-lang/cargo#17112) - Remove windows-sys dependencies older than 0.61 (rust-lang/cargo#17115) - fix(install): Run cargo lints like rustc lints (rust-lang/cargo#17107)
Update cargo submodule 9 commits in 598ab48ec328e3e4f5e4e373d8df7264bc8e27cd..a595d0da21f228b7fdae64d3d5c0e527ea66bb59 2026-06-17 02:39:50 +0000 to 2026-06-20 13:42:59 +0000 - fix(host-config): dont apply target config to host artifacts (rust-lang/cargo#17123) - chore(deps): update msrv to v1.94 (rust-lang/cargo#17121) - test(update): show cross-registry multi-spec precise (rust-lang/cargo#17119) - fix(resolver): hint how to resolve too-new versions (rust-lang/cargo#17118) - fix(add): list too-new versions and how to override (rust-lang/cargo#17117) - feat: `-Zmin-publish-age` (RFC 3923) (rust-lang/cargo#17012) - feat(diag): Support `build.warnings` for cargo lints (rust-lang/cargo#17112) - Remove windows-sys dependencies older than 0.61 (rust-lang/cargo#17115) - fix(install): Run cargo lints like rustc lints (rust-lang/cargo#17107)
What does this PR try to resolve?
Run them for local but cap for non-local packages
How to test and review this PR?
This is prep for
build.warningssupport for cargo lints.This will get messy as we move existing diagnostics to the diagnostic
system because