question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tool installation fails because `system-ghc` is configured for dynamic linking.

See original GitHub issue

On loading a stack project, the plugin attempts to install tools, when I get the following error:

Executing `/usr/bin/stack --system-ghc -j1 --stack-root /home/daniel/.cache/intellij-haskell/lts-13 --resolver lts-13 --local-bin-path /home/daniel/.cache/intellij-haskell/lts-13/bin install hlint` failed: /usr/bin/stack --system-ghc -j1 --stack-root /home/daniel/.cache/intellij-haskell/lts-13 --resolver lts-13 --local-bin-path /home/daniel/.cache/intellij-haskell/lts-13/bin install hlint:   
				Selected resolver: lts-13.27
				[1 of 2] Compiling Main             ( /home/daniel/.cache/intellij-haskell/lts-13/setup-exe-src/setup-mPHDZzAJ.hs, /home/daniel/.cache/intellij-haskell/lts-13/setup-exe-src/setup-mPHDZzAJ.o )
				/home/daniel/.cache/intellij-haskell/lts-13/setup-exe-src/setup-mPHDZzAJ.hs:1:1: error:
				Could not find module ‘Prelude’
				There are files missing in the ‘base-4.12.0.0’ package.

The error arises because my system GHC is configured for dynamic linking, so the dynamic versions of all the needed libraries are registered, but Stack expects the (default) static libraries to be registered. The fix is either to (1) remove the system-ghc option from the Stack invocation so that Stack will use a sandboxed compiler for tool building, or (2) add the GHC option -dynamic to the Stack invocation, so that the build will expect the registered dynamic libraries. Unfortunately, I can’t find in my IntelliJ settings how to set the invocation.

Is the particular invocation for tool installation configurable by the user, and if so, how may I configure it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
rikvdkleijcommented, Jul 17, 2019

@rikvdkleij What is gained by using --system-ghc when building tools? Wouldn’t the simplest, most reliable solution be to let Stack pick and download the right GHC based on the resolver?

@friedbrice I want to prevent downloading and installing GHC (again) when it’s already available.

1reaction
friedbricecommented, Jul 19, 2019

If you specify all four paths, then it won’t build anything (except your project, of course)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tool installation fails because `system-ghc` is configured for ...
Tool installation fails because `system-ghc` is configured for dynamic linking. ... the plugin attempts to install tools, when I get the following error:...
Read more >
Talk:Haskell - ArchWiki - Arch Linux
Okay, I finished first two sections Installation and Configuration. Now they describe how to install GHC, Cabal and Stack from official ...
Read more >
Help with using cabal install : r/haskellquestions - Reddit
Running cabal build -> which fails because the import of `Data. ... ghc installed via Pacman, since they're configured for dynamic linking.
Read more >
Version history - The Haskell Tool Stack
stack setup supports installing GHC for macOS aarch64 (M1) ... Since we no longer have dynamically linked Linux binaries, we are removing removing...
Read more >
Cabal / Stack ignores ghc-options for custom Setup scripts
EDIT: I found the relevant issues; it doesn't seem to be possible: stack: Can't use system GHC without static libraries at all (#3409)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found