Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that hash of SourceId is stable #11501

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

weihanglo
Copy link
Member

What does this PR try to resolve?

#11487 discovered that in Rust 1.66.0 Cargo got a new variant SourceId::SpareRegistry making hash value changed. To ensure the stability of hash values, tests are added.

How should we test and review this PR?

This is an extension of the follow test to cover all SourceKind for both ordinary SourceId::hash and SourceId::stable_hash:

fn test_cratesio_hash() {
let config = Config::default().unwrap();
let crates_io = SourceId::crates_io(&config).unwrap();
assert_eq!(crate::util::hex::short_hash(&crates_io), "1ecc6299db9ec823");
}

Additional information

It seems to be too late to release a point version to mitigate this luckiness?

The regression affects anything depends on hash of LocalRegistry | Directory source kind, so Package is affected as well. I currently cannot recall any tool depending on hash of Package, though I guess there are some directly depending on SourceId hash.

@rustbot
Copy link
Collaborator

rustbot commented Dec 19, 2022

r? @ehuss

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 19, 2022
@ehuss
Copy link
Contributor

ehuss commented Dec 19, 2022

Thanks!

I don't have any particular opinion on doing a point release. Will continue discussion on the issue.

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 19, 2022

📌 Commit 2179665 has been approved by ehuss

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 19, 2022
@bors
Copy link
Collaborator

bors commented Dec 19, 2022

⌛ Testing commit 2179665 with merge 9cb3941...

@bors
Copy link
Collaborator

bors commented Dec 19, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 9cb3941 to master...

@bors bors merged commit 9cb3941 into rust-lang:master Dec 19, 2022
@weihanglo weihanglo deleted the stable-hash-source-id branch December 19, 2022 21:09
bors pushed a commit to rust-lang-ci/rust that referenced this pull request Dec 23, 2022
7 commits in c994a4a638370bc7e0ffcbb0e2865afdfa7d4415..2381cbdb4e9b07090f552d34a44a529b6e620e44
2022-12-18 21:50:58 +0000 to 2022-12-23 12:19:27 +0000

- fix: deduplicate dependencies by artifact target (rust-lang/cargo#11478)
- Add warning if potentially-scrapable examples are skipped due to dev-dependencies (rust-lang/cargo#11503)
- Don't scrape examples from library targets by default (rust-lang/cargo#11499)
- Stabilize terminal-width (rust-lang/cargo#11494)
- Make sure that hash of `SourceId` is stable (rust-lang/cargo#11501)
- Use workspace lockfile when running `cargo package` and `cargo publish` (rust-lang/cargo#11477)
- Show `--help` if there is no man page for subcommand (rust-lang/cargo#11473)
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 23, 2022
Update cargo

7 commits in c994a4a638370bc7e0ffcbb0e2865afdfa7d4415..2381cbdb4e9b07090f552d34a44a529b6e620e44 2022-12-18 21:50:58 +0000 to 2022-12-23 12:19:27 +0000

- fix: deduplicate dependencies by artifact target (rust-lang/cargo#11478)
- Add warning if potentially-scrapable examples are skipped due to dev-dependencies (rust-lang/cargo#11503)
- Don't scrape examples from library targets by default (rust-lang/cargo#11499)
- Stabilize terminal-width (rust-lang/cargo#11494)
- Make sure that hash of `SourceId` is stable (rust-lang/cargo#11501)
- Use workspace lockfile when running `cargo package` and `cargo publish` (rust-lang/cargo#11477)
- Show `--help` if there is no man page for subcommand (rust-lang/cargo#11473)

r? `@ghost`
@ehuss ehuss added this to the 1.68.0 milestone Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants