Skip to content

fix(install): Run cargo lints like rustc lints#17107

Merged
epage merged 3 commits into
rust-lang:masterfrom
epage:install
Jun 17, 2026
Merged

fix(install): Run cargo lints like rustc lints#17107
epage merged 3 commits into
rust-lang:masterfrom
epage:install

Conversation

@epage

@epage epage commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

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.warnings support for cargo lints.

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

@rustbot rustbot added A-workspaces Area: workspaces Command-install S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 16, 2026
@rustbot

rustbot commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, weihanglo

@epage epage marked this pull request as draft June 16, 2026 14:02
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2026
Comment thread src/cargo/diagnostics/passes.rs Outdated
let mut stats = GlobalDiagnosticStats::new();

emit_parse_ws_diagnostics(workspace, rules, &mut stats)?;
// HACK: we are assuming that virtual manifests are always local

@bjorn3 bjorn3 Jun 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Switched to checking the members

@epage epage marked this pull request as ready for review June 16, 2026 14:05
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 16, 2026
epage added 2 commits June 16, 2026 10:46
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
@epage epage force-pushed the install branch 3 times, most recently from c7f03cc to 6cdf779 Compare June 16, 2026 16:24
Comment thread tests/testsuite/https.rs
[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

@epage epage Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See

let mut ws = if source_id.is_git() || source_id.is_path() {
Workspace::new(pkg.manifest_path(), gctx)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good finding. Kinda related to #13259

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge with or without addressing the bitflags install.

View changes since this review

Comment thread tests/testsuite/https.rs
Comment on lines +174 to +175
[WARNING] Cargo.toml: unused manifest key: dependencies.bitflags.all-features
[WARNING] `bitflags-smoke-test` (manifest) generated 1 warning

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

https://github.com/bitflags/bitflags/blob/9253889ee93921055309908c46272bd6c5c6ad99/tests/smoke-test/Cargo.toml#L9

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that is something for us to look into separately.

@epage epage added this pull request to the merge queue Jun 17, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 17, 2026
@epage epage added this pull request to the merge queue Jun 17, 2026
Merged via the queue into rust-lang:master with commit 66c9ce8 Jun 17, 2026
45 of 58 checks passed
@epage epage deleted the install branch June 17, 2026 18:12
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 17, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jun 20, 2026
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
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jun 20, 2026
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)
@rustbot rustbot added this to the 1.98.0 milestone Jun 20, 2026
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jun 21, 2026
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants