nixpkgs/pkgs/development/haskell-modules
Randy Eckenrode e14e9647d7
haskell-builder.nix: work around useSystemCoreFoundationFramework hook
In 23.11, Darwin was changes to use the system CoreFoundation both aarch64-darwin and x86_64-darwin. The ability to change between implementations was removed, but the hook was left in place because at the time it was harmless. Unfortunately, that is no longer the case.

After the upgrade of ld64 to 951.9, it is no longer as permissive about when `-rpath` may be used. It no longer allows the flag to be used when targeting macOS 10.5, and it no longer allows it when merging objects. The former was an issue for certain versions of GCC (now fixed). The latter is an issue for Haskell.

When a Haskell project uses Darwin frameworks and Cabal to build, they will fail to build without this workaround, giving the following error.

    ld: -rpath can only be used when creating a dynamic final linked image

This is due to an optimization Cabal [performs][1]. If the linker supports creating relocatable objects or merging them, it will do so eagerly. This causes packages such as OpenGLRaw to fail to build due using Cabal and frameworks (OpenGL), which pull in the hook.

This workaround is ugly, but it will be reverted as soon as it hits staging and replaced with the real solution, which is removing the hook. The hook is only used with the 10.12 SDK. The 11.0 and 12.3 SDKs do not support the hook, and being able to switch CoreFoundation implementations is not anticipated to be restored in the future (due to problems it causes).

[1]: 705b6ebcae/Cabal/src/Distribution/Simple/Program/Builtin.hs (L341-L380)
2024-07-23 18:30:26 -04:00
..
configuration-hackage2nix haskellPackages: regenerate package set based on current config 2024-07-15 00:00:49 +02:00
lib haskell.lib.compose: don't disable library profiling in justStaticExecutables 2024-07-01 17:50:29 +02:00
patches
cabal2nix-unstable.nix
configuration-arm.nix
configuration-common.nix Merge branch 'staging-next' into staging 2024-07-16 19:07:48 +03:00
configuration-darwin.nix haskellPackages.ghcjs-dom-hello: fix on darwin 2024-06-17 14:40:58 +02:00
configuration-ghc-8.6.x.nix
configuration-ghc-8.10.x.nix haskell.packages.ghc8107.wai-extra: disable haddock 2024-07-14 23:46:42 +02:00
configuration-ghc-9.0.x.nix
configuration-ghc-9.2.x.nix haskell.packages.ghc92.haskell-language-server: Fix build 2024-07-07 17:11:50 +02:00
configuration-ghc-9.4.x.nix haskellPackages.hourglass: Fix build and harmonize overrides 2024-06-23 13:36:28 +02:00
configuration-ghc-9.6.x.nix haskellPackages.ghc96.singletons-base: unbreak 2024-07-07 13:59:51 -04:00
configuration-ghc-9.8.x.nix haskell.packages.ghc98.ghc-tags: pin to 1.8 2024-07-14 23:46:43 +02:00
configuration-ghc-9.10.x.nix
configuration-ghc-9.12.x.nix
configuration-ghcjs-8.x.nix haskellPackages.ghcjs-prim: Clarify comment 2024-06-19 13:38:33 +01:00
configuration-ghcjs-9.x.nix haskellPackages.ghcjs-dom: build on js backend of ghc 9.8 2024-06-14 23:02:10 +02:00
configuration-nix.nix haskellPackages.gi-gdk_4_0_8: migrate override from 4.0.7 2024-07-14 23:46:43 +02:00
configuration-tensorflow.nix
default.nix haskellPackages.ghcjs-dom: build on js backend of ghc 9.8 2024-06-14 23:02:10 +02:00
generic-builder.nix haskell-builder.nix: work around useSystemCoreFoundationFramework hook 2024-07-23 18:30:26 -04:00
generic-stack-builder.nix
hackage-packages.nix haskellPackages: regenerate package set based on current config 2024-07-15 00:00:49 +02:00
HACKING.md
hoogle-local-wrapper.sh
hoogle.nix treewide: Remove indefinite article from meta.description 2024-06-09 23:07:45 +02:00
initial-packages.nix
make-package-set.nix
non-hackage-packages.nix
package-list.nix
stack-hook.sh
with-packages-wrapper.nix