Haskell-ide-engine: Document solution to: DYLD iconv is not found on mac os x

Created on 21 Dec 2018  路  5Comments  路  Source: haskell/haskell-ide-engine

Hi everyone,

I attempt to install the master hie with make build-all and everything builds perfectly fine. When I start an editor HIE has no errors

```2018-12-21 15:13:22.903258 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.4.0.1, Git revision 91ec5a0d3e6e35771a3033c99258e24da549c3f2 (2271 commits) x86_64 ghc-8.2.1
2018-12-21 15:13:22.910874 [ThreadId 4] - Current directory:/Users/andreyfadeyev/Sites/github/liquidhaskell
2018-12-21 15:13:23.189327 [ThreadId 4] - Cradle directory:/Users/andreyfadeyev/Sites/github/liquidhaskell
2018-12-21 15:13:23.190092 [ThreadId 4] - Using stack GHC version
2018-12-21 15:13:23.451878 [ThreadId 4] - Project GHC version:8.4.3
2018-12-21 15:13:23.452753 [ThreadId 4] - hie exe candidates :["hie-8.4.3","hie-8.4","hie"]
2018-12-21 15:13:23.457252 [ThreadId 4] - found hie exe at:/Users/andreyfadeyev/.local/bin/hie-8.4.3
2018-12-21 15:13:23.458101 [ThreadId 4] - args:[]
2018-12-21 15:13:23.45864 [ThreadId 4] - launching ....

2018-12-21 15:13:23.537874 [ThreadId 4] - Using stack GHC version
2018-12-21 15:13:23.807754 [ThreadId 4] - Run entered for HIE(hie-8.4.3) Version 0.4.0.1, Git revision b08c30b5ab825cafcf47ff5ede02fe7dcad10b83 (dirty) (2282 commits) x86_64 ghc-8.4.3
2018-12-21 15:13:23.811813 [ThreadId 4] - Current directory:/Users/andreyfadeyev/Sites/github/liquidhaskell
2018-12-21 15:13:Using hie version: Version 0.4.0.1, Git revision b08c30b5ab825cafcf47ff5ede02fe7dcad10b83 (dirty) (2282 commits) x86_64 ghc-8.4.3
24.447375 [ThreadId 13] - Using stack GHC version
Using hoogle db at: /Users/andreyfadeyev/.hoogle/default-haskell-5.0.17.hoo


However, the editor says:

Got error while processing diagnostics: : can't load .so/.DLL for: libiconv.dylib (dlopen(libiconv.dylib, 5): image not found)


I edited `stack.yaml` to provide the exact paths with dyld and `stack install` again

extra-lib-dirs:

  • /usr/local/opt/libiconv/lib
  • /usr/lib
  • /usr/local/lib

extra-include-dirs:

  • /usr/local/opt/libiconv/include
    ```

However, it has made no difference.

If I override export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib it breaks stack.
The macOS - 10.13.6
I am on the latest master - b08c30b5ab825cafcf47ff5ede02fe7dcad10b83

The most related issue I found is #744, but it is not exactly that.

I wonder where could be the issue? and what could be wrong with my setup?

Thank you!

documentation macOS help wanted gardening 馃尡

Most helpful comment

The solution end up to be simple

Add /usr/local/lib to DYLD_LIBRARY_PATH

export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/lib:/usr/local/lib"

After DYLD_LIBRARY_PATH is changed stack and other app might get broken with dyld: Symbol not found: __cg_jpeg_resync_to_restart

Unlink

$ brew unlink libjpeg
$ brew unlink libtiff
$ brew unlink libpng

Recompile projects

All 5 comments

The solution end up to be simple

Add /usr/local/lib to DYLD_LIBRARY_PATH

export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/lib:/usr/local/lib"

After DYLD_LIBRARY_PATH is changed stack and other app might get broken with dyld: Symbol not found: __cg_jpeg_resync_to_restart

Unlink

$ brew unlink libjpeg
$ brew unlink libtiff
$ brew unlink libpng

Recompile projects

I guess we need to add this to the README

Hi @alanz! I can add this shortly, I am not sure if it is just my setup after years end up to be perculiar or is it something that might help others, either way - let me know, I can submit a PR.

@kubum if you hit the problem, others will too. So if you just add something saying "if on macos you hit ...., then do ...."

And a PR would be great.

Hi @alanz, I just created a PR #1025, please let me know what you think when you have time.

Was this page helpful?
0 / 5 - 0 ratings