-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build-tools PATH usage with per-component new-build
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
- Loading branch information
Showing
13 changed files
with
131 additions
and
18 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
3 changes: 3 additions & 0 deletions
3
cabal-install/tests/IntegrationTests/new-build/BuildToolsPath.sh
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 @@ | ||
. ./common.sh | ||
cd BuildToolsPath | ||
cabal new-build build-tools-path hello-world |
5 changes: 5 additions & 0 deletions
5
cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/A.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 @@ | ||
{-# OPTIONS_GHC -F -pgmF my-custom-preprocessor #-} | ||
module A where | ||
|
||
a :: String | ||
a = "0000" |
11 changes: 11 additions & 0 deletions
11
cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/MyCustomPreprocessor.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 System.Environment | ||
import System.IO | ||
|
||
main :: IO () | ||
main = do | ||
(_:source:target:_) <- getArgs | ||
let f '0' = '1' | ||
f c = c | ||
writeFile target . map f =<< readFile source |
25 changes: 25 additions & 0 deletions
25
cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/build-tools-path.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,25 @@ | ||
name: build-tools-path | ||
version: 0.1.0.0 | ||
synopsis: Checks build-tools are put in PATH | ||
license: BSD3 | ||
category: Testing | ||
build-type: Simple | ||
cabal-version: >=1.10 | ||
|
||
executable my-custom-preprocessor | ||
main-is: MyCustomPreprocessor.hs | ||
build-depends: base, directory | ||
default-language: Haskell2010 | ||
|
||
library | ||
exposed-modules: A | ||
build-depends: base | ||
build-tools: my-custom-preprocessor | ||
-- ^ Note the internal dependency. | ||
default-language: Haskell2010 | ||
|
||
executable hello-world | ||
main-is: Hello.hs | ||
build-depends: base, build-tools-path | ||
default-language: Haskell2010 | ||
hs-source-dirs: hello |
1 change: 1 addition & 0 deletions
1
cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/cabal.project
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 @@ | ||
packages: . |
6 changes: 6 additions & 0 deletions
6
cabal-install/tests/IntegrationTests/new-build/BuildToolsPath/hello/Hello.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 where | ||
|
||
import A | ||
|
||
main :: IO () | ||
main = putStrLn a |