Skip to content

fix(toml)!: Disallow [lints] in virtual workspaces#13155

Merged
bors merged 2 commits into
rust-lang:masterfrom
epage:lint
Dec 11, 2023
Merged

fix(toml)!: Disallow [lints] in virtual workspaces#13155
bors merged 2 commits into
rust-lang:masterfrom
epage:lint

Conversation

@epage

@epage epage commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

This was missed with the initial [lints] implementation.

While this is a breaking change, this is aligned with ones we've done in the past. A lot of times, we warn first. My hope is that isn't needed this time because

  • It only exists virtual workspaces so they aren't published
  • It is a nop to have this which is likely to be caught
  • This is so new that the number of people using it, and likely running into this case, is quite low.

This was missed with the initial `[lints]` implementation.

While this is a breaking change, this is aligned with ones we've done in
the past.  A lot of times, we warn first.  My hope is that isn't needed
this time because
- It only exists virtual workspaces so they aren't published
- It is a nop to have this which is likely to be caught
- This is so new that the number of people using it, and likely running
  into this case, is quite low.
@rustbot

rustbot commented Dec 11, 2023

Copy link
Copy Markdown
Collaborator

r? @weihanglo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2023

@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.

Agree that we make this a hard error asap. The old PR did it as well #6276.

pub workspace: Option<TomlWorkspace>,
pub badges: Option<InheritableBtreeMap>,
pub lints: Option<InheritableLints>,
// when adding new fields, be sure to check whether `to_virtual_manifest` should disallow them

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.

Wonder we have a way to catch this automatically.

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.

The best way to catch this would be to put it in the design of the structs.

The problem is this doesn't align well with serde to say "these fields depend on this other field being present". We'd likely have to do stuff like what we do with workspace inheritance where we deserialize twice between two structures and pick the more appropriate one. Bleh. This isn't why I haven't done a bigger fix yet.

@weihanglo

Copy link
Copy Markdown
Member

What does ! mean in fix(toml)!:?

@weihanglo

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

📌 Commit 48c72b9 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2023
@bors

bors commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

⌛ Testing commit 48c72b9 with merge a0339b0...

@bors

bors commented Dec 11, 2023

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing a0339b0 to master...

@bors bors merged commit a0339b0 into rust-lang:master Dec 11, 2023
@epage

epage commented Dec 11, 2023

Copy link
Copy Markdown
Contributor Author

What does ! mean in fix(toml)!:?

Breaking change

@epage epage deleted the lint branch December 11, 2023 21:06
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 12, 2023
Update cargo

20 commits in 9787229614b27854cf73d57ffae430d7c1e6caa4..1aa9df1a5be205cce621f0bc0ea6062a5e22a98c
2023-12-06 02:29:23 +0000 to 2023-12-12 14:52:31 +0000
- crates-io: Add support for other 2xx HTTP status codes (rust-lang/cargo#13158)
- Remove the deleted feature test_2018_feature from the test (rust-lang/cargo#13156)
- refactor(schema): Remove reliance on cargo types (rust-lang/cargo#13154)
- fix(toml)!: Disallow `[lints]` in virtual workspaces (rust-lang/cargo#13155)
- Limit exported-private-dependencies lints to libraries (rust-lang/cargo#13135)
- chore: update to gix-index@0.27.1 (rust-lang/cargo#13148)
- Update curl-sys to bring in curl 8.5.0 (rust-lang/cargo#13147)
- chore: downgrade to openssl v1.1.1 (rust-lang/cargo#13144)
- fix: explicitly remap current dir by using `.` (rust-lang/cargo#13114)
- Don't rely on mtime to test changes (rust-lang/cargo#13143)
- refactor: Pull PackageIdSpec into schema (rust-lang/cargo#13128)
- fix: Print rustc messages colored on wincon (rust-lang/cargo#13140)
- Add a windows manifest file (rust-lang/cargo#13131)
- Avoid writing CACHEDIR.TAG if it already exists (rust-lang/cargo#13132)
- re-enable flaky tests thanks to update to `gix-config`. (rust-lang/cargo#11821) (rust-lang/cargo#13130)
- fix bash completion in directory with spaces (rust-lang/cargo#13126)
- test: re-ignore git auth tests for gitoxide (rust-lang/cargo#13129)
- fix(toml): Disallow inheriting of dependency public status (rust-lang/cargo#13125)
- re-enable previously disabled tests with Windows-specific fix (rust-lang/cargo#13117)
- refactor: Clarify PackageId constructor names (rust-lang/cargo#13123)
@rustbot rustbot added this to the 1.76.0 milestone Dec 12, 2023
@jdahlstrom

Copy link
Copy Markdown

I'm probably missing something, but what's the rationale for this? Surely it may be useful to also harmonize lints in a virtual workspace?

@weihanglo

weihanglo commented Feb 4, 2024

Copy link
Copy Markdown
Member

I'm probably missing something, but what's the rationale for this? Surely it may be useful to also harmonize lints in a virtual workspace?

Then one should use [workspace.lints] instead of [lints]. This PR prohibits the latter, which is no-op.

@GeeWee

GeeWee commented Feb 9, 2024

Copy link
Copy Markdown

Ah, that distinction also confused me. I think it might be worth emphasizing it in the release notes if they're not immutable :)

@epage

epage commented Feb 9, 2024

Copy link
Copy Markdown
Contributor Author

I posted #13425

bors added a commit that referenced this pull request Feb 9, 2024
docs(changelog): Clarify lints in virtual workspace error

Inspired by a conversation at #13155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-manifest Area: Cargo.toml issues S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants