commercialhaskell / stackage

Stable Haskell package sets: vetted consistent packages from Hackage
https://www.stackage.org/
MIT License
525 stars 797 forks source link

hashable: disable new `arch-native` flag #7461

Open hasufell opened 1 week ago

hasufell commented 1 week ago

Since hashable 1.4.5.0 there is a new flag that does:

flag arch-native
  description:
    Use @-march=native@ when compiling C sources.
    You may need to disable this flag if you are building distributable binaries

  manual:      True
  default:     True

...

  if flag(arch-native)
    ghc-options: -optc=-march=native -optc-mtune=native

This horrible hack may break anyone's release binaries who didn't catch this by accident. So stackage should force this flag off.

Also see https://github.com/haskell-unordered-containers/hashable/issues/310

mpilgrem commented 6 days ago

I wonder if there is a point of more general application; that the Stackage 'social contract' for maintainers should have something express on the broader topic (one way or the other).

hasufell commented 6 days ago

I think portability guarantee is essential for industrial users. Building a binary in some CI only to have it crash in production with "illegal CPU instruction" seems like a disaster.

Sure, you can always argue "you gotta know what you are doing", but stack/stackage have always strived for predictable behavior.