Skip to content

No way to specify (and override) boot library versions? #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bergmark opened this issue Oct 2, 2015 · 2 comments
Closed

No way to specify (and override) boot library versions? #1090

bergmark opened this issue Oct 2, 2015 · 2 comments

Comments

@bergmark
Copy link
Member

bergmark commented Oct 2, 2015

See reproduction at bottom since it's a bit long.

I'm adding some GHC boot packages (time, unix) to my stack.yaml so I
can test with different versions of them, in this example I'm adding
the same versions that ship with my GHC.

Expected:
I would expect this to match cabal install --enable-tests --constraint='time==1.4.2' --constraint='unix==2.7.0.1' -j4 && cabal test (everything works), or give some other error message saying why it doesn't work.

Actual:
"Cannot satisfy package due to missing or recursive dependencies". Seems pretty random which packages it 'picks' for this error, sometimes Cabal, sometimes random. I'm not sure how to proceed here.

Reproduction:

# as of writing, master is 12a262ecbe265ad7cc1282a2aa270d7f3f13b279
$ git clone [email protected]:bergmark/feed.git && cd feed

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4

$ stack --version
Version 0.1.5.0 X86_64

$ cabal --version
cabal-install version 1.22.4.0
using version 1.22.3.0 of the Cabal library

$ stack init --solver
Selected resolver: ghc-7.8.4
Wrote project config to: /Users/adam/repos/feed3/feed/stack.yaml

$ ghc-pkg list time
/Users/adam/.ghc-7.8.4/lib/ghc-7.8.4/package.conf.d
   time-1.4.2
$ ghc-pkg list unix
/Users/adam/.ghc-7.8.4/lib/ghc-7.8.4/package.conf.d
   unix-2.7.0.1

### Add these to stack.yaml!
$ grep unix stack.yaml
- unix-2.7.0.1
$ grep time stack.yaml | grep -v compat
- time-1.4.2

$ stack test -j4
[snip]
xml-1.3.14: install
feed-0.3.10.2: configure
feed-0.3.10.2: build
feed-0.3.10.2: install
Progress: 15/20
--  While building package unix-2.7.0.1 using:
      /Users/adam/.ghc-7.8.4/bin/runhaskell -clear-package-db -global-package-db -package-db=/Users/adam/.stack/snapshots/x86_64-osx/ghc-7.8.4/7.8.4/pkgdb/ -package-db=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/pkgdb/ -hide-all-packages -package=Cabal-1.18.1.5 -package-id=array-0.5.0.0-470385a50d2b78598af85cfe9d988e1b -package-id=base-4.7.0.2-918c7ac27f65a87103264a9f51652d63 -package-id=binary-0.7.1.0-108d06eea2ef05e517f9c1facf10f63c -package-id=bytestring-0.10.4.0-78bc8f2c724c765c78c004a84acf6cc3 -package-id=containers-0.5.5.1-d7910f1cd81272c1f31ca9f71d0f206e -package-id=deepseq-1.3.0.2-0ddc77716bd2515426e1ba39f6788a4f -package-id=filepath-1.3.0.2-25a474a9272ae6260626ce0d70ad1cab -package-id=ghc-prim-0.3.1.0-a24f9c14c632d75b683d0f93283aea37 -package-id=hoopl-3.10.0.1-60388f26024bd9379ab6691bf144de18 -package-id=integer-gmp-0.5.1.0-26579559b3647acf4f01d5edd9491a46 -package-id=old-locale-1.0.0.6-50b0125c49f76af85dc7aa22975cdc34 -package-id=old-time-1.1.0.2-6a49465fde7e2f22f1853f35389d2e35 -package-id=pretty-1.1.1.1-0984f47ffe93ef3983c80b96280f1c3a -package-id=template-haskell-2.9.0.0-baa268c6bee8dd7155e7328b8c5c4576 -package-id=terminfo-0.4.0.0-c1d02a7210b0d1bc250d87463b38b8d1 -package-id=time-1.4.2-7cdf6ec86041bb0a204bbd8e0ea5baf3 -package-id=transformers-0.3.0.0-6458c21515cab7c1cf21e53141557a1c -package-id=xhtml-3000.2.1-6a3ed472b07e58fe29db22a5bc2bdb06 /var/folders/35/x_7twhd946904v5tvq1w3myw0000gn/T/stack11231/unix-2.7.0.1/Setup.hs --builddir=.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/ configure --user --package-db=clear --package-db=global --package-db=/Users/adam/.stack/snapshots/x86_64-osx/ghc-7.8.4/7.8.4/pkgdb/ --package-db=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/pkgdb/ --libdir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/lib --bindir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/bin --datadir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/share --libexecdir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/libexec --sysconfdir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/etc --docdir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/doc/unix-2.7.0.1 --htmldir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/doc/unix-2.7.0.1 --haddockdir=/Users/adam/repos/feed3/feed/.stack-work/install/x86_64-osx/ghc-7.8.4/7.8.4/doc/unix-2.7.0.1 --constraint=base==4.7.0.2 --constraint=bytestring==0.10.4.0 --constraint=time==1.4.2
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/adam/repos/feed3/feed/.stack-work/logs/unix-2.7.0.1.log

    <command line>: cannot satisfy -package Cabal-1.18.1.5:
        Cabal-1.18.1.5-c52c9a0f6094a87a23021bd5c9074133 is unusable due to missing or recursive dependencies:
          directory-1.2.1.0-0a302ab4cd6571d66003330d0ab072d0 process-1.2.0.0-48b0e35689f85b654fce0b96da436ac1 time-1.4.2-192d26f44a2c945780bbb921626c3399 unix-2.7.0.1-aa73e6c5dd95c7c4358624994ecd8b41
        (use -v for more information)


### Later on I got this error instead:


Progress: 4/6
--  While building package test-framework-0.8.1.1 using:
      /Users/adam/.stack/setup-exe-cache/setup-Simple-Cabal-1.18.1.5-x86_64-osx-ghc-7.8.4 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.18.1.5/ build --ghc-options  -ddump-hi -ddump-to-file
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/adam/repos/feed3/feed/.stack-work/logs/test-framework-0.8.1.1.log

    Configuring test-framework-0.8.1.1...
    Warning: This package indirectly depends on multiple versions of the same
    package. This is highly likely to cause a compile failure.
    package unix-2.7.0.1 requires time-1.4.2
    package test-framework-0.8.1.1 requires time-1.4.2
    package random-1.1 requires time-1.4.2
    Building test-framework-0.8.1.1...
    Preprocessing library test-framework-0.8.1.1...
    <command line>: cannot satisfy -package-id random-1.1-822c19b7507b6ac1aaa4c66731e775ae:
        random-1.1-822c19b7507b6ac1aaa4c66731e775ae is unusable due to missing or recursive dependencies:
          time-1.4.2-7cdf6ec86041bb0a204bbd8e0ea5baf3
        (use -v for more information)

@snoyberg
Copy link
Contributor

snoyberg commented Oct 4, 2015

This may be an inherent limitation with Cabal 1.18, which doesn't allow us to specify installed packages via install package IDs, leading to ambiguities. Upgrading to Cabal 1.22 (by installing it in your global package database) may solve the problem.

@snoyberg
Copy link
Contributor

snoyberg commented Oct 9, 2015

This should be fixed on master with the change in defaults for Setup.hs dependencies. If the problem persists, please reopen.

@snoyberg snoyberg closed this as completed Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants