Open weihanglo opened 5 months ago
dependency without path, version, git, workspace specified
While it says it may transition to a hard error, the fact that issues seemed to exist where we broke people previously for this makes me cautious about doing it.
I'm at least for making this an error on the next Edition.
cargo read-manifest
As this is a command, I don't think there are further next steps.
At most, we could check the Edition and hard error but that seems unnecessary.
We could hide it in cargo --list
but its good for people to know what built-ins exist because of how conflicts work with commands.
path override modifying dependency graph
I don't have a good feel for this for turning
Bail out when trying to link to a library that is not linkable
I feel like this is blocked on issues like #7825
output artifact name collisions
Is this blocked on #8794?
deprecate --all (alias to --workspace)
We should remove this from -h
.
Otherwise, as a CLI, there isn't much more we should do.
[replace] is deprecated
Being config, I'm not sure there is much we should do.
license-file and readme pointing to a non-existent file
At one point, this was an error. I wonder if we were too aggressive in making this a warning.
Maybe if the fields are empty, we allow it but otherwise go ahead and error?
old cargo tree flags: --all, no-dev-dependencies, --no-indent, --prefix-depth, --all-targets
Being a CLI, is there much we should do?
rustc-cdylib-link-arg used in non-cdylib target
I'm for a hard error. The message says this wasn't originally allowed and that it was a bug that it was allowed.
--release is ignored when paired with --profile
Despite being in the CLI, I'm somewhat tempted to allow this to error.
user-defined alias is shadowing an external subcommand found:
Despite being a mixture of CLI and config, I'm game for this. Generally aliases are for users and not automation. xtasks are an exception but a well structured pattern of it.
dev_dependencies/build_dependencies/default_features/crate_types/proc_macro
Error on next edition
good old [project] (replaced with [package])
Without more historical context for why it should unconditionally error, I'd say error on next edition
default-features in inherited dependencies
Error on next edition
plugin support
Remove
Deprecate .cargo/config
Keep as-is (deprecated). Being config, we can't use Editions. Its also likely something tied to automation, so we can't remove either.
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".
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 (https://github.com/rust-lang/cargo/pull/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
Independent of Edition
Approved changes
plugin
supportdependency withoutpath
,version
,git
,workspace
specifiedlicense-file
andreadme
pointing to a non-existent file--release
is ignored when paired with--profile
cargo read-manifest
Proposed changes
[replace]
is deprecatedcargo tree
flagsrustc-cdylib-link-arg
used in non-cdylib targetplugin
supporthttps://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/cargo/util/toml/targets.rs#L211-L216
plugin
)dependency without
path
,version
,git
,workspace
specifiedhttps://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/cargo/util/toml/mod.rs#L1914-L1918
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 filehttps://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/cargo/ops/cargo_package.rs#L416-L418
license-file
; 1.71.0 (2023-08-03) forreadme
--release
is ignored when paired with--profile
https://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/cargo/util/command_prelude.rs#L570-L573
cargo read-manifest
https://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/bin/cargo/commands/read_manifest.rs#L9
cargo metadata --no-deps
should cover its use cases.[replace]
is deprecatedhttps://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/doc/src/reference/overriding-dependencies.md?plain=1#L300-L301
[patch]
to fully replace[repalce]
?Carog.toml
)old
cargo tree
flags:--all
,no-dev-dependencies
,--no-indent
,--prefix-depth
,--all-targets
https://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/bin/cargo/commands/tree.rs#L144-L146
all
; NO for otherspath override modifying dependency graph
https://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/cargo/core/registry.rs#L535-L538
rustc-cdylib-link-arg
used in non-cdylib targethttps://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/cargo/core/compiler/custom_build.rs#L850-L856
user-defined alias is shadowing an external subcommand found
https://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/bin/cargo/cli.rs#L321-L323
cargo clippy
andcargo fmt
are what we concerned.10049
output artifact name collisions
https://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/cargo/core/compiler/build_runner/mod.rs#L472-L474
Bail out when trying to link to a library that is not linkable
https://github.com/rust-lang/cargo/blob/f0ae76519127d16d87362c6d88416d92cba86c6a/src/cargo/core/compiler/mod.rs#L1427-L1430
Ambiguous package name in git dependency
https://github.com/rust-lang/cargo/blob/bd1cf584af2c356eeb3980c3c9bb0fea190ed633/src/cargo/ops/cargo_read_manifest.rs#L225-L234
10701, #10767
No further steps
deprecate
--all
(alias to--workspace
)https://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/cargo/util/command_prelude.rs#L54
Deprecate
.cargo/config
https://github.com/rust-lang/cargo/blob/8bcecfeed464c990733ff680e0b4546a73fbed44/src/cargo/util/context/mod.rs#L1563-L1567