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

can't load .so/.DLL for libHSghc-prim-0.5.3-ghc8.6.5.so

Open freeman42x opened this issue 4 years ago • 9 comments

To reproduce clone: https://github.com/razvan-flavius-panda/LagdaMdToLagda/tree/948dbdeeddcc69e594c0cdb5bf23ffe49e180243

Enter nix-shell --pure and run hie:

[nix-shell:~/Projects/LagdaMdToLagda]$ hie
2020-05-31 02:16:29.286922422 [ThreadId 4] - run entered for hie-wrapper(hie) Version 1.1 x86_64 ghc-8.6.5
2020-05-31 02:16:29.296239444 [ThreadId 4] - Current directory:/home/neo/Projects/LagdaMdToLagda
2020-05-31 02:16:29.296332845 [ThreadId 4] - Operating system:linux
2020-05-31 02:16:29.296386115 [ThreadId 4] - args:[]
2020-05-31 02:16:29.397216057 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/home/neo/Projects/LagdaMdToLagda"}
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
 - LagdaMdToLagda-0.1.0.0 (exe:LagdaMdToLagda) (configuration changed)
2020-05-31 02:16:30.302817186 [ThreadId 4] - Module "/home/neo/Projects/LagdaMdToLagda/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/neo/Projects/LagdaMdToLagda", cradleOptsProg = CradleAction: Other CabalV2}
2020-05-31 02:16:30.302985118 [ThreadId 4] - Cradle directory:/home/neo/Projects/LagdaMdToLagda
2020-05-31 02:16:30.304647927 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-05-31 02:16:30.345146351 [ThreadId 4] - Project GHC version:8.6.5
2020-05-31 02:16:30.345246329 [ThreadId 4] - hie exe candidates :["hie-8.6.5","hie-8.6","hie"]
2020-05-31 02:16:30.347408755 [ThreadId 4] - found hie exe at:/nix/store/5a6jp7xm8zgv39bhjd1gvvj651gnlvx4-haskell-ide-engine-combined/libexec/bin/hie-8.6.5
2020-05-31 02:16:30.347533413 [ThreadId 4] - args:[]
2020-05-31 02:16:30.347609999 [ThreadId 4] - launching ....



Running HIE(hie-8.6.5)
  Version 1.1 x86_64 ghc-8.6.5
To run as a LSP server on stdio, provide the '--lsp' argument
Current directory:/home/neo/Projects/LagdaMdToLagda

args:[]

Looking for project config cradle...

2020-05-31 02:16:31.442573684 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/home/neo/Projects/LagdaMdToLagda"}
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
 - LagdaMdToLagda-0.1.0.0 (exe:LagdaMdToLagda) (configuration changed)
2020-05-31 02:16:31.68426565 [ThreadId 4] - Module "/home/neo/Projects/LagdaMdToLagda/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/neo/Projects/LagdaMdToLagda", cradleOptsProg = CradleAction: Other CabalV2}
2020-05-31 02:16:31.685731901 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-05-31 02:16:31.728045902 [ThreadId 4] - Executing GHC on path with args: --print-libdir


###################################################

Cradle: Cabal project
Project Ghc version: 8.6.5
Libdir: Just "/nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5"
Searching for Haskell source files...
Found 2 Haskell source files.

###################################################

Found the following files:

/home/neo/Projects/LagdaMdToLagda/Main.hs
/home/neo/Projects/LagdaMdToLagda/Setup.hs


Load them all now. This may take a very long time.

2020-05-31 02:16:31.830770784 [ThreadId 4] - New cradle: /home/neo/Projects/LagdaMdToLagda/Main.hs
2020-05-31 02:16:31.834652653 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/home/neo/Projects/LagdaMdToLagda"}
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
 - LagdaMdToLagda-0.1.0.0 (exe:LagdaMdToLagda) (configuration changed)
2020-05-31 02:16:32.406967677 [ThreadId 4] - Module "/home/neo/Projects/LagdaMdToLagda/Main.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/neo/Projects/LagdaMdToLagda", cradleOptsProg = CradleAction: Other CabalV2}
2020-05-31 02:16:32.40707938 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/home/neo/Projects/LagdaMdToLagda", cradleOptsProg = CradleAction: Other CabalV2}
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - LagdaMdToLagda-0.1.0.0 (exe:LagdaMdToLagda) (first run)
2020-05-31 02:16:32.728606552 [ThreadId 4] - Ghc error on cradle initialisation: "can't load .so/.DLL for: /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so (/nix/store/c745s6cnnxy6c98bvhi0qsijrh3ikag1-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so))"
2020-05-31 02:16:32.728808214 [ThreadId 4] - New cradle: /home/neo/Projects/LagdaMdToLagda/Setup.hs
2020-05-31 02:16:32.732474135 [ThreadId 4] - Cabal-Helper decided to use: ProjLocV2Dir {plProjectDirV2 = "/home/neo/Projects/LagdaMdToLagda"}
Build profile: -w ghc-8.6.5 -O1
In order, the following would be built (use -v for more details):
 - LagdaMdToLagda-0.1.0.0 (exe:LagdaMdToLagda) (configuration changed)
