Open wolfgangwalther opened 3 years ago
Cannot reproduce on nixos, with cabal 3.2.0.0 and ghc 8.8.4. Arch Linux's packaging strikes again? :-/
From their docs it looks like you also need a bunch of other configs
I do have the arch-recommended config in place. However, I just reproduced it on my host system (Arch) - it first came up in a project in nix-shell
. I just confirmed the same behaviour with nix-shell --pure
. I also removed my ~/.cabal
folder with config etc. before. I think that rules out the Arch package - or did I miss anything?
In nix-shell
it's currently:
The Glorious Glasgow Haskell Compilation System, version 8.8.3
and
cabal-install version 3.2.0.0
compiled using version 3.2.0.0 of the Cabal library
And... I just confirmed the same thing in a docker container running the same nix-shell
but on top of a nixos docker image. Definitely without relation to Arch.
FTR: Just confirmed this is still the same with cabal 3.10.3.0 and GHC 9.10.1 (via ghcup)
Describe the bug Executable built and run with
v2-run --enable-coverage --enable-executable-dynamic
can't find library.To Reproduce Set up a sample project with
cabal init --interactive
. Select "Library and Executable", everything else as default.Executable name is "example".
The same works just fine without
--enable-coverage
.Expected behavior No error, but "Hello, Haskell!" :)
System information Arch Linux with:
Additional context
libHSexample-0.1.0.0-inplace-ghc8.10.2.so
is built correctly and in the same path as without--enable-coverage
. When I setLD_LIBRARY_PATH
manually to this folder, everything works fine.The exact same behaviour is shown with
v2-build
+v2-exec
, but the latter allows to peek a bit into the environment that cabal creates withv2-run
andv2-exec
:I ran
cabal v2-exec sh -- -c 'echo $LD_LIBRARY_PATH'
, butLD_LIBRARY_PATH
is unset in both cases - with and without coverage enabled (on both build and exec). I'm not sure what that means, without this path set I would expectv2-exec
without coverage enabled to fail as well - but it does not.Running
cabal v2-exec sh -- -c 'echo $PATH'
with and without--enable-coverage
(again on both build and exec) confirms, that$PATH
is set correctly. Obviously, because otherwise the executable would not be found.Should
v2-run
/v2-exec
also setLD_LIBRARY_PATH
for dynamic builds?