input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
540 stars 235 forks source link

Set arch-native: False for hashable >= 1.4.5.0 #2213

Open TerrorJack opened 1 month ago

TerrorJack commented 1 month ago

hashable-1.4.5.0 has been released recently and has already been included in the last hackage.nix and stackage nightly revision. This package now vendors xxhash and includes a package flag arch-native to pass -march=native to C compiler to harvest SIMD speedup. And arch-native defaults to True, which will cause the nix build artifacts to silently depend on CPU models of the nix builders, causing potential run-time crash on machines with older CPU models and breaking nix build purity silently.

I believe haskell.nix has hackage-quirks.nix that enables overriding default package flags for hackage packages, and arch-native: False should be enforced for hashable >= 1.4.5.0.

Related upstream issue (closed by maintainer): https://github.com/haskell-unordered-containers/hashable/issues/308

TerrorJack commented 1 month ago

This might be a non-issue, see https://github.com/NixOS/nixpkgs/issues/318321#issuecomment-2156602703, feel free to close this one, though it would be better if someone familiar with nixpkgs internal to actually confirm.

hamishmack commented 1 month ago

If we need to add this configuration-nix.nix would be the place to put it.