Commit be72afa7 authored by Oleg Grenrus's avatar Oleg Grenrus

Add tests for #6961

parent 5b28d47b
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- pkg-foo-0 (lib:internal-lib) (first run)
- pkg-foo-0 (lib) (first run)
- pkg-bar-0 (exe:example) (first run)
import Test.Cabal.Prelude
main = cabalTest $
cabal "v2-build" ["all", "--dry-run", "--enable-tests"]
module Main where
import Lib
main :: IO ()
main = print value
cabal-version: 2.0
name: pkg-bar
version: 0
build-type: Simple
synopsis: This should work
category: Test
executable example
default-language: Haskell2010
hs-source-dirs: exe
main-is: Main.hs
build-depends: base, pkg-foo
cabal-version: 2.0
name: pkg-foo
version: 0
build-type: Simple
synopsis: This should work
category: Test
library
default-language: Haskell2010
hs-source-dirs: src
build-depends: base <5, internal-lib
exposed-modules: Lib
library internal-lib
default-language: Haskell2010
hs-source-dirs: internal
build-depends: base <5
exposed-modules: InternalLib
# cabal v2-build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: pkg-bar-0 (user goal)
[__1] next goal: pkg-foo (user goal)
[__1] rejecting: pkg-foo-0 (library 'internal-lib' is private, but it is required by pkg-bar)
[__1] fail (backjumping, conflict set: pkg-bar, pkg-foo)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: pkg-bar (2), pkg-foo (2)
import Test.Cabal.Prelude
main = cabalTest $
-- we try to depend on private component from outside,
-- so this should fail.
fails $ cabal "v2-build" ["all", "--dry-run", "--enable-tests"]
module Main where
import InternalLib
main :: IO ()
main = print value
cabal-version: 3.0
name: pkg-bar
version: 0
build-type: Simple
synopsis: This should work
category: Test
executable example
default-language: Haskell2010
hs-source-dirs: exe
main-is: Main.hs
build-depends: base, pkg-foo:internal-lib
cabal-version: 2.0
name: pkg-foo
version: 0
build-type: Simple
synopsis: This should work
category: Test
library
default-language: Haskell2010
hs-source-dirs: src
build-depends: base <5, internal-lib
exposed-modules: Lib
library internal-lib
default-language: Haskell2010
hs-source-dirs: internal
build-depends: base <5
exposed-modules: InternalLib
# cabal v2-build
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following would be built:
- issue6961-0 (lib:internal-lib) (first run)
- issue6961-0 (exe:example) (first run)
import Test.Cabal.Prelude
main = cabalTest $
cabal "v2-build" ["all", "--dry-run", "--enable-tests"]
module Main where
import Lib
main :: IO ()
main = print value
cabal-version: 2.0
name: issue6961
version: 0
build-type: Simple
synopsis: This should work
category: Test
library internal-lib
default-language: Haskell2010
hs-source-dirs: src
build-depends: base <5
exposed-modules: Lib
executable example
default-language: Haskell2010
hs-source-dirs: exe
main-is: Main.hs
build-depends: base, internal-lib
# cabal v2-build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: issue6961-0 (user goal)
[__1] rejecting: issue6961:!test (constraint from config file, command line flag, or user target requires opposite flag selection)
[__1] rejecting: issue6961:*test (requires library 'internal-lib' from issue6961, but the component is private)
[__1] fail (backjumping, conflict set: issue6961, issue6961:test)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: issue6961 (3), issue6961:test (3)
import Test.Cabal.Prelude
main = cabalTest $
-- fails, but it shouldn't.
-- https://github.com/haskell/cabal/issues/6961
fails $ cabal "v2-build" ["all", "--dry-run", "--enable-tests"]
cabal-version: 2.0
name: issue6961
version: 0
build-type: Simple
synopsis: This should work
category: Test
library internal-lib
default-language: Haskell2010
hs-source-dirs: src
build-depends: base <5
exposed-modules: Lib
test-suite example
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: exe
main-is: Main.hs
build-depends: base, internal-lib
module Main where
import Lib
main :: IO ()
main = print value
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