Skip to content

Commit 8274e77

Browse files
committed
nix: Test both gcc and clang
Unfortunately it is impossible to run both check steps individually [0], which would have allowed us to map the concurrent builds to the CI job level. Now this way it will be a bit confusing as both jobs will run concurrently (but in the same CI job) and their stdout will race against each other for maximum confusion, so the following output is possible: ``` The C compiler identification is GNU 14.2.0 The C compiler identification is Clang 18.1.8 The CXX compiler identification is GNU 14.2.0 The CXX compiler identification is Clang 18.1.8 ``` And thus it will also not be possible to directly see which of the two caused a compiler error. Fortunately I do not care too much as it is easy for me to run the build locally for just one of both compilers. [0] NixOS/nix#8881
1 parent 9145e1f commit 8274e77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

flake.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
} // builtins.listToAttrs (map (x: { name = x.name; value = makeStdenvPkg x.pkg; }) stdenvs);
4545
checks = {
4646
format = pkgs.runCommand "format" { src = ./.; nativeBuildInputs = [ pkgs.clang-tools pkgs.git ]; } "mkdir $out && cd $src && find . -type f -path './*\\.[hc]pp' -exec clang-format -style=file --dry-run --Werror {} \\;";
47-
tests = (makeStdenvPkg pkgs.gcc14Stdenv).overrideAttrs (finalAttrs: previousAttrs: {
47+
} // builtins.listToAttrs (map (x: { name = "tests-" + x.name; value = (makeStdenvPkg x.pkg).overrideAttrs (finalAttrs: previousAttrs: {
4848
doCheck = true;
4949
cmakeFlags = previousAttrs.cmakeFlags ++ ["-DBUILD_TESTING=ON"];
5050
QT_QPA_PLATFORM = "offscreen";
51-
});
52-
};
51+
}
52+
); }) stdenvs);
5353
}
5454
);
5555
}

0 commit comments

Comments
 (0)