You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Mistakenly adding build-tool-depends twice, the first without a version range, the second with one (or both with a version range) leads to a build failure.
To Reproduce
Run cabal init creating a test-suite and then add these two lines to the test suite:
$ cabal build all --enable-tests
...
Build profile: -w ghc-9.6.6 -O1
In order, the following will be built (use -v for more details):
- build-tool-depends-twice-0.1.0.0 (test:build-tool-depends-twice-test) (configuration changed)
Configuring test suite 'build-tool-depends-twice-test' for build-tool-depends-twice-0.1.0.0...
Error: [Cabal-1008]
The program 'hspec-discover' version >=2 && <3 is required but the version of
/home/.../.local/state/cabal/store/ghc-9.6.6/hspec-discover-2.11.10-e-hspec-discover-46bdc5d621da43233045a4700712e015d472ed9d8d9e8f6ba007136568801492/bin/hspec-discover could not be determined.
Error: [Cabal-7125]
Failed to build test:build-tool-depends-twice-test from build-tool-depends-twice-0.1.0.0. The failure occurred during the configure step.
$ cabal build all --enable-tests
...
Resolving dependencies...
Build profile: -w ghc-9.12.1 -O1
In order, the following will be built (use -v for more details):
- base-compat-0.14.1 (lib) (requires build)
- markdown-unlit-0.5.1 (lib) (requires build)
- markdown-unlit-0.5.1 (exe:markdown-unlit) (requires build)
- build-tool-depends-twice-0.1.0.0 (test:build-tool-depends-twice-test) (first run)
Starting base-compat-0.14.1 (lib)
Building base-compat-0.14.1 (lib)
Installing base-compat-0.14.1 (lib)
Completed base-compat-0.14.1 (lib)
Starting markdown-unlit-0.5.1 (lib)
Building markdown-unlit-0.5.1 (lib)
Installing markdown-unlit-0.5.1 (lib)
Completed markdown-unlit-0.5.1 (lib)
Starting markdown-unlit-0.5.1 (exe:markdown-unlit)
Building markdown-unlit-0.5.1 (exe:markdown-unlit)
Installing markdown-unlit-0.5.1 (exe:markdown-unlit)
Completed markdown-unlit-0.5.1 (exe:markdown-unlit)
Configuring test suite 'build-tool-depends-twice-test' for build-tool-depends-twice-0.1.0.0...
Error: [Cabal-1008]
The program 'markdown-unlit' version >=0.5.0 && <0.6 is required but the version of /home/.../.local/state/cabal/store/ghc-9.12.1-a75a/markdown-unlit-0.5.1-e-markdown-unlit-0d34e71effbc9fbd30111d61fca43c4ced66a0848c7b70876a029fc5266aa9aa/bin/markdown-unlit could not be determined.
Error: [Cabal-7125]
Failed to build test:build-tool-depends-twice-test from build-tool-depends-twice-0.1.0.0. The failure occurred during the configure step.
Expected behavior
That cabal-install-3.14.1.0 is able to build the test suite or it warns about the repeated build-tool-depends or both.
Seen on ubuntu 22.04
The text was updated successfully, but these errors were encountered:
Looking at the code I can see why but I do think the error message could be better. Also if the build is installing the tool at a path with the version encoded into the path, why can't its version be determined? Seems odd that from store/ghc-9.12.1-a75a/markdown-unlit-0.5.1-etc the version can't be determined to be markdown-unlit-0.5.1.
Describe the bug
Mistakenly adding
build-tool-depends
twice, the first without a version range, the second with one (or both with a version range) leads to a build failure.To Reproduce
Run
cabal init
creating a test-suite and then add these two lines to the test suite:The same failure occurs with:
The following repeats build without problem:
I see the same failure as well with the example from the docs, if repeated:
Also happens with the latest compiler:
Expected behavior
That
cabal-install-3.14.1.0
is able to build the test suite or it warns about the repeatedbuild-tool-depends
or both.Seen on ubuntu 22.04
The text was updated successfully, but these errors were encountered: