diff options
author | Bernardo Meurer <bernardo@meurer.org> | 2023-04-03 08:19:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-03 08:19:03 -0700 |
commit | f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc (patch) | |
tree | 791eb576b729778367f1611ee7071419ea6aeb02 /pkgs/test | |
parent | 89ab0e405c1ca4bcc480f8ab1f0d740376e3ee09 (diff) | |
parent | 6c209e862e18d6a9d103a80d5fa2443f4e47163e (diff) | |
download | nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.tar nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.tar.gz nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.tar.bz2 nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.tar.lz nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.tar.xz nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.tar.zst nixlib-f1f6ca8bcd8d85a22a6f3e3d02c4e0bf9cb2c9cc.zip |
Merge pull request #209870 from amjoseph-nixpkgs/pr/stdenv/external-gcc-bootstrap
Diffstat (limited to 'pkgs/test')
-rw-r--r-- | pkgs/test/stdenv/gcc-stageCompare.nix | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/test/stdenv/gcc-stageCompare.nix b/pkgs/test/stdenv/gcc-stageCompare.nix new file mode 100644 index 000000000000..e5c2ed5921b3 --- /dev/null +++ b/pkgs/test/stdenv/gcc-stageCompare.nix @@ -0,0 +1,32 @@ +# This test *must* be run prior to releasing any build of either stdenv or the +# gcc that it exports! This check should also be part of CI for any PR that +# causes a rebuild of `stdenv.cc`. +# +# When we used gcc's internal bootstrap it did this check as part of (and +# serially with) the gcc derivation. Now that we bootstrap externally this +# check can be done in parallel with any/all of stdenv's referrers. But we +# must remember to do the check. +# + +{ stdenv +, pkgs +, lib +}: + +assert stdenv.cc.isGNU; +with pkgs; +# rebuild gcc using the "final" stdenv +let gcc-stageCompare = (gcc-unwrapped.override { + reproducibleBuild = true; + profiledCompiler = false; + stdenv = overrideCC stdenv (wrapCCWith { + cc = stdenv.cc; + }); + }).overrideAttrs(_: { + NIX_OUTPATH_USED_AS_RANDOM_SEED = stdenv.cc.cc.out; + }); +in (runCommand "gcc-stageCompare" {} '' + diff -sr ${pkgs.gcc-unwrapped.checksum}/checksums ${gcc-stageCompare.checksum}/checksums && touch $out +'').overrideAttrs (a: { + meta = (a.meta or { }) // { platforms = lib.platforms.linux; }; +}) |