Skip to content

build: hold Cargo to crates at least 7 days old - #986

Merged
EVWorth merged 1 commit into
devfrom
claude/relaxed-edison-8gs7dq
Nov 20, 2026
Merged

EVWorth merged 1 commit into
devfrom
claude/relaxed-edison-8gs7dq

Conversation

@EVWorth

@EVWorth EVWorth commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Second and last step of #225, now that the toolchain is on Rust 1.100 (#985).

Change

src-tauri/.cargo/config.toml gains:

[registry]
global-min-publish-age = "7 days"

Cargo 1.100 stabilised this (RFC 3923). Every Cargo run started in src-tauri/ (local commands, every CI job, tauri build) now ignores crate versions published less than 7 days ago when it resolves, unless they are already in Cargo.lock. That is the rule .npmrc (min-release-age=7) and Dependabot's cooldown already apply; the difference is that it also holds a local cargo update or cargo add, which the Dependabot cooldown never covered.

The file documents the override for an urgent security fix (CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE=allow cargo update -p <crate> --precise <version>), and warns that a later plain cargo update downgrades such a crate again until it is 7 days old. AGENTS.md rule 9 and the comment in .github/dependabot.yml now say the same. Dependabot's cargo cooldown stays, so it does not open PRs the config would then refuse.

Verified

On a scratch crate depending on cc = "1.11" (1.11.2 published 6 days earlier):

Run Result
generate-lockfile with a 7-plus-day age picks 1.11.1, prints "available: v1.11.2, published 6 days ago"
Age "0" picks 1.11.2
CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE=allow cargo update cc --precise 1.11.2 takes 1.11.2
a build afterwards keeps 1.11.2 from the lockfile
a plain cargo update afterwards downgrades to 1.11.1

On this repository: cargo check --workspace leaves Cargo.lock byte-for-byte unchanged, and cargo update --dry-run reports "Locking 202 packages to highest compatible versions as of 7 days ago".

Not verified: how Dependabot's own resolver treats the setting, in particular for a security update to a version under 7 days old.

Closes #225


Generated by Claude Code

Cargo 1.100 can refuse crate versions younger than a minimum age. Set it
to 7 days for every Cargo run in src-tauri, the rule .npmrc and the
Dependabot cooldown already apply, so a local cargo update or cargo add
is held to it too. Versions already in Cargo.lock are kept.

Closes #225

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014tzYxya6Umczq4EBPTYkX4
@EVWorth
EVWorth merged commit 36b8918 into dev Nov 20, 2026
15 checks passed
@EVWorth
EVWorth deleted the claude/relaxed-edison-8gs7dq branch November 20, 2026 00:24
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.

chore: switch cargo deps-age gate to native when -Zmin-publish-age stabilizes

2 participants