From ac44b254b42f997d7628b4ef0ab2cae74b615610 Mon Sep 17 00:00:00 2001 From: Winter Date: Thu, 16 Feb 2023 21:50:16 -0500 Subject: [PATCH] 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. --- pkgs/development/compilers/zig/0.10.nix | 2 ++ pkgs/development/compilers/zig/0.9.1.nix | 3 +++ 2 files changed, 5 insertions(+) diff --git a/pkgs/development/compilers/zig/0.10.nix b/pkgs/development/compilers/zig/0.10.nix index 6d41b63f03b2..966be329befc 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 e7c62a4cf938..637186f686e9 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;