Closed walkah closed 2 years ago
I can nix-shell
successfully, but I can't run build
:
[...]
Only > configure
Only > /home/philipp/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory
SHA > configure
SHA > /home/philipp/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory
StateVar > configure
StateVar > /home/philipp/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory
appar > configure
appar > /home/philipp/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory
Progress 4/305
[...]
I have a file /usr/lib/libgmp.so.10
. Is there something in the nix-shell preventing it from picking that one up? Should there be a libgmp.so.10
in the include path inside the nix-shell perhaps?
I can
nix-shell
successfully, but I can't runbuild
:
One change is that we now run stack in a "pure" nix shell ... which seems to be working in our CI environments. My best guess is that you have a cached build that was built against your system libgmp (which will be unavailable in the pure shell). Can you try a clean build? (I know that's a long build)
I'm feeling dumb. How would I clean my cache? I've tried removing all .stack-work
directories I could find, but I get the same errors.
I also tried nix-shell --pure
. That loads fine but when I run build
I get an error about nix-shell
not being on my PATH. When I just add it, then it goes back to the previous error. You said that libgmp.so.10
should be unavailable from a pure shell. I think that's the case: The error says it can't find libgmp.so.10
.
I saw that behind the build
command there's stack build --nix
. I also tried running stack build
without --nix
directly, but that didn't work.
Okay, I removed my ~/.stack
directory now. That seems to run something. Will report back soon (maybe tomorrow).
Removing my
~/.stack
directory and re-running everything worked! :)
Awesome! Glad to hear it! @expede you okay if I merge this? (I know you were testing it out too)
Closes #584
Adding
flake.nix
for faster nix-shell startup and better version pinning. In the process, generally cleaning up some issues (mostly aroundaarch64-darwin
):rosetta
arg for building natively on M1--nix
vs--no-nix
dance for stack (if you're using nix, automatically build with --nix but otherwise let folks use stack as normal).