Skip to content

chore(cargo): set incompatible-publish-age to deny explicitly - #129

Merged
storopoli merged 1 commit into
mainfrom
chore/cargo-resolver-deny
Sep 2, 2026
Merged

storopoli merged 1 commit into
mainfrom
chore/cargo-resolver-deny

Conversation

@storopoli

Copy link
Copy Markdown
Member

Description

Follow-up to the min-publish-age cooldown: set [resolver] incompatible-publish-age = "deny" explicitly in .cargo/config.toml.

deny is already cargo's default, so day to day nothing changes. What this buys is that a developer with incompatible-publish-age = "allow" in their user-level ~/.cargo/config.toml no longer switches the cooldown off for this repo, because the repo config has higher precedence than the home config. The CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE=allow escape hatch keeps working, since environment variables sit above both.

Suggested by Robin in the Slack thread on STR-3852.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

I checked the precedence on nightly-2026-09-01 with a lockfile holding a version 10 days old: a parent-directory config with allow and no repo-level key let the version through; adding deny to the repo config made cargo update --dry-run report the downgrade again; setting the environment variable to allow on top of the repo deny let it through once more. Stable cargo and older nightlies print a one-line "ignoring" or "unused config key" warning for the new key, the same as for the existing [registry] key, and nothing else.

AI disclosure: the change and this PR body were produced with Claude Code, then reviewed and tested by me.

Is this PR addressing any specification, design doc or external reference document?

  • Yes
  • No

If yes, please add relevant links:

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added (where necessary) tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.
  • I have disclosed my use of AI in the body of this PR.

Related Issues

STR-3852

deny is cargo's default, but a user-level ~/.cargo/config.toml with
"allow" would otherwise switch the cooldown off for this repo. The repo
config wins over the home config, while the
CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE environment variable still
overrides both for one-off updates. Suggested by Robin.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

🔒 AI Security Review (claude-opus-5)

✅ No security issues found.

@storopoli
storopoli merged commit 657143c into main Sep 2, 2026
11 checks passed
@storopoli
storopoli deleted the chore/cargo-resolver-deny branch September 2, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant