Hi,
I'm trying to install HIE on Mac OSX High Sierra 10.13.6. I have Stack 1.9.3 installed via Homebrew and in the past I've been using Haskell, as well as Stack and Atom with ghc-mod successfully, so my Haskell & Stack setup should be - in general - about fine (e.g. there's probably no issue with Stack itself of with how it was installed).
I cloned the HIE repo and tried to build it as README describes. No matter if I run stack ./install.hs hie-8.4.3 (version that I'm interested in right now) or stack ./install.hs build-all, the output I'm getting is (yes, even for hie-8.4.3!):
Configuring GHC ...
Received ExitFailure 1 when running
Raw command: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/configure --prefix=/Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2/
Run from: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/
Trying to figure out what's the issue (this log is not too verbose...), I simply run what this script was supposed to be running:
$ cd /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/
$ /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/configure --prefix=/Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2/
zsh: no such file or directory: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/configure
I tried to Google it, but nothing useful (for me, Haskell / Stack newbie) popped up, so I'd appreciate any help / advice.
Can you try running xcode-select --install and let us know if this helps?
@lorenzo I did, that's the outcome:
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
No change in the output of the stack ./install.hs build-all command too (unsurprisingly, given the message above, but at least I tried 馃槈).
Alright, I read somewhere that this may be fixed by doing a rm -rf ~/.stack, which deletes your current stack installation, all your previous GHC installs and compiled package cache. It is annoying to do that since you will spend the time compiling all those things again, but apparently that fixes the problem
@lorenzo I'd like to get this working (as the lack of ghc-mod support for newer ghc versions is annoying me a bit), so I'll give it a try and report back. Thanks!
@lorenzo Nope, no luck.
$ rm -rf ~/.stack
$ stack ./install.hs hie-8.4.3
Configuring GHC ...
Received ExitFailure 1 when running
Raw command: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/configure --prefix=/Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2/
Run from: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.2.temp/ghc-8.6.2/
Can you try doing this? If you manage to install latest GHC, that may give us a hint:
stack --stack-yaml=stack-8.6.3.yaml build
@lorenzo Still no luck:
stack --stack-yaml=stack-8.6.3.yaml build
Downloaded lts-13.11 build plan.
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.6.4.
Configuring GHC ...
Received ExitFailure 1 when running
Raw command: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.4.temp/ghc-8.6.4/configure --prefix=/Users/michal/.stack/programs/x86_64-osx/ghc-8.6.4/
Run from: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.4.temp/ghc-8.6.4/
Is there any log directory I could check?
Also, thanks for your time!
Edit: Ah, let me run the above with --verbose... Maybe it's worth trying.
@lorenzo OK, I got something with --verbose:
2019-03-18 19:01:24.294315: [debug] dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
2019-03-18 19:01:24.294458: [debug] Referenced from: /usr/local/bin/awk
2019-03-18 19:01:24.294692: [debug] Reason: image not found
2019-03-18 19:01:24.296061: [debug] ./config.status: line 922: 12538 Done(141) eval sed \"\$ac_sed_extra\" "$ac_file_inputs"
2019-03-18 19:01:24.296236: [debug] 12539 Abort trap: 6 | $AWK -f "$ac_tmp/subs.awk" > $ac_tmp/out
2019-03-18 19:01:24.296359: [debug] config.status: error: could not create settings
So...
$ brew install readline
Error: readline 8.0.0 already installed
$ ls /usr/local/opt/readline/lib/
libhistory.8.0.dylib libhistory.a libreadline.8.0.dylib libreadline.a pkgconfig
libhistory.8.dylib libhistory.dylib libreadline.8.dylib libreadline.dylib
So it looks like gawk is referencing old version. I updated it:
brew upgrade gawk
==> Upgrading 1 outdated package:
gawk 4.2.1 -> 4.2.1_1
==> Upgrading gawk
==> Downloading https://homebrew.bintray.com/bottles/gawk-4.2.1_1.high_sierra.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring gawk-4.2.1_1.high_sierra.bottle.1.tar.gz
馃嵑 /usr/local/Cellar/gawk/4.2.1_1: 87 files, 4.7MB
Removing: /usr/local/Cellar/gawk/4.2.1... (85 files, 4.1MB)
Aaaaand.... Looking at the progress of stack --verbose --stack-yaml=stack-8.6.3.yaml build it looks like it's past that point. I'm leaving it for the moment (kids!) and will update you later.
2019-03-18 19:10:59.752897: [debug] Process finished in 5584ms: /Users/michal/.stack/programs/x86_64-osx/ghc-8.6.4.temp/ghc-8.6.4/configure --prefix=/Users/michal/.stack/programs/x86_64-osx/ghc-8.6.4/
(log continues)
@lorenzo Just to confirm, the issue is solved - I managed to build HIE and make it work with VS Code. Thanks for your help!
Great news! I'll close this issue, given that there is not much we can do to prevent it from our side.
I ran into the same issue and installing gawk also solved it for me. Maybe a note about gawk being a requirement should be added somewhere in the documentation?
Most helpful comment
@lorenzo OK, I got something with
--verbose:So...
So it looks like gawk is referencing old version. I updated it:
Aaaaand.... Looking at the progress of
stack --verbose --stack-yaml=stack-8.6.3.yamlbuild it looks like it's past that point. I'm leaving it for the moment (kids!) and will update you later.