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

tests.buildRustCrate: Fix after hashing method change #105379

Merged
merged 2 commits into from Dec 19, 2020

Conversation

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Nov 29, 2020

Motivation for this change

As @lopsided98 points out in #105305, we're probably better off not asserting exact hashes, but that is a more involved fix.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@lopsided98
Copy link
Contributor

@lopsided98 lopsided98 commented Nov 29, 2020

This only fixes the tests for x86_64-linux, every other platform is still broken.

@Ericson2314
Copy link
Member Author

@Ericson2314 Ericson2314 commented Nov 30, 2020

Oh good point, didn't think of that.

Copy link
Member

@andir andir left a comment

diff -u ${expectedFilesFile} $actualFiles |\
tail -n +3 |\
sed -e 's/^/ /'
exit 1

We can probably just exchange this for a loop in which we run state against the given expected file name (which can contain wildcards)?

@Ericson2314
Copy link
Member Author

@Ericson2314 Ericson2314 commented Nov 30, 2020

@andir that sounds good.

Ericson2314 added 2 commits Dec 19, 2020
I think it is preferable to separate the tests from the "real" packages.
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.
@Ericson2314 Ericson2314 force-pushed the fix-buildRustCrateTests branch from 8275fc2 to ddeef0d Dec 19, 2020
@Ericson2314 Ericson2314 changed the title tests.buildRustCrate: Fix rlibc hashes tests.buildRustCrate: Fix after hashing method change Dec 19, 2020
@Ericson2314
Copy link
Member Author

@Ericson2314 Ericson2314 commented Dec 19, 2020

We can probably just exchange this for a loop in which we run state against the given expected file name (which can contain wildcards)?

I liked the idea of running diff because it's easiest to diagnose in the failure case. So i didn't really know what to do. But then I realized it was easy: just normalize before diffing.

This should now be ready to go.

@Ericson2314 Ericson2314 merged commit 86c1825 into master Dec 19, 2020
2 of 3 checks passed
2 of 3 checks passed
@github-actions[bot]
tests
Details
@github-actions[bot]
action
Details
@github-actions[bot]
Wait for ofborg This failed status will be cleared when ofborg finishes eval.
Details
@Ericson2314 Ericson2314 deleted the fix-buildRustCrateTests branch Dec 19, 2020
@andir
Copy link
Member

@andir andir commented Dec 20, 2020

Mhm, hydra reports the job as begin removed now: https://hydra.nixos.org/eval/1636253#tabs-removed

@Ericson2314
Copy link
Member Author

@Ericson2314 Ericson2314 commented Dec 20, 2020

@andir see first commit it's got a new attr path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants