From 8ef469ae756aedce5f5686ca2a03c3e922c74009 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Wed, 30 Nov 2022 15:21:40 -0800 Subject: [PATCH] haskellPackages.mkDerivation: Remove Darwin dynamic libraries workaround The workaround that this change deletes was initially contributed in #25537 to mitigate #22810 until a more permanent solution could be devised. That more permanent solution was eventually contributed in #27536, which now obviates the initial workaround, so this change removes it. --- .../haskell-modules/generic-builder.nix | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index bf1f2c387ad9f..cf042b0c5348f 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -375,37 +375,6 @@ stdenv.mkDerivation ({ fi '' + '' done - '' - # only use the links hack if we're actually building dylibs. otherwise, the - # "dynamic-library-dirs" point to nonexistent paths, and the ln command becomes - # "ln -s $out/lib/links", which tries to recreate the links dir and fails - + (optionalString (stdenv.isDarwin && (enableSharedLibraries || enableSharedExecutables)) '' - # Work around a limit in the macOS Sierra linker on the number of paths - # referenced by any one dynamic library: - # - # Create a local directory with symlinks of the *.dylib (macOS shared - # libraries) from all the dependencies. - local dynamicLinksDir="$out/lib/links" - mkdir -p $dynamicLinksDir - - # Unprettify all package conf files before reading/writing them - for d in "$packageConfDir/"*; do - # gawk -i inplace seems to strip the last newline - gawk -f ${unprettyConf} "$d" > tmp - mv tmp "$d" - done - - for d in $(grep '^dynamic-library-dirs:' "$packageConfDir"/* | cut -d' ' -f2- | tr ' ' '\n' | sort -u); do - for lib in "$d/"*.{dylib,so}; do - # Allow overwriting because C libs can be pulled in multiple times. - ln -sf "$lib" "$dynamicLinksDir" - done - done - # Edit the local package DB to reference the links directory. - for f in "$packageConfDir/"*.conf; do - sed -i "s,dynamic-library-dirs: .*,dynamic-library-dirs: $dynamicLinksDir," "$f" - done - '') + '' ${ghcCommand}-pkg --${packageDbFlag}="$packageConfDir" recache runHook postSetupCompilerEnvironment