1 # This test *must* be run prior to releasing any build of either stdenv or the
2 # gcc that it exports! This check should also be part of CI for any PR that
3 # causes a rebuild of `stdenv.cc`.
5 # When we used gcc's internal bootstrap it did this check as part of (and
6 # serially with) the gcc derivation. Now that we bootstrap externally this
7 # check can be done in parallel with any/all of stdenv's referrers. But we
8 # must remember to do the check.
16 assert stdenv.cc.isGNU;
18 # rebuild gcc using the "final" stdenv
19 let gcc-stageCompare = (gcc-unwrapped.override {
20 reproducibleBuild = true;
21 profiledCompiler = false;
22 stdenv = overrideCC stdenv (wrapCCWith {
26 NIX_OUTPATH_USED_AS_RANDOM_SEED = stdenv.cc.cc.out;
28 in (runCommand "gcc-stageCompare" {} ''
29 diff -sr ${pkgs.gcc-unwrapped.checksum}/checksums ${gcc-stageCompare.checksum}/checksums && touch $out
30 '').overrideAttrs (a: {
31 meta = (a.meta or { }) // { platforms = lib.platforms.linux; };