Problem
Getting (nightly) support for preventing cargo from upgrading dependencies to too new versions (-Zmin-publish-age) is a step in the right direction! #17009. But I can't find any way to enforce a don't-use-too-new-dependencies policies in repositories.
The new feature seems to focus on protecting the developer from accidentally upgrading to a too new dependency when modifying Cargo.lock locally. I see no way currently to integrate this in CI to let a project deny PRs and changes that tries to upgrade dependencies beyond the allowed point in time.
Without this I'm not sure how min-publish-age could benefit my projects, as I cannot easily protect my supply chain from too new dependencies.
Proposed Solution
Make cargo check and cargo build min-publish-age-aware and exit with a specific error code if any dependency in the dependency tree is too new. That would prevent anyone from ever compiling a too new dependency. This is arguably the important part, since a newly published malicious crate can only cause damage when actually built.
Also introduce a subcommand that only checks that the lockfile adheres to established configuration rules. This could run much faster in CI and would not need to check the actual code.
Notes
No response
Problem
Getting (nightly) support for preventing cargo from upgrading dependencies to too new versions (
-Zmin-publish-age) is a step in the right direction! #17009. But I can't find any way to enforce a don't-use-too-new-dependencies policies in repositories.The new feature seems to focus on protecting the developer from accidentally upgrading to a too new dependency when modifying
Cargo.locklocally. I see no way currently to integrate this in CI to let a project deny PRs and changes that tries to upgrade dependencies beyond the allowed point in time.Without this I'm not sure how
min-publish-agecould benefit my projects, as I cannot easily protect my supply chain from too new dependencies.Proposed Solution
Make
cargo checkandcargo buildmin-publish-age-aware and exit with a specific error code if any dependency in the dependency tree is too new. That would prevent anyone from ever compiling a too new dependency. This is arguably the important part, since a newly published malicious crate can only cause damage when actually built.Also introduce a subcommand that only checks that the lockfile adheres to established configuration rules. This could run much faster in CI and would not need to check the actual code.
Notes
No response