about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorWinter <winter@winter.cafe>2023-02-16 21:50:16 -0500
committerWinter <winter@winter.cafe>2023-02-16 21:59:16 -0500
commitac44b254b42f997d7628b4ef0ab2cae74b615610 (patch)
tree62b670470af38e0b5587b95314daf7fe7731b42d /pkgs/development/compilers
parent1f9748835ce2b81a8ee14e5caa7c0cca062d9619 (diff)
zig_0_9: build with baseline CPU target
26b9a2f4a1a53e6763aa83590aad0fce5013a458 changes Zig 0.10 to build the
compiler (notably *not* its outputs, at least not by default) with
its baseline CPU target, but we should ideally do it for both versions
to increase reproducibility, as well as increase the number of users who
are able to use Hydra-provided Zig binaries.

This also adds a comment above the flag in 0.10, to explain why we're adding
the flag, as we do with the RPATH one.

See https://github.com/NixOS/nixpkgs/issues/214356 and https://github.com/NixOS/nixpkgs/issues/185665
for further context.
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/zig/0.10.nix2
-rw-r--r--pkgs/development/compilers/zig/0.9.1.nix3
2 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/development/compilers/zig/0.10.nix b/pkgs/development/compilers/zig/0.10.nix
index 6d41b63f03b2e..966be329befcf 100644
--- a/pkgs/development/compilers/zig/0.10.nix
+++ b/pkgs/development/compilers/zig/0.10.nix
@@ -47,6 +47,8 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     # file RPATH_CHANGE could not write new RPATH
     "-DCMAKE_SKIP_BUILD_RPATH=ON"
+
+    # ensure determinism in the compiler build
     "-DZIG_TARGET_MCPU=baseline"
   ];
 
diff --git a/pkgs/development/compilers/zig/0.9.1.nix b/pkgs/development/compilers/zig/0.9.1.nix
index e7c62a4cf938c..637186f686e90 100644
--- a/pkgs/development/compilers/zig/0.9.1.nix
+++ b/pkgs/development/compilers/zig/0.9.1.nix
@@ -62,6 +62,9 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     # file RPATH_CHANGE could not write new RPATH
     "-DCMAKE_SKIP_BUILD_RPATH=ON"
+
+    # ensure determinism in the compiler build
+    "-DZIG_TARGET_MCPU=baseline"
   ];
 
   doCheck = true;