2020-05-31 02:16:32.974869567 [ThreadId 4] - Module "/home/neo/Projects/LagdaMdToLagda/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/neo/Projects/LagdaMdToLagda", cradleOptsProg = CradleAction: Other CabalV2}
2020-05-31 02:16:32.974991438 [ThreadId 4] - Found cradle: Cradle {cradleRootDir = "/home/neo/Projects/LagdaMdToLagda", cradleOptsProg = CradleAction: Other CabalV2}
Build profile: -w ghc-8.6.5 -O1
In order, the following will be built (use -v for more details):
 - LagdaMdToLagda-0.1.0.0 (exe:LagdaMdToLagda) (first run)
2020-05-31 02:16:33.101190483 [ThreadId 4] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChExeName \"LagdaMdToLagda\" with source directory: [\".\"]","","","To expose a module, refer to:","https://www.haskell.org/cabal/users-guide/developing-packages.html",""]

###################################################
###################################################

Dumping diagnostics:


/home/neo/Projects/LagdaMdToLagda/Main.hs: FAILED
        "can't load .so/.DLL for: /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so (/nix/store/c745s6cnnxy6c98bvhi0qsijrh3ikag1-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so))"
/home/neo/Projects/LagdaMdToLagda/Setup.hs: FAILED
        Fail on initialisation for "/home/neo/Projects/LagdaMdToLagda/Setup.hs". Could not obtain flags for: "Setup.hs".


Note: loading of 'Setup.hs' is not supported.
2020-05-31 02:16:33.144940767 [ThreadId 4] - done

freeman42x avatar May 31 '20 01:05 freeman42x

From what I understand, hie executable is calling cabal to build some Haskell packages.

If I could somehow get Nix to provide those packages required by the hie run, then it should use them instead of installing them globally. The problem is how to tell which packages I need to provide inside the nix-shell.

If I am not mistaken, hie is trying to build cabal-3.0.0.0, so if I add that to nix-shell, then hie when run should not install it globally but use the one provided successfully by Nix.

freeman42x avatar Jun 01 '20 20:06 freeman42x

maybe using an explicit hie.yamlconfig would be a workaround, cause that way hie does not try to build Cabal

jneira avatar Jun 01 '20 21:06 jneira

@jneira So, something like:

cradle: {cabal: {component: "exe:Screeps-Haskell"}}

in a hie.yaml?

freeman42x avatar Jun 01 '20 21:06 freeman42x

yeah, it should work if you have only one component (lib, exe, test, etc), with more components you will need a "multi" cradle: see https://github.com/haskell/haskell-ide-engine#project-configuration

jneira avatar Jun 01 '20 21:06 jneira

@jneira I tried what I mentioned above and the errors multiplied haha

Dumping diagnostics:


/home/neo/Projects/Screeps-Haskell/Setup.hs: FAILED
        "can't load .so/.DLL for: /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so (/nix/store/c745s6cnnxy6c98bvhi0qsijrh3ikag1-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so))"
/home/neo/Projects/Screeps-Haskell/Main.hs: FAILED
        "panic! (the 'impossible' happened)\n  (GHC version 8.6.5 for x86_64-unknown-linux):\n\tDynamic linker not initialised\n\nPlease report this as a GHC bug:  http://www.haskell.org/ghc/reportabug\n"


Note: loading of 'Setup.hs' is not supported.
2020-06-01 22:43:07.360372938 [ThreadId 4] - done

freeman42x avatar Jun 01 '20 21:06 freeman42x

I tried with:

cradle:
  cabal:
  - path: "./Main.hs"
    component: "exe:Screeps-Haskell"

and it throws:

Dumping diagnostics:


/home/neo/Projects/Screeps-Haskell/Setup.hs: FAILED
        Fail on initialisation for "/home/neo/Projects/Screeps-Haskell/Setup.hs". Multi Cradle: No prefixes matched
/home/neo/Projects/Screeps-Haskell/Main.hs: FAILED
        "can't load .so/.DLL for: /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so (/nix/store/c745s6cnnxy6c98bvhi0qsijrh3ikag1-glibc-2.27/lib/libm.so.6: version `GLIBC_2.29' not found (required by /nix/store/v2irxsz710ghkw0whk3n36lkb31msw06-ghc-8.6.5/lib/ghc-8.6.5/ghc-prim-0.5.3/libHSghc-prim-0.5.3-ghc8.6.5.so))"


Note: loading of 'Setup.hs' is not supported.
2020-06-01 22:54:26.022937588 [ThreadId 4] - done

freeman42x avatar Jun 01 '20 21:06 freeman42x

Oh sorry for the failed workaround, there is a fundamental issue beyond compiling Cabal. I think a nix user would help better, maybe @Infinisil?

jneira avatar Jun 01 '20 21:06 jneira

I can't offer any assistance, but I am also encountering this issue.

lf- avatar Jul 14 '20 00:07 lf-

That looks like https://github.com/Infinisil/all-hies/issues/32, which should be fixed with https://github.com/Infinisil/all-hies/pull/64

infinisil avatar Jul 14 '20 01:07 infinisil