Skip to content

Commit

Permalink
haskell-generic-builder: revert "set LD_LIBRARY_PATH in shellHook"
Browse files Browse the repository at this point in the history
This reverts commit e73e5c8. Please don't
set $LD_LIBRARY_PATH! Instead, pass appropriate --extra-include-dir and
--extra-lib-dir arguments to "cabal configure" to ensure that Cabal knows
about system dependencies.
  • Loading branch information
peti committed Feb 9, 2018
1 parent bd3379c commit 2c13435
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ assert enableSplitObjs == null;
let

inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast
concatStringsSep enableFeature optionalAttrs toUpper
filter makeLibraryPath;
concatStringsSep enableFeature optionalAttrs toUpper;

isGhcjs = ghc.isGhcjs or false;
isHaLVM = ghc.isHaLVM or false;
Expand Down Expand Up @@ -392,9 +391,6 @@ stdenv.mkDerivation ({
export NIX_${ghcCommandCaps}PKG="${ghcEnv}/bin/${ghcCommand}-pkg"
# TODO: is this still valid?
export NIX_${ghcCommandCaps}_DOCDIR="${ghcEnv}/share/doc/ghc/html"
export LD_LIBRARY_PATH="''${LD_LIBRARY_PATH:+''${LD_LIBRARY_PATH}:}${
makeLibraryPath (filter (x: !isNull x) systemBuildInputs)
}"
${if isHaLVM
then ''export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/HaLVM-${ghc.version}"''
else ''export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/${ghcCommand}-${ghc.version}"''}
Expand Down

1 comment on commit 2c13435

@ljli
Copy link
Contributor

@ljli ljli commented on 2c13435 Feb 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind that you reverted this, but I wonder if anything changed since we talked about this in #25398? I assume the issue that cabal build works but cabal repl doesn't, because GHCI's builtin linker isn't aware of NIX_LDFLAGS, is still around.
Maybe it is just me, but I found that not so great from a usability perspective and to some people the workaround, to pull the appropriate paths from NIX_LDFLAGS and set them via cabal configure, might not be obvious. Depending on how much you reconfigure it can also become tedious to do this manually.
Ideally we would have some solution for this.

Please sign in to comment.