4
votes

I am trying to install ghc-mod so that I can use ide-haskell in Atom.

The instructions say to use stack build ghc-mod. It seems that GHC 8.2+ is not supported by ghc-mod, so I set my resolver to lts-9.21.

When running stack build ghc-mod, I keep getting this error (emphasis mine; not using code formatting because line wrap helps readability):

aeson > : can't load .so/.DLL for: /Users/timoffex/.stack/snapshots/x86_64-osx/db354248ca37308313a93487c93190e1d5b819629b60b38b68871c9a691e52b9/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib (dlopen(/Users/timoffex/.stack/snapshots/x86_64-osx/db354248ca37308313a93487c93190e1d5b819629b60b38b68871c9a691e52b9/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib, 5): REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 2 which is not a writable segment (__LINKEDIT) in /Users/timoffex/.stack/snapshots/x86_64-osx/db354248ca37308313a93487c93190e1d5b819629b60b38b68871c9a691e52b9/8.0.2/lib/x86_64-osx-ghc-8.0.2/libHStime-locale-compat-0.1.1.3-KZ1jqNx8uhlHjmuPPj6V1Y-ghc8.0.2.dylib)

... (later)
--  While building package aeson-1.1.2.0 using:
      /Users/timoffex/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 build --ghc-options ""
    Process exited with code: ExitFailure 1
Progress 1/4

Here's a snippet from the above that looks weird to me:

REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB has segment 2 which is not a writable segment

I am running macOS Catalina 10.15.3.

I can't find any mention of this online except for this open GitHub issue: https://github.com/facebook/duckling/issues/446

I also tried lts-7.24. I get the exact same error, except it happens while building profunctors.

What could be the problem? Where can I file a bug?

1
I'd suspect an incompatibility between GHC 8.2 and your macOS version. I don't use macOS myself, but I've heard that supporting it has been tricky for GHC in recent years. For confirmation and more competent help, you could turn to the ghc-devs mailing list.sjakobi
I would suggest moving away from ghc-mod, as 8.2 is a fairly old version of GHC. You should look into other IDE helpers for VS, such as ghcid.Bob Dalgleish
Thank you for the advice! I haven't heard about ghcid before, I'll give a try. Sucks if ghc-mod doesn't work on macOS—I wasted a couple of hours trying to understand what I was doing wrong.Timoffex
I've been getting the same exact error, also on macOS Catalina (10.15.4) Did you find any solution @Timoffex?friederbluemle

1 Answers

0
votes

I had the same error in a project using resolver: lts-9.17.

What fixed it for me is to update stack.yaml and use this line:

resolver: lts-10.9