haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

Getting `can't load .so/.DLL` for `libHSrandom`

Open cah6 opened this issue 4 years ago • 1 comments

Hey all,

This is on OSX, with an dev environment provided by Nix. Note that for this dev environment, we have library haddocks and profiling enabled. I'm using GHC 8.6.4 with HIE provided by all-hies with (all-hies.selection { selector = p: { inherit (p) ghc864; }; }). The issue I'm running into when loading HIE up in VSCode is:

<command line>: can't load .so/.DLL for: /nix/store/yb297ih6bbk45dl608blp6m22jv86n7w-ghc-8.6.4-with-packages/lib/links/libHSrandom-1.1-3ypV4EIycgb35PKjTYYr5q-ghc8.6.4.dylib (dlopen(/nix/store/yb297ih6bbk45dl608blp6m22jv86n7w-ghc-8.6.4-with-packages/lib/links/libHSrandom-1.1-3ypV4EIycgb35PKjTYYr5q-ghc8.6.4.dylib, 5): Symbol not found: _timezm1zi8zi0zi2_DataziTimeziClockziInternalziCTimespec_zdwclockGetTime_closure
  Referenced from: /nix/store/yb297ih6bbk45dl608blp6m22jv86n7w-ghc-8.6.4-with-packages/lib/links/libHSrandom-1.1-3ypV4EIycgb35PKjTYYr5q-ghc8.6.4.dylib
  Expected in: /nix/store/smf6dvcjjwy5pwc34r97gc8ccacadc84-ghc-8.6.4/lib/ghc-8.6.4/directory-1.3.3.0/../time-1.8.0.2/libHStime-1.8.0.2-ghc8.6.4.dylib
 in /nix/store/yb297ih6bbk45dl608blp6m22jv86n7w-ghc-8.6.4-with-packages/lib/links/libHSrandom-1.1-3ypV4EIycgb35PKjTYYr5q-ghc8.6.4.dylib)

which seems pretty similar to https://github.com/haskell/haskell-ide-engine/issues/1207. I have seen https://github.com/haskell/haskell-ide-engine#dyld-on-macos but am unsure if that's the issue or how to fix it if it is (adding that export doesn't fix it).

Based off the comments in #1207, I am wondering: if I have haddocks/profiling enabled for my libaries, do I need to build HIE with haddocks/profiling enabled too? If yes, I'm assuming this would not be provided by all-hies and I would have to do a custom build from source. I'm not sure how to do this via nix (would love pointers), but would it theoretically work if I built with stack with the correct options enabled and used that in my nix project?

cah6 avatar Nov 15 '19 18:11 cah6

got a similar issue on nixos.

teto avatar Feb 25 '20 15:02 teto