diff --git a/hazel/ghc_paths.bzl b/hazel/ghc_paths.bzl index 812b6a3fed..2425d53053 100644 --- a/hazel/ghc_paths.bzl +++ b/hazel/ghc_paths.bzl @@ -5,23 +5,23 @@ def _ghc_paths_module_impl(ctx): inputs = [ghc], outputs = [ctx.outputs.out], command = """ - {ghc} --print-libdir - {ghc} --print-libdir | sed 's:\\\\:/:g' - cat > {out} << EOM module GHC.Paths ( ghc, ghc_pkg, libdir, docdir ) where -libdir, docdir, ghc, ghc_pkg :: FilePath - -poulet = "$({ghc} --print-libdir)" -libdir = "$({ghc} --print-libdir | sed 's:\\\\:/:g')" -docdir = "DOCDIR_IS_NOT_SET" +ghc, ghc_pkg, docdir, libdir :: FilePath ghc = "{ghc}" ghc_pkg = "{ghc_pkg}" -EOM""".format( + +docdir = "DOCDIR_IS_NOT_SET" +EOM + + echo -n 'libdir = "' >> {out} + {ghc} --print-libdir | tr '\\' '/' | tr -d '[:space:]' >> {out} + echo '"' >> {out} +""".format( ghc = ghc.path, ghc_pkg = tools.ghc_pkg.path, out = ctx.outputs.out.path, diff --git a/hazel/test/ghc-paths-test.hs b/hazel/test/ghc-paths-test.hs index 6d73e39ec3..c30100d321 100644 --- a/hazel/test/ghc-paths-test.hs +++ b/hazel/test/ghc-paths-test.hs @@ -1,7 +1,7 @@ module Main where import Control.Monad (when) -import GHC.Paths (ghc, ghc_pkg, libdir, docdir, poulet) +import GHC.Paths (ghc, ghc_pkg, libdir, docdir) import System.Exit (exitFailure) import System.IO (hPutStrLn, stderr) @@ -9,7 +9,7 @@ main :: IO () main = do let require name value = when (null value) $ do - hPutStrLn stderr (name ++ " should not be empty" ++ poulet) + hPutStrLn stderr (name ++ " should not be empty") exitFailure require "ghc" ghc require "ghc_pkg" ghc_pkg