Skip to content

build-support/rust: support multiple git dependencies with the same version#417900

Closed
andresilva wants to merge 1 commit intoNixOS:stagingfrom
andresilva:andre/rust-support-multiple-git-dependencies
Closed

build-support/rust: support multiple git dependencies with the same version#417900
andresilva wants to merge 1 commit intoNixOS:stagingfrom
andresilva:andre/rust-support-multiple-git-dependencies

Conversation

@andresilva
Copy link
Member

@andresilva andresilva commented Jun 18, 2025

Add the SHA hash to vendored git dependencies to make sure there are no clashes, since the dependencies might have the same version but point to different git commits.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@andresilva andresilva changed the title build-support/rust: support multiple git dependencies with the same v… build-support/rust: support multiple git dependencies with the same version Jun 18, 2025
@andresilva
Copy link
Member Author

Here's an example of something that's fixed by this PR: https://github.com/paritytech/try-runtime-cli/blob/main/Cargo.lock#L15233-L15271

@nix-owners nix-owners bot requested a review from TomaSajt June 18, 2025 15:59
@andresilva andresilva changed the base branch from master to staging June 18, 2025 16:02
@nixpkgs-ci nixpkgs-ci bot closed this Jun 18, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Jun 18, 2025
@github-actions github-actions bot added the 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. label Jun 18, 2025
@TomaSajt
Copy link
Contributor

There have been several fix PRs for this.
Here's mine: #387337

BTW, have you tested that this works correctly?
By this I mean that the package resolution actually uses both directories, instead of just one of the two.

@github-actions github-actions bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jun 18, 2025
@andresilva
Copy link
Member Author

By this I mean that the package resolution actually uses both directories, instead of just one of the two.

No, I did not test this. It did fix the build of the package I was trying, but it probably would work anyway whatever directory it picked, so maybe that's a false positive. Your fix seems much more extensive, so maybe it's best to just close this PR.

@andresilva andresilva closed this Jul 4, 2025
@andresilva
Copy link
Member Author

Closing because I'm not sure whether this is correct (I didn't really test whether the correct dependency is being used), and there have been multiple attempts at this problem.

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

Labels

6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants