rustPlatform.fetchCargoVendor: de-duplicate git sources by selector#501979
Conversation
|
Hmm, looking at this more closely, I don't think this is the right fix if the aim is to match
[source."git+https://github.com/pop-os/dbus-settings-bindings"]
git = "https://github.com/pop-os/dbus-settings-bindings"
replace-with = "vendored-sources"I'll switch to a draft for now. |
b5020bc to
61793ad
Compare
fc4f2fd to
beefe04
Compare
|
Okay, new approach is to de-dupe git sources by selector, which matches upstream |
|
Probably worth targeting staging-next instead of staging as this is a fix. |
|
Sure, we can automatically deduplicate, but is that what we really want? Why should we give one of the revisions priority over the other? They are not the same. Also: did this work before #387337 ? I fail to imagine how it could have been broken because of it. |
|
Agree this isn't exactly a great solution, but I don't think there's any other option here. Latest Only started failing once the new vendor code was merged in from staging. The old vendor code chose > git checkout e0e2946b5372d187ad3d60acfc5e5ddebead212c
> nix build .#cosmic-settings-daemon
...
cosmic-settings-daemon> Compiling cosmic-settings-daemon v0.1.0 (https://github.com/pop-os/dbus-settings-bindings#0fa672f8)
cosmic-settings-daemon> Compiling cosmic-dbus-a11y v0.1.0 (https://github.com/pop-os/dbus-settings-bindings#0fa672f8)
|
|
Okay, I see why it was working before, and why it's not working now. I really don't see a pretty way of solving this. I'll look into whether your approach could be improved. In the meantime you could patch out one of the revisions in the lockfile over to the other revision. It's not guaranteed to be correct, but it might be fine as a hotfix. |
|
The affected COSMIC packages have been patched already: #502494 AFAIK those were the only 2 packages affected. |
Yeah but this issue is still worth fixing since it could happen to other packages as well. |
thefossguy
left a comment
There was a problem hiding this comment.
I applied this commit on top of nixos-unstable-small (6c9a78c09ff4d6c21d0319114873508a6ec01655) and built an ISO with COSMIC. I performed the usual testing (that is done when I bump packages) by booting in the ISO and nothing seemed broken there.
I also ran the nixosTests.cosmic* tests.
ALL tests PASS (4/4).
The ISO is on the nix-community x86 builder build01 if anyone wants to verify, at path /nix/store/07c989d20qbywbm4nfa8cmfw57ijvi7f-nixos-cosmic-26.05pre56789.gfedcba-x86_64-linux.iso/iso/nixos-cosmic-26.05pre56789.gfedcba-x86_64-linux.iso.
|
Would love a review from @NixOS/rust btw |
|
Hi, |
|
@AL-33 what error do you get? |
|
I was getting this kind of error: when running Today, the problem has disappeared, and I was able to update without any |
beefe04 to
1c9d43e
Compare
|
For any new people stumbling across this PR, please do leave a comment so I can see how common this issue is. |
ac3c41d to
100e233
Compare
|
We encountered this again in bumping the COSMIC DE packages: #527825 (comment) |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin staging-26.05
git worktree add -d .worktree/backport-501979-to-staging-26.05 origin/staging-26.05
cd .worktree/backport-501979-to-staging-26.05
git switch --create backport-501979-to-staging-26.05
git cherry-pick -x 55b813b5d77c96dce549930e1449e902839a1bad 100e23324c871a3b9210bd50c59d4f22e6cc452c |
|
Opened backport #528591 |
If a Cargo project contains multiple bare git sources (no explicit rev, branch or tag) for the same repo, the lockfile entry looks like:
The new vendor code (#387337) treats each unique source string as a separate source:
This change de-duplicates by selector, matching what
cargo vendordoes.Encountered this issue while trying to build
cosmic-settings-daemon.cc: @TomaSajt
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.