Open philderbeast opened 6 months ago
I get an ambiguous target for a package named "all" too;
$ mkdir all
$ cd all
$ cabal init
...
$ cabal build all
Error: [Cabal-7132]
Ambiguous target 'all'. It could be:
:all (package *)
all:all (component)
$ cabal test all:tests
Error: [Cabal-7132]
Ambiguous target 'all:tests'. It could be:
:all:tests (package *:filter)
pkg:all:tests (package:filter)
I also get an ambiguous target if I name a testsuite all
.
$ cabal build all
Error: [Cabal-7132]
Ambiguous target 'all'. It could be:
:all (package *)
all-component:all (component)
In the docs we could say that there is an implicit current package if we're in the same directory as a
.cabal
package description file.https://github.com/haskell/cabal/blob/bccc59f78f64d8db8605380d6735e0730d8bea23/cabal-install/tests/IntegrationTests2.hs#L196-L200
We could clear up some possible gotchas;
the
all
target is always all tests of a project (forcabal test all
), even if the directory of a package when another reasonable expectation isall
tests in the package. What is the interaction between project and implicit current package for[TARGETS]
that don't scope to a package explicitly?when in a package directory, the package is automatically set as the target and, using
Cabal-tests
as the example,cabal test
is the same as runningcabal test Cabal-tests
orcabal test Cabal-tests:tests
from the root of the project. We could reasonably expectall
to be set automatically if in the same directory as a project, couldn't we?There's a note about
all:exes
in the docs forcabal install
but no explicit mention ofall:tests
(orall:benchmarks
). Theall:ctypes
target andall
target are described as target forms. It would be good to document all theall
use cases. We can't use this to refine a target, tryingCabal-tests:all:tests
won't work.all
targets but is the interaction a "union" or an "intersection" or something else?all:
cannot be used redundantly before a package and if tried, cabal looks for anall
package;I generated code snippets with;