-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
buildRustCrate: add host platform to rlib hash suffix #105305
buildRustCrate: add host platform to rlib hash suffix #105305
Conversation
I bet someone was being cautious about pre-image attacks. Not sure if this is necessary or even sufficient, but I suppose we can leave it for now. Maybe if you want and a |
096c213
to
f46a70c
Compare
This breaks |
f46a70c
to
8c47905
Compare
Yeah I would just focus on testing that things that shouldn't be equal indeed are. Nix makes it very easy to make it deterministic, but leaves it to the other to make the equivalence class sufficiently fine-grained. |
Oh I forgot about the tests, I guess I'll go fix myself. |
As @lopsided98 points out in #105305, we're probably better off not asserting exact hashes, but that is a more involved fix.
Fixed tests in #105379. |
Ugh, the commit message doesn't cary any of the detail required to judge the change. We only have that in this PR.. This will make it harder to figure out why we did something. In my initial refactoring the git history was the most valuable asset we had on this :/ Regardless of that I think this is a good change. Thanks @lopsided98! |
As @lopsided98 points out in #105305, since the hashes are now target sensative, and until we find reason to actually care to test what they are exactly, we are best just normalizing them away in the tests.
Motivation for this change
If a crate depends on both the host and build versions of a crate when cross-compiling, both versions of the crate have the same rlib name, and they clobber each other in the deps directory. This PR adds the host platform target triple to the hash, so the crates end up with unique hashes.
Is there a reason
___
is used to separate the components?cc @Ericson2314 @andir
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)