-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Cabal 2.0 sub and foreign libraries
This should resolve both #3364 and #3361. There is a test case included that should address both of them as well. This is still relatively hacky. We will eventually be overhauling the component system more dramatically to support Backpack with #2540 (CC @ezyang). This may still have some problems due to the upstream issue haskell/cabal#4763, but at least in theory we're matching the behavior of upstream. We can consider workarounds after that issue comes to a conclusion.
- Loading branch information
Showing
14 changed files
with
159 additions
and
17 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
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
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,4 @@ | ||
import StackTest | ||
|
||
main :: IO () | ||
main = stack ["build"] |
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 |
29 changes: 29 additions & 0 deletions
29
test/integration/tests/internal-libraries/files/files.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,29 @@ | ||
name: files | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
cabal-version: >=2.0 | ||
|
||
library | ||
hs-source-dirs: src | ||
exposed-modules: Files | ||
build-depends: base | ||
default-language: Haskell2010 | ||
|
||
library foo | ||
hs-source-dirs: src-foo | ||
exposed-modules: Foo | ||
build-depends: base, files, stm | ||
default-language: Haskell2010 | ||
|
||
executable bar | ||
hs-source-dirs: src-bar | ||
main-is: Main.hs | ||
build-depends: base, files, foo | ||
default-language: Haskell2010 | ||
|
||
foreign-library baz | ||
type: native-shared | ||
other-modules: Baz | ||
build-depends: base, files, foo | ||
hs-source-dirs: src-baz | ||
default-language: Haskell2010 |
11 changes: 11 additions & 0 deletions
11
test/integration/tests/internal-libraries/files/src-bar/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,11 @@ | ||
module Main where | ||
|
||
import Files | ||
import Foo | ||
|
||
main :: IO () | ||
main = do | ||
putStrLn "files:" | ||
print files | ||
putStrLn "foo" | ||
foo >>= print |
11 changes: 11 additions & 0 deletions
11
test/integration/tests/internal-libraries/files/src-baz/Baz.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,11 @@ | ||
module Baz where | ||
|
||
import Files | ||
import Foo | ||
|
||
baz :: IO () | ||
baz = do | ||
putStrLn "files:" | ||
print files | ||
putStrLn "foo" | ||
foo >>= print |
7 changes: 7 additions & 0 deletions
7
test/integration/tests/internal-libraries/files/src-foo/Foo.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,7 @@ | ||
module Foo where | ||
|
||
import Control.Monad.STM | ||
import Files | ||
|
||
foo :: IO String | ||
foo = atomically $ return $ "foo using " ++ files |
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,4 @@ | ||
module Files where | ||
|
||
files :: String | ||
files = "files" |
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,3 @@ | ||
resolver: ghc-8.2.1 | ||
extra-deps: | ||
- stm-2.4.4.1 |