-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #6046 Unregister local packages for sub libraries
Also adds documentation. Also adds an integration test.
- Loading branch information
Showing
12 changed files
with
216 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
test/integration/tests/6046-missing-sublib-unregister/Main.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import StackTest | ||
|
||
-- This tests building a package with a library, an internal sub library, and a | ||
-- test that depends on the internal sub library, first version 0.1.0.0 | ||
-- (the Cabal file is @foo.cabal1@) and then version 0.2.0.0 (the Cabal file is | ||
-- @foo.cabal2@). | ||
main :: IO () | ||
main = do | ||
copy "foo.cabal1" "foo.cabal" | ||
stack ["test"] | ||
copy "foo.cabal2" "foo.cabal" | ||
stack ["test"] |
2 changes: 2 additions & 0 deletions
2
test/integration/tests/6046-missing-sublib-unregister/files/Setup.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
38 changes: 38 additions & 0 deletions
38
test/integration/tests/6046-missing-sublib-unregister/files/foo.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cabal-version: 2.0 | ||
name: foo | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
|
||
library | ||
exposed-modules: | ||
Lib | ||
other-modules: | ||
Sub | ||
hs-source-dirs: | ||
src | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints | ||
build-depends: | ||
base >=4.7 && <5 | ||
, sub | ||
default-language: Haskell2010 | ||
|
||
library sub | ||
exposed-modules: | ||
Sub | ||
hs-source-dirs: | ||
src | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints | ||
build-depends: | ||
base >=4.7 && <5 | ||
default-language: Haskell2010 | ||
|
||
test-suite foo | ||
type: exitcode-stdio-1.0 | ||
main-is: Main.hs | ||
hs-source-dirs: | ||
test | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
base >=4.7 && <5 | ||
, foo | ||
default-language: Haskell2010 |
38 changes: 38 additions & 0 deletions
38
test/integration/tests/6046-missing-sublib-unregister/files/foo.cabal1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cabal-version: 2.0 | ||
name: foo | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
|
||
library | ||
exposed-modules: | ||
Lib | ||
other-modules: | ||
Sub | ||
hs-source-dirs: | ||
src | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints | ||
build-depends: | ||
base >=4.7 && <5 | ||
, sub | ||
default-language: Haskell2010 | ||
|
||
library sub | ||
exposed-modules: | ||
Sub | ||
hs-source-dirs: | ||
src | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints | ||
build-depends: | ||
base >=4.7 && <5 | ||
default-language: Haskell2010 | ||
|
||
test-suite foo | ||
type: exitcode-stdio-1.0 | ||
main-is: Main.hs | ||
hs-source-dirs: | ||
test | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
base >=4.7 && <5 | ||
, foo | ||
default-language: Haskell2010 |
38 changes: 38 additions & 0 deletions
38
test/integration/tests/6046-missing-sublib-unregister/files/foo.cabal2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cabal-version: 2.0 | ||
name: foo | ||
version: 0.2.0.0 | ||
build-type: Simple | ||
|
||
library | ||
exposed-modules: | ||
Lib | ||
other-modules: | ||
Sub | ||
hs-source-dirs: | ||
src | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints | ||
build-depends: | ||
base >=4.7 && <5 | ||
, sub | ||
default-language: Haskell2010 | ||
|
||
library sub | ||
exposed-modules: | ||
Sub | ||
hs-source-dirs: | ||
src | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints | ||
build-depends: | ||
base >=4.7 && <5 | ||
default-language: Haskell2010 | ||
|
||
test-suite foo | ||
type: exitcode-stdio-1.0 | ||
main-is: Main.hs | ||
hs-source-dirs: | ||
test | ||
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
base >=4.7 && <5 | ||
, foo | ||
default-language: Haskell2010 |
5 changes: 5 additions & 0 deletions
5
test/integration/tests/6046-missing-sublib-unregister/files/src/Lib.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Lib | ||
( someFunc | ||
) where | ||
|
||
import Sub ( someFunc ) |
6 changes: 6 additions & 0 deletions
6
test/integration/tests/6046-missing-sublib-unregister/files/src/Sub.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Sub | ||
( someFunc | ||
) where | ||
|
||
someFunc :: IO () | ||
someFunc = putStrLn "someFunc" |
1 change: 1 addition & 0 deletions
1
test/integration/tests/6046-missing-sublib-unregister/files/stack.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
resolver: lts-20.8 |
6 changes: 6 additions & 0 deletions
6
test/integration/tests/6046-missing-sublib-unregister/files/test/Main.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Main (main) where | ||
|
||
import Lib | ||
|
||
main :: IO () | ||
main = someFunc |