Description
Describe the bug
If a project P depends on A depends on B depends on C and a git reference is supplied in cabal.project
for project B
(for example to test a patch), then using --dependencies-only
will fail.
To Reproduce
See this build failure:
The error reported is:
cabal: Cannot select only the dependencies (as requested by the
'--only-dependencies' flag), the package ListLike-4.7.3 is required by a
dependency of one of the other targets.
Expected behavior
Expected behaviour. If the project should build without --dependencies-only
then it should also build with --dependencies-only
.
The reason this is useful is because it is common in CI to build with --dependencies-only
and then cache the cabal store. This helps ensure that something is cached in the project even if the project itself fails to build.
System information
All operating systems, versions of cabal
and ghc
.
Additional context
To make this work, cabal
can choose to build the minimal number of additional components outside of the the "dependencies only" set.