Haskell-ide-engine: Failed to install using make build-all (Mac OS High Sierra)

Created on 25 Aug 2018  路  16Comments  路  Source: haskell/haskell-ide-engine

With up-to-date packages. Stack is "Version 1.7.1 x86_64".
After doing make build-all on fresh git clone, I obtained the following output:

Downloading nightly-2018-07-26 build plan ...
Downloaded nightly-2018-07-26 build plan.
git submodule update --init
stack --stack-yaml=stack-8.2.1.yaml install happy
Downloaded nightly-2017-11-24 build plan.
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.2.1.
Installed GHC.
[1 of 2] Compiling Main             ( /Users/hoge/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/hoge/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim   ( /Users/hoge/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/hoge/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/hoge/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.0.0.2_ghc-8.2.1 ...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
mtl-2.2.1: download
mtl-2.2.1: configure
mtl-2.2.1: build
mtl-2.2.1: copy/register
happy-1.19.8: download
happy-1.19.8: configure
happy-1.19.8: build
happy-1.19.8: copy/register
Completed 2 action(s).
Copying from /Users/hoge/.stack/snapshots/x86_64-osx/nightly-2017-11-24/8.2.1/bin/happy to /Users/hoge/.local/bin/happy

Copied executables to /Users/hoge/.local/bin:
- happy

Warning: Installation path /Users/hoge/.local/bin
         not found on the PATH environment variable.
stack --stack-yaml=stack-8.2.1.yaml build

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for cabal-helper-0.8.1.0:
    base-4.10.0.0 from stack configuration does not match <0 && <0
needed due to haskell-ide-engine-0.2.2.0 -> cabal-helper-0.8.1.0

Some different approaches to resolving this:

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find
    some working build configuration. This can be convenient when dealing with many
    complicated constraint errors, but results may be unpredictable.


Plan construction failed.
make: *** [hie-8.2.1] Error 1

Most helpful comment

@FirstLoveLife personally when hie master is broken i just tag last known-good commit and use it until hie fixed. Like that:

  1. git checkout <good commit>
  2. git tag good

When master is updated:

  1. git checkout master && git pull
  2. make <whatever hie you need> (make target already updates submodules)
    3a. issue fixed: git tag -d good - delete now-obsolete tag
    3b. issue not fixed: git checkout good && make <whatever hie you need> - reinstall good version back

All 16 comments

I have run into this issue as well, it seems to affect all builds.

Same for me on macOS High Sierra 10.13.4:

davids-mbp:haskell davl3232$ cd haskell-ide-engine && make build-all
Downloading nightly-2018-07-26 build plan ...
Downloaded nightly-2018-07-26 build plan.
git submodule update --init
stack --stack-yaml=stack-8.2.1.yaml install happy
Downloaded nightly-2017-11-24 build plan.    
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.2.1.                                      
Installed GHC.                                                                  [1 of 2] Compiling Main             ( /Users/davl3232/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /Users/davl3232/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim   ( /Users/davl3232/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /Users/davl3232/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /Users/davl3232/.stack/setup-exe-cache/x86_64-osx/tmp-Cabal-simple_mPHDZzAJ_2.0.0.2_ghc-8.2.1 ...
clang: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
mtl-2.2.1: download
mtl-2.2.1: configure
mtl-2.2.1: build
mtl-2.2.1: copy/register
happy-1.19.8: download    
happy-1.19.8: configure   
happy-1.19.8: build       
happy-1.19.8: copy/register
Completed 2 action(s).    
Copying from /Users/davl3232/.stack/snapshots/x86_64-osx/nightly-2017-11-24/8.2.1/bin/happy to /Users/davl3232/.local/bin/happy

Copied executables to /Users/davl3232/.local/bin:
- happy

Warning: Installation path /Users/davl3232/.local/bin
         not found on the PATH environment variable.
stack --stack-yaml=stack-8.2.1.yaml build

Error: While constructing the build plan, the following exceptions were
encountered:

In the dependencies for cabal-helper-0.8.1.0:
    base-4.10.0.0 from stack configuration does not match <0 && <0 
needed due to haskell-ide-engine-0.2.2.0 -> cabal-helper-0.8.1.0

Some different approaches to resolving this:

  * Set 'allow-newer: true' to ignore all version constraints and build anyway.

  * Consider trying 'stack solver', which uses the cabal-install solver to
    attempt to find some working build configuration. This can be convenient
    when dealing with many complicated constraint errors, but results may be
    unpredictable.


Plan construction failed.
make: *** [hie-8.2.1] Error 1

Doesn't seem to be OS-specific; same on Debian 9. Also happens with direct stack install instead of make.

git bisect indicates that the first commit with this problem is 4a54b7528fe3f046ac74090070c9a1c3ea033525.

Is there a way to use a previously working version as a temporary workaround?

arch(manjaro) also have this error when build from source or download from aur

@azdanov yup, just checkout some previous commit and build as usual.

@Anrock Thanks for the advice! I've managed to build successfully with a2d33cd as @DanielSchuessler suggested.

Let me conclude the whole workaround:

git reset --hard  a2d33cd           
git submodule update --init
stack install

@FirstLoveLife personally when hie master is broken i just tag last known-good commit and use it until hie fixed. Like that:

  1. git checkout <good commit>
  2. git tag good

When master is updated:

  1. git checkout master && git pull
  2. make <whatever hie you need> (make target already updates submodules)
    3a. issue fixed: git tag -d good - delete now-obsolete tag
    3b. issue not fixed: git checkout good && make <whatever hie you need> - reinstall good version back

@Anrock Thanks! good know this workflow. I am not familiar with git.

FYI I deprecated cabal-helper versions 0.8.1.0 and 0.8.1.1 due to problems with cabal new-install by adding revisions with an unsatisfiable constraint on base (hence the <0 thing in the output above) to hackage, using 0.8.1.2 should fix this problem.

I didn't realize stack picks up hackage revisions immediately, honestly I don't really understand exactly what's happening here.

Ah I see cabal-helper is declared as an extra-deps so of course stack picks up hackage revisions.

Anyways bumping those dependencies to .2 should do the trick.

@DanielG I tried bumping it to .2, but ran into different problems. Maybe you know what this means? https://travis-ci.org/lorenzo/haskell-ide-engine/jobs/420813901#L217

Looks to me like stack is handling build-tool-depends wrong when the declared dependency is on the current package. I can reproduce this with a trivial package where the library component depends on an executable from that package: https://gist.github.com/DanielG/7432d7dfa61e48b6e7ebb737d381c0b7

Running stack build (stack version 1.7.1) on this gist will error out with:

Error: While constructing the build plan, the following exceptions were encountered:

Dependency cycle detected in packages:
    [repro-stack-build-tool-depends-cycle,repro-stack-build-tool-depends-cycle]

whereas this builds just fine with cabal install . and cabal new-install . (with cabal-install v2.4 because <2.2 doesn't support new-installing packages from a local directory yet)

Someone should probably report this to the stack guys if it's not on their issue tracker yet. I'm not going to.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alanz picture alanz  路  4Comments

wpoosanguansit picture wpoosanguansit  路  3Comments

alanz picture alanz  路  3Comments

raxod502 picture raxod502  路  4Comments

xgrommx picture xgrommx  路  4Comments