Loading pkgs/development/compilers/zig/hook.nix +20 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,26 @@ makeSetupHook { propagatedBuildInputs = [ zig ]; substitutions = { # This zig_default_flags below is meant to avoid CPU feature impurity in # Nixpkgs. However, this flagset is "unstable": it is specifically meant to # be controlled by the upstream development team - being up to that team # exposing or not that flags to the outside (especially the package manager # teams). # Because of this hurdle, @andrewrk from Zig Software Foundation proposed # some solutions for this issue. Hopefully they will be implemented in # future releases of Zig. When this happens, this flagset should be # revisited accordingly. # Below are some useful links describing the discovery process of this 'bug' # in Nixpkgs: # https://github.com/NixOS/nixpkgs/issues/169461 # https://github.com/NixOS/nixpkgs/issues/185644 # https://github.com/NixOS/nixpkgs/pull/197046 # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485 # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653 zig_default_flags = let releaseType = Loading pkgs/development/compilers/zig/setup-hook.sh +3 −23 Original line number Diff line number Diff line # shellcheck shell=bash disable=SC2154,SC2086 # This readonly zigDefaultBuildFlagsArray below is meant to avoid CPU feature # impurity in Nixpkgs. However, this flagset is "unstable": it is specifically # meant to be controlled by the upstream development team - being up to that # team exposing or not that flags to the outside (especially the package manager # teams). # Because of this hurdle, @andrewrk from Zig Software Foundation proposed some # solutions for this issue. Hopefully they will be implemented in future # releases of Zig. When this happens, this flagset should be revisited # accordingly. # Below are some useful links describing the discovery process of this 'bug' in # Nixpkgs: # https://github.com/NixOS/nixpkgs/issues/169461 # https://github.com/NixOS/nixpkgs/issues/185644 # https://github.com/NixOS/nixpkgs/pull/197046 # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485 # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653 readonly zigDefaultFlagsArray=(@zig_default_flags@) function zigSetGlobalCacheDir { Loading @@ -35,7 +15,7 @@ function zigBuildPhase { $zigBuildFlags "${zigBuildFlagsArray[@]}" ) echoCmd 'build flags' "${flagsArray[@]}" echoCmd 'zig build flags' "${flagsArray[@]}" zig build "${flagsArray[@]}" runHook postBuild Loading @@ -49,7 +29,7 @@ function zigCheckPhase { $zigCheckFlags "${zigCheckFlagsArray[@]}" ) echoCmd 'check flags' "${flagsArray[@]}" echoCmd 'zig check flags' "${flagsArray[@]}" zig build test "${flagsArray[@]}" runHook postCheck Loading @@ -69,7 +49,7 @@ function zigInstallPhase { flagsArray+=("${prefixKey:---prefix}" "$prefix") fi echoCmd 'install flags' "${flagsArray[@]}" echoCmd 'zig install flags' "${flagsArray[@]}" zig build install "${flagsArray[@]}" runHook postInstall Loading Loading
pkgs/development/compilers/zig/hook.nix +20 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,26 @@ makeSetupHook { propagatedBuildInputs = [ zig ]; substitutions = { # This zig_default_flags below is meant to avoid CPU feature impurity in # Nixpkgs. However, this flagset is "unstable": it is specifically meant to # be controlled by the upstream development team - being up to that team # exposing or not that flags to the outside (especially the package manager # teams). # Because of this hurdle, @andrewrk from Zig Software Foundation proposed # some solutions for this issue. Hopefully they will be implemented in # future releases of Zig. When this happens, this flagset should be # revisited accordingly. # Below are some useful links describing the discovery process of this 'bug' # in Nixpkgs: # https://github.com/NixOS/nixpkgs/issues/169461 # https://github.com/NixOS/nixpkgs/issues/185644 # https://github.com/NixOS/nixpkgs/pull/197046 # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485 # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653 zig_default_flags = let releaseType = Loading
pkgs/development/compilers/zig/setup-hook.sh +3 −23 Original line number Diff line number Diff line # shellcheck shell=bash disable=SC2154,SC2086 # This readonly zigDefaultBuildFlagsArray below is meant to avoid CPU feature # impurity in Nixpkgs. However, this flagset is "unstable": it is specifically # meant to be controlled by the upstream development team - being up to that # team exposing or not that flags to the outside (especially the package manager # teams). # Because of this hurdle, @andrewrk from Zig Software Foundation proposed some # solutions for this issue. Hopefully they will be implemented in future # releases of Zig. When this happens, this flagset should be revisited # accordingly. # Below are some useful links describing the discovery process of this 'bug' in # Nixpkgs: # https://github.com/NixOS/nixpkgs/issues/169461 # https://github.com/NixOS/nixpkgs/issues/185644 # https://github.com/NixOS/nixpkgs/pull/197046 # https://github.com/NixOS/nixpkgs/pull/241741#issuecomment-1624227485 # https://github.com/ziglang/zig/issues/14281#issuecomment-1624220653 readonly zigDefaultFlagsArray=(@zig_default_flags@) function zigSetGlobalCacheDir { Loading @@ -35,7 +15,7 @@ function zigBuildPhase { $zigBuildFlags "${zigBuildFlagsArray[@]}" ) echoCmd 'build flags' "${flagsArray[@]}" echoCmd 'zig build flags' "${flagsArray[@]}" zig build "${flagsArray[@]}" runHook postBuild Loading @@ -49,7 +29,7 @@ function zigCheckPhase { $zigCheckFlags "${zigCheckFlagsArray[@]}" ) echoCmd 'check flags' "${flagsArray[@]}" echoCmd 'zig check flags' "${flagsArray[@]}" zig build test "${flagsArray[@]}" runHook postCheck Loading @@ -69,7 +49,7 @@ function zigInstallPhase { flagsArray+=("${prefixKey:---prefix}" "$prefix") fi echoCmd 'install flags' "${flagsArray[@]}" echoCmd 'zig install flags' "${flagsArray[@]}" zig build install "${flagsArray[@]}" runHook postInstall Loading