-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Next step for deprecations in Cargo #13629
Labels
A-cli
Area: Command-line interface, option parsing, etc.
A-edition-next
Area: may require a breaking change over an edition
A-manifest
Area: Cargo.toml issues
C-cleanup
Category: cleanup within the codebase
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
Comments
weihanglo
added
C-cleanup
Category: cleanup within the codebase
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
labels
Mar 22, 2024
This comment was marked as resolved.
This comment was marked as resolved.
epage
added
A-manifest
Area: Cargo.toml issues
A-cli
Area: Command-line interface, option parsing, etc.
labels
Apr 10, 2024
epage
added
the
A-edition-next
Area: may require a breaking change over an edition
label
Apr 10, 2024
9 tasks
We discussed some of these in today's team meeting and updated the next steps for those items. For things that weren't discussed I noted that the "Next Steps" are "proposed". |
bors
added a commit
that referenced
this issue
Apr 16, 2024
fix(toml): Error on `[project]` in Edition 2024 ### What does this PR try to resolve? `[package]` was added in 86b2a2a in the pre-1.0 days but `[project]` was never removed nor did we warn on its use until recently in #11135. So likely we can't remove it completely but we can remove it in Edition 2024+. This includes `cargo fix` support which is hard coded directly into the `cargo fix` command. This is part of - #13629 - rust-lang/rust#123754 While we haven't signed off on everything in #13629, I figured this (and a couple other changes) are not very controversial. ### How should we test and review this PR? Per commit. Tests are added to show the behavior changes, including in `cargo fix`. ### Additional information
epage
added a commit
to epage/cargo
that referenced
this issue
Apr 18, 2024
This is part of rust-lang#13629 This turns deps like ```toml foo = { optional = true } ``` from `version="*"` deps with a warning into errors. This breaking change was deemed acceptable because this behavior has been considered a bug from the beginning. We have gotten little to no feedback about people wanting this behavior. This improves our forwards-compatibility story as we can add new dependency sources and they won't be considered a wildcard registry dependency on older cargo.
bors
added a commit
that referenced
this issue
Apr 18, 2024
fix(toml)!: Disallow source-less dependencies ### What does this PR try to resolve? This is part of #13629 addressing “dependency without path, version, git, workspace specified”. This turns deps like ```toml foo = { optional = true } ``` from `version="*"` deps with a warning into errors. This breaking change was deemed acceptable because this behavior has been considered a bug from the beginning. We have gotten little to no feedback about people wanting this behavior. This improves our forwards-compatibility story as we can add new dependency sources and they won't be considered a wildcard registry dependency on older cargo. ### How should we test and review this PR? I removed the `cargo_add` test because it is redundant. We no longer get the “unused key” warnings because those warnings get deferred to after this error gets reported. ### Additional information
bors
added a commit
that referenced
this issue
Apr 22, 2024
fix(toml): Report `_` fied variants (e.g. `dev_dependencies`) as deprecated ### What does this PR try to resolve? This is prep for removing them in the 2024 Edition and is part of rust-lang/rust#123754 and #13629 This doesn't include 2024 Edition work because there is a risk of conflict with other work going on these areas. This changes us from - When using `-` and `_` variants: deprecated, will error some time - Otherwise, nothing To - When using `-` and `_` variants: unused field warning - When using only `_`: deprecation, will be removed in 2024 I decided to model this as an unused field warning because that is what this is and that is how any other use of `_` works. We might hard error during a transition period but I'd eventually want these to just make the code act like anything else in the end. ### How should we test and review this PR? ### Additional information
This was referenced Apr 24, 2024
bors
added a commit
that referenced
this issue
Apr 24, 2024
fix(toml): Be more forceful with underscore/dash redundancy ### What does this PR try to resolve? This is prep for removing them in the 2024 Edition and is part of rust-lang/rust#123754 and #13629 During #13783, I had considered making the 2024 edition behavior a "unused key" warning. However, the work and code mess to pipe the data through correctly handle the two fields in all cases didn't seem worth it (and a hard error might be better to help users transition). ### How should we test and review this PR? ### Additional information
bors
added a commit
that referenced
this issue
Apr 24, 2024
fix(toml): Don't double-warn when underscore is used in workspace dep ### What does this PR try to resolve? This is prep for removing them in the 2024 Edition and is part of rust-lang/rust#123754 and #13629 Particularly, I wanted to make sure I didn't make things worse and in doing so found there was room for improvement. ### How should we test and review this PR? ### Additional information
epage
added a commit
to epage/cargo
that referenced
this issue
Apr 25, 2024
This is part of the 2024 Edition and is part of rust-lang/rust#123754 and rust-lang#13629
epage
added a commit
to epage/cargo
that referenced
this issue
Apr 26, 2024
This is part of the 2024 Edition and is part of rust-lang/rust#123754 and rust-lang#13629
bors
added a commit
that referenced
this issue
Apr 26, 2024
fix(toml): Remove underscore field support in 2024 ### What does this PR try to resolve? This is part of the 2024 Edition and is part of rust-lang/rust#123754 and #13629 ### How should we test and review this PR? ### Additional information
3 tasks
weihanglo
added
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
and removed
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
labels
May 15, 2024
bors
added a commit
that referenced
this issue
May 29, 2024
fix(toml): Convert warnings that `licence` and `readme` files do not exist into errors ### What does this PR try to resolve? In this PR: - Changed the warning to a hard error and modified the associated test function; - Removed what should have been a redundant test function:`publish::publish_with_missing_readme`; - Since `cargo publish` is preceded by the execution of `cargo package`, the error message in the test `function bad_license_file` needs to be modified. issue: #13629 (comment). ### Additional information It seems that this is not enough, the current situation is that `cargo package` warns if `package.readme` is an empty string or the wrong file location, but if I cancel `package.readme`, no warning is generated. I'm wondering if I should judge `package.readme&licence` when executing `cargo package` and return an error if it doesn't exist? As this has not been done before, your advice is sought.
bors
added a commit
that referenced
this issue
May 29, 2024
fix(toml): Convert warnings that `licence` and `readme` files do not exist into errors ### What does this PR try to resolve? In this PR: - Changed the warning to a hard error and modified the associated test function; - Removed what should have been a redundant test function:`publish::publish_with_missing_readme`; - Since `cargo publish` is preceded by the execution of `cargo package`, the error message in the test `function bad_license_file` needs to be modified. issue: #13629 (comment). ### Additional information It seems that this is not enough, the current situation is that `cargo package` warns if `package.readme` is an empty string or the wrong file location, but if I cancel `package.readme`, no warning is generated. I'm wondering if I should judge `package.readme&licence` when executing `cargo package` and return an error if it doesn't exist? As this has not been done before, your advice is sought.
bors
added a commit
that referenced
this issue
Jun 9, 2024
fix(toml): Convert warnings that `licence` and `readme` files do not exist into errors ### What does this PR try to resolve? In this PR: - Changed the warning to a hard error and modified the associated test function; - Removed what should have been a redundant test function:`publish::publish_with_missing_readme`; - Since `cargo publish` is preceded by the execution of `cargo package`, the error message in the test `function bad_license_file` needs to be modified. issue: #13629 (comment). ### Additional information It seems that this is not enough, the current situation is that `cargo package` warns if `package.readme` is an empty string or the wrong file location, but if I cancel `package.readme`, no warning is generated. I'm wondering if I should judge `package.readme&licence` when executing `cargo package` and return an error if it doesn't exist? As this has not been done before, your advice is sought.
bors
added a commit
that referenced
this issue
Jun 9, 2024
fix: using `--release/debug` and `--profile` together becomes an error ### What does this PR try to resolve? part of #13629 issue #13629 (comment)
bors
added a commit
that referenced
this issue
Jun 9, 2024
fix(toml): remove `lib.plugin` key support and make it warning ### What does this PR try to resolve? Remove `lib.plugin` key, making it an "unused key" warning. Remove some of the tests, which should look useless (I hope I'm understanding this - [x] Remove key, and related tests. - [x] Adjust the documentation about the plugin. - [ ] Some of the comments and function names have not yet finished being modified. part of #13629 Closes #13246
bors
added a commit
that referenced
this issue
Jun 9, 2024
fix(toml): remove `lib.plugin` key support and make it warning ### What does this PR try to resolve? Remove `lib.plugin` key, making it an "unused key" warning. Remove some of the tests, which should look useless (I hope I'm understanding this - [x] Remove key, and related tests. - [x] Adjust the documentation about the plugin. - [ ] Some of the comments and function names have not yet finished being modified. part of #13629 Closes #13246
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-cli
Area: Command-line interface, option parsing, etc.
A-edition-next
Area: may require a breaking change over an edition
A-manifest
Area: Cargo.toml issues
C-cleanup
Category: cleanup within the codebase
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
2024 Deprecations
Problem
Cargo has been emitting a bunch deprecation message for a (long?) while. Since edition 2024 is approaching (1.82.0 anticipated), and a Cargo linting system is on the way (#13621), we might want to take advantage of this timing to evaluate whether this deprecations could be turned into a hard error.
The main risk here is CI automation might fail. Unlike rustc and clippy lints, people hardly noticed Cargo warnings becuase because there was no way to set
-D
on them.Deprecations
2024 Edition
These are being tracked in rust-lang/rust#123754
dev_dependencies
/build_dependencies
/default_features
/crate_types
/proc_macro
cargo/src/cargo/util/toml/mod.rs
Lines 198 to 199 in f0ae765
good old
[project]
(replaced with[package]
)cargo/src/cargo/util/toml/mod.rs
Lines 497 to 498 in f0ae765
[project]
within cargo #11135default-features
in inherited dependenciescargo/src/cargo/util/toml/mod.rs
Lines 1801 to 1803 in f0ae765
default-features
toTomlWorkspaceDependency
#11409Independent of Edition
Approved changes
plugin
supportlib.plugin
key support and make it warning #13902dependency withoutpath
,version
,git
,workspace
specifiedlicense-file
andreadme
pointing to a non-existent filelicence
andreadme
files do not exist into errors #13921--release
is ignored when paired with--profile
--release/debug
and--profile
together becomes an error #13971cargo read-manifest
Proposed changes
[replace]
is deprecatedcargo tree
flagsrustc-cdylib-link-arg
used in non-cdylib targetplugin
supportcargo/src/cargo/util/toml/targets.rs
Lines 211 to 216 in f0ae765
plugin
)dependency without
path
,version
,git
,workspace
specifiedcargo/src/cargo/util/toml/mod.rs
Lines 1914 to 1918 in 8bcecfe
Note:
[dependencies]
as well as[patch]
,[replace]
, including in virtual workspaces and config where Editions don't applylicense-file
andreadme
pointing to a non-existent filecargo/src/cargo/ops/cargo_package.rs
Lines 416 to 418 in f0ae765
license-file
; 1.71.0 (2023-08-03) forreadme
cargo package
on emptyreadme
orlicense-file
in manifest #12036--release
is ignored when paired with--profile
cargo/src/cargo/util/command_prelude.rs
Lines 570 to 573 in 8bcecfe
cargo read-manifest
cargo/src/bin/cargo/commands/read_manifest.rs
Line 9 in 8bcecfe
cargo metadata --no-deps
should cover its use cases.[replace]
is deprecatedcargo/src/doc/src/reference/overriding-dependencies.md
Lines 300 to 301 in 8bcecfe
[patch]
to fully replace[repalce]
?Carog.toml
)old
cargo tree
flags:--all
,no-dev-dependencies
,--no-indent
,--prefix-depth
,--all-targets
cargo/src/bin/cargo/commands/tree.rs
Lines 144 to 146 in 8bcecfe
all
; NO for otherspath override modifying dependency graph
cargo/src/cargo/core/registry.rs
Lines 535 to 538 in f0ae765
rustc-cdylib-link-arg
used in non-cdylib targetcargo/src/cargo/core/compiler/custom_build.rs
Lines 850 to 856 in f0ae765
rustc-cdylib-link-arg
error to a warning. #9563user-defined alias is shadowing an external subcommand found
cargo/src/bin/cargo/cli.rs
Lines 321 to 323 in f0ae765
cargo clippy
andcargo fmt
are what we concerned.output artifact name collisions
cargo/src/cargo/core/compiler/build_runner/mod.rs
Lines 472 to 474 in f0ae765
Bail out when trying to link to a library that is not linkable
cargo/src/cargo/core/compiler/mod.rs
Lines 1427 to 1430 in f0ae765
Ambiguous package name in git dependency
cargo/src/cargo/ops/cargo_read_manifest.rs
Lines 225 to 234 in bd1cf58
case
found at~\.cargo\git\checkouts\cargo-..
#10752case
found at~\.cargo\git\checkouts\cargo-..
#10752No further steps
deprecate
--all
(alias to--workspace
)cargo/src/cargo/util/command_prelude.rs
Line 54 in 8bcecfe
-w
for--workspace
#11554)--all
to--workspace
#7241Deprecate
.cargo/config
cargo/src/cargo/util/context/mod.rs
Lines 1563 to 1567 in 8bcecfe
The text was updated successfully, but these errors were encountered: