Commit c0e43bc8 authored by kristenk's avatar kristenk
Browse files

Add an integration test for solving #4295 with --independent-goals.

parent 8de0a0c2
name: pkg
version: 1.0
build-type: Custom
cabal-version: >= 1.24
setup-depends: setup-dep == 2.*
build-depends: setup-dep == 1.*
name: setup-dep
version: 1.0
build-type: Simple
cabal-version: >= 1.2
name: setup-dep
version: 2.0
build-type: Simple
cabal-version: >= 1.2
# cabal update
Downloading the latest package list from test-local-repo
# cabal new-build
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: pkg-1.0 (user goal)
next goal: setup-dep (user goal)
rejecting: setup-dep-2.0 (conflict: pkg => setup-dep==1.*)
rejecting: setup-dep-1.0 (constraint from user target requires ==2.0)
fail (backjumping, conflict set: pkg, setup-dep)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: setup-dep (3), pkg (2)
# cabal new-build
Resolving dependencies...
In order, the following would be built:
- setup-dep-1.0 (lib:setup-dep) (requires download & build)
- setup-dep-2.0 (first run)
- pkg-1.0 (lib:pkg) (first run)
import Test.Cabal.Prelude
-- This test case is a simplified version of #4295. There is a local package,
-- pkg-1.0, which has a setup dependency on setup-dep==2.*. The repo contains
-- setup-dep-1.0, and the project contains the newer version, setup-dep-2.0.
-- pkg-1.0 also has a non-setup dependency on setup-dep==1.*.
-- The solution to the dependency problem must use the local setup-dep only as a
-- setup dependency for pkg. This means that setup-dep cannot use the same
-- qualifier as pkg, even though they are both build targets of the project.
-- The solution must use --independent-goals to give pkg and setup-dep different
-- qualifiers.
main = cabalTest $ withRepo "repo" $ do
fails $ cabal "new-build" ["pkg", "--dry-run"]
cabal "new-build" ["pkg", "--dry-run", "--independent-goals"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment