Cabal: Installed version of base not considered

Created on 30 Dec 2017  路  4Comments  路  Source: haskell/cabal

I am trying to build a package of mine on Travis against GHC HEAD, using --allow-newer base, but it fails in a weird way:

+cabal --version
cabal-install version 2.1.0.0
compiled using version 2.1.0.0 of the Cabal library 
++ghc --version
++ghc --print-project-git-commit-id
+echo 'The Glorious Glasgow Haskell Compilation System, version 8.5.20171222 [e237e1f132d0c0e1d9bf24d21cf688110305fb28]'
The Glorious Glasgow Haskell Compilation System, version 8.5.20171222 [e237e1f132d0c0e1d9bf24d21cf688110305fb28]
+cabal update
Config file path source is default config file.
Config file /home/travis/.cabal/config not found.
Writing default configuration to /home/travis/.cabal/config
Downloading the latest package list from hackage.haskell.org
+cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --allow-newer base --allow-newer template-haskell
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: base (user goal)
rejecting: base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0,
base-4.8.2.0, base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1,
base-4.7.0.0, base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0,
base-4.4.1.0, base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2,
base-4.2.0.1, base-4.2.0.0, base-4.1.0.0, base-4.0.0.0 (only already installed
instances can be used)
rejecting: base-3.0.3.2 (conflict: base==3.0.3.2, base => base>=4.0)
rejecting: base-3.0.3.1 (conflict: base==3.0.3.1, base => base>=4.0)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base

Full log at: https://api.travis-ci.org/v3/job/323047984/log.txt

It looks as if cabal-install is only considering those versions on base that have been uploaded to Hackage, but not the actually installed version of base (which ought to be 4.11.something).

Most helpful comment

@nomeata just a hunch: try --allow-newer=base (note the =)

EDIT: (iirc cabal will think you want to install base -- hence it says "next goal: base (user goal)"; and the reason you need a = is that --allow-newer's argument is optional, otherwise the CLI parser thinks it's a non-flag argument).

@23Skidoo what'ya think about disallowing the argument-less --allow-{newer,older} variants? We have explicit --allow-newer {all,*,all:all,*:*} anyway now.... and it's becoming a bit of a UX papercut imho everytime you forget the =

All 4 comments

@nomeata just a hunch: try --allow-newer=base (note the =)

EDIT: (iirc cabal will think you want to install base -- hence it says "next goal: base (user goal)"; and the reason you need a = is that --allow-newer's argument is optional, otherwise the CLI parser thinks it's a non-flag argument).

@23Skidoo what'ya think about disallowing the argument-less --allow-{newer,older} variants? We have explicit --allow-newer {all,*,all:all,*:*} anyway now.... and it's becoming a bit of a UX papercut imho everytime you forget the =

@nomeata just a hunch: try --allow-newer=base (note the =)

Thanks!

@hvr Sounds reasonable to me.

I stayed one hour to try this command : "cabal install Cabal cabal-install" and it stopped at "Building Cabal 3.0.0.0". I thought that I have to run it to be able to run commands for installing packages. Why it wasn't installing ?? It's very unpleasant to see that a program doesn't work... :(
I tried this command because I had the same error like you, with rejecting the bases when I try to install some packages.
If I wouldn't enter here I couldn't resolve the problem.
Thank you very much !

Was this page helpful?
0 / 5 - 0 ratings