From caab57bdf4b50c151c8feef0e895d35a8035369d Mon Sep 17 00:00:00 2001 From: sheaf Date: Wed, 17 Apr 2024 20:20:23 +0200 Subject: [PATCH] Add internal build tool to package-with-hooks test --- ...tomBuildToolData.txt => CustomPP1Data.txt} | 0 .../custom-build-tool/custom-build-tool.cabal | 24 ++++- .../custom-build-tool/exe/Main.hs | 91 +----------------- .../custom-build-tool/src/CustomBuildTool.hs | 93 +++++++++++++++++++ .../package-with-hooks/SetupHooks.hs | 63 ++++++------- .../package-with-hooks/data/CustomPP2Data.txt | 1 + .../package-with-hooks/exe/Main.hs | 16 ++++ .../package-with-hooks.cabal | 58 +++++++----- .../package-with-hooks/src/MyLib.hs-custompp | 4 - .../src/MyLib1.hs-custompp1 | 4 + .../src/MyLib2.hs-custompp2 | 4 + .../package-with-hooks/test/CallCustomPp.hs | 6 +- .../package-with-hooks/test/Main.hs | 8 +- 13 files changed, 216 insertions(+), 156 deletions(-) rename cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool-data/{CustomBuildToolData.txt => CustomPP1Data.txt} (100%) create mode 100644 cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/src/CustomBuildTool.hs create mode 100644 cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/data/CustomPP2Data.txt create mode 100644 cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/exe/Main.hs delete mode 100644 cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib.hs-custompp create mode 100644 cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib1.hs-custompp1 create mode 100644 cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib2.hs-custompp2 diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool-data/CustomBuildToolData.txt b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool-data/CustomPP1Data.txt similarity index 100% rename from cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool-data/CustomBuildToolData.txt rename to cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool-data/CustomPP1Data.txt diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool.cabal b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool.cabal index de8059d7ec1..eaccdb72cfc 100644 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool.cabal +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/custom-build-tool.cabal @@ -10,12 +10,29 @@ build-type: Simple data-dir: custom-build-tool-data data-files: - CustomBuildToolData.txt + CustomPP1Data.txt common warnings ghc-options: -Wall -executable custom-build-tool +library + + import: + warnings + + hs-source-dirs: + src + + exposed-modules: + CustomBuildTool + + build-depends: + base ^>= 4.18 && < 5, + containers, + directory + +executable custom-pp1 + import: warnings @@ -27,8 +44,7 @@ executable custom-build-tool build-depends: base ^>= 4.18 && < 5, - containers, - directory + custom-build-tool autogen-modules: Paths_custom_build_tool diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/exe/Main.hs b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/exe/Main.hs index e5753317deb..62ba3d56a39 100644 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/exe/Main.hs +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/exe/Main.hs @@ -1,25 +1,8 @@ module Main where --- base -import Control.Monad - ( unless ) -import Data.Char - ( isSpace ) -import Data.List - ( dropWhileEnd ) -import System.Environment - ( getArgs ) - --- containers -import Data.Map.Strict - ( Map ) -import qualified Data.Map.Strict as Map - --- directory -import System.Directory - ( doesFileExist, getCurrentDirectory ) - -- custom-build-tool +import CustomBuildTool + ( mkCustomBuildTool ) import Paths_custom_build_tool -- (Cabal autogenerated module) ( getDataFileName ) @@ -27,71 +10,5 @@ import Paths_custom_build_tool -- (Cabal autogenerated module) main :: IO () main = do - putStrLn "Starting custom-build-tool" - -- Get all the constants defined in the data file for the build tool. - customDataFile <- getDataFileName "CustomBuildToolData.txt" - customDataFileExists <- doesFileExist customDataFile - unless customDataFileExists $ do - cwd <- getCurrentDirectory - error $ - unlines - [ "Custom preprocessor could not access its data file." - , "Tried to look in: " ++ customDataFile - , "cwd: " ++ show cwd ] - customDataLines <- lines <$> readFile customDataFile - let customConstants :: Map String Int - customConstants = Map.fromList $ map read customDataLines - - -- Obtain input/output file paths from arguments to the preprocessor. - args <- getArgs - case args of - [inputFile, outputFile] -> do - inputFileExists <- doesFileExist inputFile - unless inputFileExists $ - error $ - unlines - [ "Custom preprocessor could not read input file." - , "Input file: " ++ inputFile ] - -- Read the input file, substitute constants for their values, - -- and write the result to the output file path. - inputLines <- lines <$> readFile inputFile - let outputLines = map ( preprocessLine customConstants ) ( zip [1..] inputLines ) - writeFile outputFile ( unlines outputLines ) - [] -> - putStrLn "Custom preprocessor: no arguments." - _ -> - error $ - unlines - [ "Custom preprocessor was given incorrect arguments." - , "Expected input and output file paths, but got " ++ what ++ "." ] - where - what = case args of - [] -> "none" - [_] -> "a single argument" - _ -> show (length args) ++ " arguments" - --- | Substitute any occurrence of {# ConstantName #} with the value of ConstantName, --- looked up in the data file for the preprocessor. -preprocessLine :: Map String Int -> ( Int, String ) -> String -preprocessLine constants ( ln_no, ln ) = go "" ln - where - go reversedPrev [] = reverse reversedPrev - go reversedPrev ('{':'#':rest) = reverse reversedPrev ++ inner "" rest - go reversedPrev (c:rest) = go (c:reversedPrev) rest - - inner reversedNm ('#':'}':rest) = - let constName = trimWhitespace $ reverse reversedNm - in case Map.lookup constName constants of - Just val -> show val ++ go "" rest - Nothing -> - error $ unlines - [ "Could not preprocess line " ++ show ln_no ++ ":" - , "unknown constant \"" ++ constName ++ "\"." ] - inner reversedNm (c:rest) = inner (c:reversedNm) rest - inner reversedNm "" = - error $ unlines - [ "Could not preprocess line " ++ show ln_no ++ ":" - , "unterminated constant \"{# " ++ reverse reversedNm ++ "\"." ] - -trimWhitespace :: String -> String -trimWhitespace = dropWhile isSpace . dropWhileEnd isSpace + customDataFile <- getDataFileName "CustomPP1Data.txt" + mkCustomBuildTool "custom-pp1" customDataFile diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/src/CustomBuildTool.hs b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/src/CustomBuildTool.hs new file mode 100644 index 00000000000..e023cee9df8 --- /dev/null +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/custom-build-tool/src/CustomBuildTool.hs @@ -0,0 +1,93 @@ +module CustomBuildTool + ( mkCustomBuildTool ) + where + +-- base +import Control.Monad + ( unless ) +import Data.Char + ( isSpace ) +import Data.List + ( dropWhileEnd ) +import System.Environment + ( getArgs ) + +-- containers +import Data.Map.Strict + ( Map ) +import qualified Data.Map.Strict as Map + +-- directory +import System.Directory + ( doesFileExist, getCurrentDirectory ) + +-------------------------------------------------------------------------------- + +mkCustomBuildTool :: String -> FilePath -> IO () +mkCustomBuildTool buildToolName customDataFile = do + putStrLn $ "Starting " ++ buildToolName + -- Get all the constants defined in the data file for the build tool. + customDataFileExists <- doesFileExist customDataFile + unless customDataFileExists $ do + cwd <- getCurrentDirectory + error $ + unlines + [ "Custom preprocessor " ++ buildToolName ++ " could not access its data file." + , "Tried to look in: " ++ customDataFile + , "cwd: " ++ show cwd ] + customDataLines <- lines <$> readFile customDataFile + let customConstants :: Map String Int + customConstants = Map.fromList $ map read customDataLines + + -- Obtain input/output file paths from arguments to the preprocessor. + args <- getArgs + case args of + [inputFile, outputFile] -> do + inputFileExists <- doesFileExist inputFile + unless inputFileExists $ + error $ + unlines + [ "Custom preprocessor " ++ buildToolName ++ " could not read input file." + , "Input file: " ++ inputFile ] + -- Read the input file, substitute constants for their values, + -- and write the result to the output file path. + inputLines <- lines <$> readFile inputFile + let outputLines = map ( preprocessLine customConstants ) ( zip [1..] inputLines ) + writeFile outputFile ( unlines outputLines ) + [] -> + putStrLn $ "Custom preprocessor " ++ buildToolName ++ ": no arguments." + _ -> + error $ + unlines + [ "Custom preprocessor " ++ buildToolName ++ " was given incorrect arguments." + , "Expected input and output file paths, but got " ++ what ++ "." ] + where + what = case args of + [_] -> "a single argument" + _ -> show (length args) ++ " arguments" + +-- | Substitute any occurrence of {# ConstantName #} with the value of ConstantName, +-- looked up in the data file for the preprocessor. +preprocessLine :: Map String Int -> ( Int, String ) -> String +preprocessLine constants ( ln_no, ln ) = go "" ln + where + go reversedPrev [] = reverse reversedPrev + go reversedPrev ('{':'#':rest) = reverse reversedPrev ++ inner "" rest + go reversedPrev (c:rest) = go (c:reversedPrev) rest + + inner reversedNm ('#':'}':rest) = + let constName = trimWhitespace $ reverse reversedNm + in case Map.lookup constName constants of + Just val -> show val ++ go "" rest + Nothing -> + error $ unlines + [ "Could not preprocess line " ++ show ln_no ++ ":" + , "unknown constant \"" ++ constName ++ "\"." ] + inner reversedNm (c:rest) = inner (c:reversedNm) rest + inner reversedNm "" = + error $ unlines + [ "Could not preprocess line " ++ show ln_no ++ ":" + , "unterminated constant \"{# " ++ reverse reversedNm ++ "\"." ] + +trimWhitespace :: String -> String +trimWhitespace = dropWhile isSpace . dropWhileEnd isSpace diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/SetupHooks.hs b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/SetupHooks.hs index 39774c5681c..6d47301f4ed 100644 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/SetupHooks.hs +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/SetupHooks.hs @@ -25,42 +25,28 @@ import Distribution.Simple.SetupHooks -- Cabal import Distribution.ModuleName ( ModuleName ) -import Distribution.Simple.Flag - ( fromFlag ) import Distribution.Simple.LocalBuildInfo ( mbWorkDirLBI ) import Distribution.Simple.Program - ( configureProgram, runProgramCwd ) + ( runProgramCwd ) import Distribution.Simple.Program.Db ( lookupProgram ) import Distribution.Simple.Utils ( createDirectoryIfMissingVerbose, findFileCwdWithExtension' ) import Distribution.Types.Component ( componentBuildInfo ) -import qualified Distribution.Types.LocalBuildConfig as LBC - ( withPrograms ) import Distribution.Types.LocalBuildInfo ( withPrograms ) -import Distribution.Types.VersionRange - ( anyVersion ) import Distribution.Utils.Path ( SymbolicPath, FileOrDir(Dir), CWD, Pkg - , interpretSymbolicPath, getSymbolicPath, moduleNameSymbolicPath + , getSymbolicPath, moduleNameSymbolicPath ) import Distribution.Utils.ShortText ( toShortText ) --- containers -import qualified Data.Map as Map - ( singleton ) - --- directory -import System.Directory - ( getCurrentDirectory ) - -- filepath import System.FilePath - ( (), replaceExtension, takeDirectory ) + ( (), replaceExtension, takeDirectory, takeExtension ) -------------------------------------------------------------------------------- @@ -74,9 +60,6 @@ setupHooks = } } -customPpName :: String -customPpName = "custom-build-tool" - -- | Runs the custom-build-tool preprocessor on all .hs-custompp files. preBuildRules :: PreBuildComponentInputs -> RulesM () preBuildRules @@ -94,24 +77,33 @@ preBuildRules progDb = withPrograms lbi mbWorkDir = mbWorkDirLBI lbi - -- 1. Look up the custom-build-tool preprocessor. - let customPpProg = simpleProgram customPpName - mbCustomPp = lookupProgram customPpProg progDb - customPp = case mbCustomPp of + -- 1. Look up the custom-build-tool preprocessors. + let customPp1Prog = simpleProgram "custom-pp1" + mbCustomPp1 = lookupProgram customPp1Prog progDb + customPp1 = case mbCustomPp1 of + Just pp -> pp + Nothing -> + error $ + unlines + [ "package-with-hooks: could not find custom-pp1 pre-processor in the program database." + , "Component: " ++ show compNm ] + customPp2Prog = simpleProgram "custom-pp2" + mbCustomPp2 = lookupProgram customPp2Prog progDb + customPp2 = case mbCustomPp2 of Just pp -> pp Nothing -> error $ unlines - [ "package-with-hooks: could not find " ++ show customPpName ++ " pre-processor in the program database." + [ "package-with-hooks: could not find custom-pp2 pre-processor in the program database." , "Component: " ++ show compNm ] - -- 2. Create a command to run this preprocess, passing input and output file locations. + -- 2. Create a command to run a preprocessor, passing input and output file locations. let - ppCmd :: Location -> Location + ppCmd :: ConfiguredProgram -> Location -> Location -> Command ( Verbosity, Maybe (SymbolicPath CWD (Dir Pkg)), ConfiguredProgram, Location, Location ) ( IO () ) - ppCmd i o = + ppCmd pp i o = mkCommand ( static Dict ) ( static ppModule ) - ( verbosity, mbWorkDir, customPp, i, o ) + ( verbosity, mbWorkDir, pp, i, o ) -- 3. Get all modules listed in the package description for this component. let mods = componentModules comp @@ -122,7 +114,7 @@ preBuildRules ppMbMods <- liftIO $ for mods $ \ md -> do - mbPath <- findFileCwdWithExtension' mbWorkDir [ "hs-custompp" ] searchDirs + mbPath <- findFileCwdWithExtension' mbWorkDir [ "hs-custompp1", "hs-custompp2" ] searchDirs ( moduleNameSymbolicPath md ) case mbPath of Just ( base, rel ) -> @@ -134,16 +126,21 @@ preBuildRules let ppMods = catMaybes ppMbMods liftIO $ putStrLn $ unlines $ "package-with-hooks: hs-custompp modules:" - : ( map ( \ m -> " - " ++ show m ) mods ) + : ( map ( \ m -> " - " ++ show m ) ppMods ) -- TODO: declare the corresponding monitored files corresponding to the -- above search (it would be nice to be able to use findFileWithExtensionMonitored). -- 5. Declare a rule for each custom-pp module that runs the pre-processor. for_ ppMods $ \ ( md, inputLoc@( _inputBaseDir, inputRelPath ) ) -> do - let outputBaseLoc = getSymbolicPath $ autogenComponentModulesDir lbi clbi + let ext = takeExtension inputRelPath + customPp = case ext of + ".hs-custompp1" -> customPp1 + ".hs-custompp2" -> customPp2 + _ -> error $ "internal error: unhandled extension " ++ ext + outputBaseLoc = getSymbolicPath $ autogenComponentModulesDir lbi clbi outputLoc = ( outputBaseLoc, replaceExtension inputRelPath "hs" ) registerRule_ ( toShortText $ show md ) $ - staticRule ( ppCmd inputLoc outputLoc ) [] ( NE.singleton outputLoc ) + staticRule ( ppCmd customPp inputLoc outputLoc ) [] ( NE.singleton outputLoc ) ppModule :: ( Verbosity, Maybe (SymbolicPath CWD (Dir Pkg)), ConfiguredProgram, Location, Location ) -> IO () ppModule ( verbosity, mbWorkDir, customPp, ( inputBaseDir, inputRelPath ), ( outputBaseDir, outputRelPath ) ) = do diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/data/CustomPP2Data.txt b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/data/CustomPP2Data.txt new file mode 100644 index 00000000000..12be0183a66 --- /dev/null +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/data/CustomPP2Data.txt @@ -0,0 +1 @@ +("MyConstant", 1717) diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/exe/Main.hs b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/exe/Main.hs new file mode 100644 index 00000000000..f188ba890d6 --- /dev/null +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/exe/Main.hs @@ -0,0 +1,16 @@ +module Main where + +-- custom-build-tool +import CustomBuildTool + ( mkCustomBuildTool ) + +-- package-with-hooks +import Paths_package_with_hooks -- (Cabal autogenerated module) + ( getDataFileName ) + +-------------------------------------------------------------------------------- + +main :: IO () +main = do + customDataFile <- getDataFileName "CustomPP2Data.txt" + mkCustomBuildTool "custom-pp2" customDataFile diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/package-with-hooks.cabal b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/package-with-hooks.cabal index 28c7a11a1b6..71018831d73 100644 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/package-with-hooks.cabal +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/package-with-hooks.cabal @@ -5,32 +5,45 @@ license: BSD-3-Clause author: sheaf maintainer: sheaf category: Testing -build-type: Simple - --Hooks +build-type: Hooks + +data-dir: + data +data-files: + CustomPP2Data.txt common warnings ghc-options: -Wall ---custom-setup --- import: warnings --- setup-depends: --- base >= 4.18 && < 5, --- containers, --- directory, --- filepath, --- Cabal, --- Cabal-hooks, --- hooks-exe +custom-setup + import: warnings + setup-depends: + base >= 4.18 && < 5, + containers, + filepath, + Cabal, + Cabal-hooks, + hooks-exe + +executable custom-pp2 + import: warnings + hs-source-dirs: exe + main-is: Main.hs + build-depends: base ^>= 4.18 && < 5, custom-build-tool + autogen-modules: Paths_package_with_hooks + other-modules: Paths_package_with_hooks + default-language: Haskell2010 ---library --- import: warnings --- exposed-modules: MyLib --- autogen-modules: MyLib --- build-depends: base >= 4.18 && < 5 --- hs-source-dirs: src --- default-language: Haskell2010 --- build-tool-depends: --- custom-build-tool:custom-build-tool +library + import: warnings + exposed-modules: MyLib1, MyLib2 + autogen-modules: MyLib1, MyLib2 + build-depends: base >= 4.18 && < 5 + hs-source-dirs: src + default-language: Haskell2010 + build-tool-depends: + custom-build-tool:custom-pp1, + package-with-hooks:custom-pp2 test-suite package-with-hooks-test import: warnings @@ -46,4 +59,5 @@ test-suite package-with-hooks-test >= 2.20 && < 3, process build-tool-depends: - custom-build-tool:custom-build-tool + custom-build-tool:custom-pp1, + package-with-hooks:custom-pp2 diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib.hs-custompp b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib.hs-custompp deleted file mode 100644 index 1e05f16bb37..00000000000 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib.hs-custompp +++ /dev/null @@ -1,4 +0,0 @@ -module MyLib (someFunc) where - -someFunc :: Int -> Int -someFunc x = x + {# MyConstant #} diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib1.hs-custompp1 b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib1.hs-custompp1 new file mode 100644 index 00000000000..b6c07dd806e --- /dev/null +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib1.hs-custompp1 @@ -0,0 +1,4 @@ +module MyLib1 (someFunc1) where + +someFunc1 :: Int -> Int +someFunc1 x = x + {# MyConstant #} diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib2.hs-custompp2 b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib2.hs-custompp2 new file mode 100644 index 00000000000..b80a6807b28 --- /dev/null +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/src/MyLib2.hs-custompp2 @@ -0,0 +1,4 @@ +module MyLib2 (someFunc2) where + +someFunc2 :: Int -> Int +someFunc2 x = x + {# MyConstant #} diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/CallCustomPp.hs b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/CallCustomPp.hs index 1816916ae34..bf57677b212 100644 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/CallCustomPp.hs +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/CallCustomPp.hs @@ -12,8 +12,8 @@ import System.Process -------------------------------------------------------------------------------- -callCustomPp :: IO () -callCustomPp = do +callCustomPp :: String -> IO () +callCustomPp customPpName = do (exitCode, stdout, stderr) <- readProcessWithExitCode customPpName [] "" case exitCode of ExitSuccess -> @@ -24,5 +24,3 @@ callCustomPp = do , "stdout: " ++ stdout , "stderr: " ++ stderr ] -customPpName :: String -customPpName = "custom-build-tool" diff --git a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/Main.hs b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/Main.hs index 9c657d418d6..a0f103360ee 100644 --- a/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/Main.hs +++ b/cabal-testsuite/PackageTests/HooksPreprocessor/package-with-hooks/test/Main.hs @@ -16,9 +16,13 @@ import CallCustomPp -- data directory, both at compile-time and at run-time. $( do - runIO callCustomPp + runIO $ do + callCustomPp "custom-pp1" + callCustomPp "custom-pp2" return [] ) main :: IO () -main = callCustomPp +main = do + callCustomPp "custom-pp1" + callCustomPp "custom-pp2"