Skip to content

Commit

Permalink
nix: Test both gcc and clang
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vimpostor committed Sep 7, 2024
1 parent 9145e1f commit 8274e77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
} // builtins.listToAttrs (map (x: { name = x.name; value = makeStdenvPkg x.pkg; }) stdenvs);
checks = {
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 {} \\;";
tests = (makeStdenvPkg pkgs.gcc14Stdenv).overrideAttrs (finalAttrs: previousAttrs: {
} // builtins.listToAttrs (map (x: { name = "tests-" + x.name; value = (makeStdenvPkg x.pkg).overrideAttrs (finalAttrs: previousAttrs: {
doCheck = true;
cmakeFlags = previousAttrs.cmakeFlags ++ ["-DBUILD_TESTING=ON"];
QT_QPA_PLATFORM = "offscreen";
});
};
}
); }) stdenvs);
}
);
}

0 comments on commit 8274e77

Please sign in to comment.