Skip to content

fix(min-publish-age): remove registry.min-publish-age - #17353

Merged
epage merged 3 commits into
rust-lang:masterfrom
weihanglo:remove-min-publish-age
Aug 12, 2026
Merged

epage merged 3 commits into
rust-lang:masterfrom
weihanglo:remove-min-publish-age

Conversation

@weihanglo

Copy link
Copy Markdown
Member

What does this PR try to resolve?

This caused some confusions.
Better to stabilize min-publish-age configs incrementally.

The main one-way-door we will take here is the agreement on the global- prefix for global settings in the [registry] table. For more discussions, see
https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/.5Bregistry.5D.20vs.20.5Bregistries.2Ecrates-io.5D/with/616084717

How to test and review this PR?

CI passes.

@rustbot rustbot added A-dependency-resolution Area: dependency resolution and the resolver A-documenting-cargo-itself Area: Cargo's documentation A-workspaces Area: workspaces S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2026
@weihanglo weihanglo added Z-min-publish-age Nightly: min-publish-age (RFC 3923) and removed A-documenting-cargo-itself Area: Cargo's documentation A-workspaces Area: workspaces A-dependency-resolution Area: dependency resolution and the resolver S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 12, 2026
@rustbot

rustbot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo

@epage
epage enabled auto-merge August 12, 2026 14:46
@weihanglo

Copy link
Copy Markdown
Member Author
---- resolver::version_prefs::test::publish_age_zero_stops_scope_fallthrough stdout ----

thread 'resolver::version_prefs::test::publish_age_zero_stops_scope_fallthrough' (37825) panicked at src/resolver/version_prefs.rs:749:9:
assertion `left == right` failed
  left: Some(PublishAgeViolation { age: 0s, config: "30 days" })
 right: None

---- resolver::version_prefs::test::publish_age_crates_io_scope_excludes_alt_registry stdout ----

thread 'resolver::version_prefs::test::publish_age_crates_io_scope_excludes_alt_registry' (37813) panicked at src/resolver/version_prefs.rs:688:9:
assertion `left == right` failed
  left: None
 right: Some(PublishAgeViolation { age: 48h, config: "30 days" })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    resolver::version_prefs::test::publish_age_crates_io_scope_excludes_alt_registry
    resolver::version_prefs::test::publish_age_zero_stops_scope_fallthrough

Hmm, it seems to discover a real bug.

This is a preparataion of removing `registry.min-publish-age` support.

After the change, it introduces a non-deterministic behavior that
crates-io from alt-registry races with
built-in crate-io Source in `SOURCE_ID_CACHE`,
hence the ignore.
Our crates.io source ID has two forms:
One with al_registry_key name and one without.

`SOURCE_ID_CACHE` hold only one instance of them,
so there may be a race.
We need to fall back if missing one.
@weihanglo
weihanglo force-pushed the remove-min-publish-age branch from 6c20332 to 7c697f7 Compare August 12, 2026 16:56
@rustbot rustbot added A-dependency-resolution Area: dependency resolution and the resolver A-documenting-cargo-itself Area: Cargo's documentation A-workspaces Area: workspaces labels Aug 12, 2026
This caused some confusions.
Better to stabilize min-publish-age configs incrementally.

The main one-way-door we will take here is the agreement on the
`global-` prefix for global settings in the `[registry]` table.
For more discussions, see
https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/.5Bregistry.5D.20vs.20.5Bregistries.2Ecrates-io.5D/with/616084717
@weihanglo
weihanglo force-pushed the remove-min-publish-age branch from 7c697f7 to 8e55002 Compare August 12, 2026 16:59
@weihanglo

Copy link
Copy Markdown
Member Author
---- resolver::version_prefs::test::publish_age_zero_stops_scope_fallthrough stdout ----

thread 'resolver::version_prefs::test::publish_age_zero_stops_scope_fallthrough' (37825) panicked at src/resolver/version_prefs.rs:749:9:
assertion ``left == right`` failed
  left: Some(PublishAgeViolation { age: 0s, config: "30 days" })
 right: None

---- resolver::version_prefs::test::publish_age_crates_io_scope_excludes_alt_registry stdout ----

thread 'resolver::version_prefs::test::publish_age_crates_io_scope_excludes_alt_registry' (37813) panicked at src/resolver/version_prefs.rs:688:9:
assertion ``left == right`` failed
  left: None
 right: Some(PublishAgeViolation { age: 48h, config: "30 days" })
note: run with ``RUST_BACKTRACE=1`` environment variable to display a backtrace


failures:
    resolver::version_prefs::test::publish_age_crates_io_scope_excludes_alt_registry
    resolver::version_prefs::test::publish_age_zero_stops_scope_fallthrough

Hmm, it seems to discover a real bug.

Fixed by a fallback. Non-deterministic hashmap + our SourceId hash key impl strike again.

@epage
epage added this pull request to the merge queue Aug 12, 2026
Merged via the queue into rust-lang:master with commit a869144 Aug 12, 2026
29 checks passed
@weihanglo
weihanglo deleted the remove-min-publish-age branch August 12, 2026 18:25
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Aug 15, 2026
Update cargo submodule

6 commits in eb98b54bc9f3c74519f43d066cb3fd02ebc88df0..8a0d8afba810304bcf9a10bac430be80dd470233
2026-08-11 16:00:29 +0000 to 2026-08-15 01:32:53 +0000
- chore: update to cc@1.4.3 (rust-lang/cargo#17364)
- Remove most trailing whitespace across cargo (particularly markdown) (rust-lang/cargo#17358)
- Remove unremap file when running cargo clean -p in new build-dir layout (rust-lang/cargo#17356)
- fix(update)!: Remove unstable `--breaking` (rust-lang/cargo#17333)
- docs: adopt rust-lang/rust's LLM usage policy (rust-lang/cargo#17330)
- fix(min-publish-age): remove `registry.min-publish-age` (rust-lang/cargo#17353)

r? ghost
@rustbot rustbot added this to the 1.100.0 milestone Aug 15, 2026
renovate-bot pushed a commit to renovate-bot/rust-lang-_-compiler-builtins that referenced this pull request Aug 17, 2026
Update cargo submodule

6 commits in eb98b54bc9f3c74519f43d066cb3fd02ebc88df0..8a0d8afba810304bcf9a10bac430be80dd470233
2026-08-11 16:00:29 +0000 to 2026-08-15 01:32:53 +0000
- chore: update to cc@1.4.3 (rust-lang/cargo#17364)
- Remove most trailing whitespace across cargo (particularly markdown) (rust-lang/cargo#17358)
- Remove unremap file when running cargo clean -p in new build-dir layout (rust-lang/cargo#17356)
- fix(update)!: Remove unstable `--breaking` (rust-lang/cargo#17333)
- docs: adopt rust-lang/rust's LLM usage policy (rust-lang/cargo#17330)
- fix(min-publish-age): remove `registry.min-publish-age` (rust-lang/cargo#17353)

r? ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-dependency-resolution Area: dependency resolution and the resolver A-documenting-cargo-itself Area: Cargo's documentation A-workspaces Area: workspaces Z-min-publish-age Nightly: min-publish-age (RFC 3923)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants