Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Failed to install using make build-all (Mac OS High Sierra) #784

Closed
masadl opened this issue Aug 25, 2018 · 16 comments · Fixed by #789
Closed

Failed to install using make build-all (Mac OS High Sierra) #784

masadl opened this issue Aug 25, 2018 · 16 comments · Fixed by #789
Milestone

Comments

@masadl
Copy link

masadl commented Aug 25, 2018

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
@justjoheinz
Copy link

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

@davl3232
Copy link

davl3232 commented Aug 25, 2018

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

@DanielSchuessler
Copy link

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

@DanielSchuessler
Copy link

DanielSchuessler commented Aug 25, 2018

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

@azdanov
Copy link

azdanov commented Aug 26, 2018

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

@FirstLoveLife
Copy link

FirstLoveLife commented Aug 26, 2018

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

@Anrock
Copy link
Collaborator

Anrock commented Aug 26, 2018

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

@azdanov
Copy link

azdanov commented Aug 26, 2018

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

@ghost ghost mentioned this issue Aug 26, 2018
@FirstLoveLife
Copy link

Let me conclude the whole workaround:

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

@Anrock
Copy link
Collaborator

Anrock commented Aug 26, 2018

@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

@FirstLoveLife
Copy link

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

@DanielG
Copy link
Collaborator

DanielG commented Aug 26, 2018

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.

@DanielG
Copy link
Collaborator

DanielG commented Aug 26, 2018

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.

@lorenzo
Copy link
Collaborator

lorenzo commented Aug 26, 2018

@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

@DanielG
Copy link
Collaborator

DanielG commented Aug 26, 2018

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.

@lukel97
Copy link
Collaborator

lukel97 commented Aug 26, 2018

lukel97 added a commit to lukel97/haskell-ide-engine that referenced this issue Aug 26, 2018
@alanz alanz added this to the prehistory milestone Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.