Versions
%cabal --version
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
%ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7
Problem
I want to install weeder. If there is no *.cabal file in the current directory, running cabal install weeder succeeds. However, if the one exists and contains a dependency that conflicts with what weeder requires, cabal install weeder fails.
For example, if a .cabal file contains text < 1.2.3.0 as build-depends, cabal install weeder fails with the message below:
%cabal install weeder
cabal: Could not resolve dependencies:
[__0] trying: foobarbaz-0.1.0.0 (user goal)
[__1] next goal: text (dependency of foobarbaz)
[__1] rejecting: text-1.2.4.1/installed-1.2.4.1 (conflict: foobarbaz =>
text<1.2.3.0)
[__1] skipping: text-1.2.5.0, text-1.2.4.1, text-1.2.4.0, text-1.2.3.2,
text-1.2.3.1, text-1.2.3.0 (has the same characteristics that caused the
previous version to fail: excluded by constraint '<1.2.3.0' from 'foobarbaz')
[__1] trying: text-1.2.2.2
[__2] next goal: deepseq (dependency of text)
[__2] rejecting: deepseq-1.4.4.0/installed-1.4.4.0 (conflict: text =>
base>=4.2 && <4.11, deepseq => base==4.14.3.0/installed-4.14.3.0)
[__2] trying: deepseq-1.4.5.0
[__3] next goal: array (dependency of text)
[__3] rejecting: array-0.5.4.0/installed-0.5.4.0 (conflict: text => base>=4.2
&& <4.11, array => base==4.14.3.0/installed-4.14.3.0)
[__3] trying: array-0.5.4.0
[__4] next goal: base (dependency of foobarbaz)
[__4] rejecting: base-4.14.3.0/installed-4.14.3.0 (conflict: text => base>=4.2
&& <4.11)
[__4] skipping: base-4.16.0.0, base-4.15.0.0, base-4.14.3.0, base-4.14.2.0,
base-4.14.1.0, base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=4.2 && <4.11' from 'text')
[__4] 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, base-3.0.3.2,
base-3.0.3.1 (constraint from non-upgradeable package requires installed
instance)
[__4] fail (backjumping, conflict set: base, foobarbaz, text)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, text, deepseq, array, foobarbaz
Try running with --minimize-conflict-set to improve the error message.
I can avoid this by mv foobarbaz.cabal foobarbaz.cabal.bk before cabal install weeder and mv foobarbaz.cabal.bk foobarbaz.cabal after the install, or running cabal install weeder in the other directory. But is there an option to ignore the local .cabal file?
Cabal has a --project-file option. It turns out that when specified empty, this causes cabal-install to not use any project file, even when one is in the current directory.
cabal v2-install --project-file="" weeder
After I posted the question, I found that the -z and --ignore-project options are also what I wanted.
cabal install -z weeder
Related
Every effort of me trying to install a library using cabal on Window 10 resulted in the same error:
cabal install gtk
cabal.exe: Could not resolve dependencies:
[__0] trying: parconc-examples-0.4.8 (user goal)
[__1] next goal: base (dependency of parconc-examples)
[__1] rejecting: base-4.15.0.0/installed-4.15.0.0 (conflict: parconc-examples
=> base>=4.5 && <4.14)
[__1] skipping: base-4.15.0.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0
(has the same characteristics that caused the previous version to fail:
excluded by constraint '>=4.5 && <4.14' from 'parconc-examples')
[__1] rejecting: base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
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, base-3.0.3.2, base-3.0.3.1
(constraint from non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, parconc-examples)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, parconc-examples
It worked perfectly fine on Linux, but I have not found how to resolve the problem on Windows.
Your version of the base library is 4.15.0.0. base is special in the sense that its version is tied to your GHC version, which seems to be GHC 9.0.1.
So, unlike with other libraries, cabal can't simply install a previous version of base when it's required by the build-depends: of some package.
parconc-examples has the following constraint on base: >=4.5 && <4.14. So version 4.15 is not accepted ("constraint from non-upgradeable package requires installed instance").
One thing you could try is to pass the extra option --allow-newer=base, like cabal install --allow-newer=base gtk. This will relax the restriction.
But it isn't a panacea: parconc-examples (or other package required by gtk) might actually fail to build with base == 4.15, because it might use some aspect of base == 4.14 that has changed in a non-backwards compatible way. Preventing such build failures is the purpose of bounds, after all.
cabal: Could not resolve dependencies:
[__0] trying: Win32-network-0.1.0.0 (user goal)
[__1] next goal: base (dependency of Win32-network)
[__1] rejecting: base-4.14.1.0/installed-4.14.1.0 (conflict: Win32-network =>
base>=4.5 && <4.13)
[__1] rejecting: base-4.12.0.0, base-4.11.1.0, base-4.11.0.0, 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, base-3.0.3.2, base-3.0.3.1 (constraint from
non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: Win32-network, base)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, Win32-network
I am doing cabal install cardano-node cardano-cli within my Linux/Ubuntu environment.
Looks like this commit relaxes that constraint suitably. Looks like the master branch of the cardano-node repo already requests a commit later than that, so probably just updating that repo will get you where you need to go.
Install cardano-cli & cardano-node the easy way on Mac:
Download the daedaluswallet.io wallet and install.
nano ~/.zshrc
export PATH=$PATH:/Applications/Daedalus\ Mainnet.app/Contents/MacOS
source ~/.zshrc
I'm trying to install ghc-mod to use with Atom-Haskell (the ide-haskell package) in Atom, but for some reason my Cabal doesn't want to.
When I enter the command cabal install ghc-mod, I get the following errors in my terminal:
Resolving dependencies...
cabal.exe: Could not resolve dependencies:
[__0] trying: ghc-mod-5.8.0.0 (user goal)
[__1] trying: syb-0.7.1 (dependency of ghc-mod)
[__2] next goal: base (dependency of ghc-mod)
[__2] rejecting: base-4.14.1.0/installed-4.14.1.0 (conflict: ghc-mod =>
base<4.10 && >=4.6.0.1)
[__2] skipping: base-4.14.0.0, base-4.13.0.0, base-4.12.0.0, base-4.11.1.0,
base-4.11.0.0, base-4.10.1.0, base-4.10.0.0 (has the same characteristics that
caused the previous version to fail: excluded by constraint '<4.10 &&
>=4.6.0.1' from 'ghc-mod')
[__2] rejecting: 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, base-3.0.3.2, base-3.0.3.1 (constraint from
non-upgradeable package requires installed instance)
[__2] fail (backjumping, conflict set: base, ghc-mod)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, ghc-mod, syb
I installed Cabal as part of the Haskell Platform, so to my understanding, it's a bit unusually configured. I don't have a %HOME%.cabal folder, and I don't know if that could be part of the issue?
I don't know a lot about how Cabal or ghc-mod work, so please let me know if you need any more info!
Thanks for any help!
You probably have a new version of base, (https://wiki.haskell.org/Base_package) where ghc-mod is only compatible with versions >=4.6.0.1 && <4.10 (https://hackage.haskell.org/package/ghc-mod). You'd have to downgrade.
I'm tring to install the package cabal-debian globally using cabal v2-install cabal-debian and get this error message:
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: base-4.12.0.0/installed-4.1... (user goal)
[__1] trying: binary-0.8.7.0 (user goal)
[__2] next goal: ghc (user goal)
[__2] rejecting: ghc-8.6.5/installed-8.6... (conflict: binary==0.8.7.0, ghc =>
binary==0.8.6.0/installed-0.8...)
[__2] trying: ghc-8.6.5
[__3] rejecting: ghc:-buildable (conflict: base==4.12.0.0/installed-4.1...,
ghc -buildable => base<0)
[__3] rejecting: ghc:+buildable (manual flag can only be changed explicitly)
[__3] fail (backjumping, conflict set: base, ghc, ghc:buildable)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: binary, base, ghc, ghc:buildable
Try running with --minimize-conflict-set to improve the error message.
I am using cabal 3.0.0.0 and have ghc 8.6.5 installed.
To me, this looks like you have a version of binary installed that isn't compatible with the boot libraries that come with the compiler. I recommend that you edit the file
~/.ghc/<something>-8.6.5/environments/default
and delete the line that mentions binary, then try again. (The <something> is almost certainly x86_64-linux.)
There comes up with a problem that cabal's base is conflicted with the dependency in .cabal file, it seems that my base version is too high, so is there a way to downgrade my base package version in the cabal sandbox.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: decafc-0.0.0 (user goal)
[__1] next goal: base (dependency of decafc)
[__1] rejecting: base-4.11.1.0/installed-4.1... (conflict: decafc => base>=4.5
&& <=4.9)
[__1] rejecting: base-4.11.1.0, base-4.11.0.0, 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, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable
package requires installed instance)
[__1] fail (backjumping, conflict set: base, decafc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, decafc
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unrstering the offending packages or
recreating the sandbox.
There is another problem that when using stack, how to add some flags to the alex if running stack build, for example, the cabal instruction is cabal install --alex-options="--ghc --template=\"$TOP/alex\"". So how to let the stack do the same things?
The base dependency indicates that it only works with versions between 4.5 and 4.9. That means the latest GHC you can use this package with is 8.0.1, since base ships with GHC and can't be upgraded. You could bump the dependency yourself, but you would likely have to fix things that don't work anymore due to changes in base, or you could install an older version of GHC.