This hasn't been an issue on x86_64, but running it anyways shouldn't
hurt. aarch64-darwin's trouble could be due to codesigning? Besides that
there don't seem to be many differences between the actual derivations.
This also unbreaks the test suite of regex-rure.
This reverts commit 32eecc6cc9.
Reason for revert: This fix doesn't alleviate the problem in two ways:
1. It is in the aarch64-darwin section of configuration-darwin.nix,
the problem appears on x86_64-darwin (bytepatch doesn't support
aarch64).
2. When moving the override into the general *-darwin section, the
problem with bytepatch is also unaffected, see my attempt in
https://github.com/NixOS/nixpkgs/pull/217201.
Thanks to Ryan Scott's investigation it became clear this crash can also
happen on Linux and thus seems to be a general issue in GHC 9.0.2 (only,
luckily). We'll disable the test suite everywhere for now, but the
prospect of this crash / incorrect runtime result is a bit ominous.
Refer to the [ghc-issue] for details.
[ghc-issue]: https://gitlab.haskell.org/ghc/ghc/-/issues/21141
Currently everything seems like the derivation's outPath has been
corrupted somehow, causing reverse dependencies to fail. Since we can't
purge store paths from Hydra and the binary cache easily at the moment,
we just make the derivation hash change by inserting an unsubstantial
change, causing Hydra to build this package and all reverse dependencies
again — hopefully successfully this time around.
A few libraries published by https://github.com/typeclasses/ have the issue
that they have a test suite with its Main module in hegehog.hs. On darwin
GHC can't distinguish between Hedgehog.hs and hedgehog.hs due to the case
insensitive file system and will raise an issue about this.
Interestingly SDL-image exhibits both the problems of SDL-mixer and SDL-ttf
have. How the respective fixes we apply here as well work is explained in
1a68ebf98573291fc4a8d8e7b35ea2e74a0d6665 and
2a8105fc58644307007f326de25b357d216d3ad7.
SDL-mixer's configure script makes some darwin specific assumptions about
the layout of the SDL libraries which don't hold up with the way they are
packaged in nixpkgs. Since the way we are doing this on other platforms
works with the configure script and doesn't significantly differ from the
situation on darwin, we can just replace a string in a string comparison
to ensure the non-darwin code path is taken.
SDL_main.h which is included from SDL_ttf.h contains a #define which redefines
main to SDL_main. This has to do with the way SDL binaries are linked and
executed on darwin which is explained here [1]. However this is bad news for
hsc2hs intermediate C sources which in this case only to gather version
information from the headers and not to run a full SDL application.
Thus compilation would fail due to this issue which we can avoid by redefining
main to main again after including the header.
[1]: http://www.ariis.it/link/repos/sdl-bindings/hssdl-image/MACOSX