Skip to content

ci: Fix Hashbrown dependencies#878

Merged
RaoulLuque merged 4 commits intopetgraph:masterfrom
RaoulLuque:fix_hashbrown_dep
Sep 21, 2025
Merged

ci: Fix Hashbrown dependencies#878
RaoulLuque merged 4 commits intopetgraph:masterfrom
RaoulLuque:fix_hashbrown_dep

Conversation

@RaoulLuque
Copy link
Member

@RaoulLuque RaoulLuque commented Sep 21, 2025

There seems to be an issue with different versions of Hashbrown dependencies:
(PR Job)

Run cargo generate-lockfile
  cargo generate-lockfile
  cargo update -p hashbrown --precise 0.15.0
  cargo update -p once_cell --precise 1.20.3
  shell: /usr/bin/bash -e {0}
  env:
    CARGO_TERM_COLOR: always
    CARGO_INCREMENTAL: 0
    SCCACHE_GHA_ENABLED: true
    RUSTC_WRAPPER: sccache
    SCCACHE_PATH: /opt/hostedtoolcache/sccache/0.10.0/x64/sccache
    ACTIONS_RESULTS_URL: https://results-receiver.actions.githubusercontent.com/
    ACTIONS_RUNTIME_TOKEN: ***
    CARGO_HOME: /home/runner/.cargo
    Updating crates.io index
error: There are multiple `hashbrown` packages in your project, and the specification `hashbrown` is ambiguous.
Please re-run this command with `-p <spec>` where `<spec>` is one of the following:
  [email protected]
  [email protected]
Error: Process completed with exit code 101.

The version pinning was put in place because Rust 1.64 is actually only compatible with Hashbrown 0.15.0 and not 0.15.5 (the above error stems from the Rust 1.64 Test Job - see link).
This PR now pins both Hashbrown versions (ours should be 0.15.5) to 0.15.0.

Hashbrown 0.16 should be another dependency pulled in due to indexmap, see this excerpt from Cargo.lock:

[[package]]
name = "hashbrown"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"

[[package]]
name = "indexmap"
version = "2.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5"
dependencies = [
 "equivalent",
 "hashbrown 0.16.0",
 "rayon",
]

Probably due to some other change (possibly in Cargo?), the default version for the indexmap dependency changed from 0.15.5 to 0.16 which now induces the ambiguity error from above. The specified dependency in indexmap is:

[dependencies.hashbrown]
version = ">= 0.15.0, < 0.17.0"

So both 0.15.5 and 0.16 would be valid.

@RaoulLuque RaoulLuque added A-ci Area: CI 🔴 B-uncategorized Bug: A bug that is difficult to categorize labels Sep 21, 2025
@RaoulLuque RaoulLuque added this to the 0.8.3 milestone Sep 21, 2025
Copy link
Collaborator

@starovoid starovoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it as a temporary fix, but apparently it's already worth raising the MSRV in the next breaking release.

@RaoulLuque
Copy link
Member Author

I like it as a temporary fix, but apparently it's already worth raising the MSRV in the next breaking release.

I am not sure I properly understand your wording. What do you mean exactly? Technically I think it is not necessary to raise the MSRV in the next breaking release, as petgraph works with 1.64.

On that note, I just tried creating a new project with cargo, adding indexmap as a dependency and that failed, so I'll head there and see whether that's maybe an issue on their side 👍

@RaoulLuque RaoulLuque added this pull request to the merge queue Sep 21, 2025
Merged via the queue into petgraph:master with commit 5c7e0fb Sep 21, 2025
23 checks passed
@RaoulLuque RaoulLuque deleted the fix_hashbrown_dep branch September 21, 2025 16:36
github-merge-queue bot pushed a commit that referenced this pull request Sep 28, 2025
As suggested in
indexmap-rs/indexmap#419 (comment),
this edits the CI action such that when it is run with the MSRV, Cargo
resolves the dependencies for that use case first, such that compatible
dependency versions should be locked in cargo.lock.

This is a follow-up and more permanent fix to the temporary fix from
#878.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci Area: CI 🔴 B-uncategorized Bug: A bug that is difficult to categorize

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants