forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix haskell#1541, by adding internal build-tools to PATH.
Signed-off-by: Edward Z. Yang <[email protected]>
- Loading branch information
Showing
13 changed files
with
135 additions
and
15 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
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,5 @@ | ||
{-# OPTIONS_GHC -F -pgmF my-custom-preprocessor #-} | ||
module A where | ||
|
||
a :: String | ||
a = "0000" |
11 changes: 11 additions & 0 deletions
11
Cabal/tests/PackageTests/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/tests/PackageTests/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 |
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 |
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