[Git][ghc/ghc][master] Hadrian: Make -i paths absolute

Marge Bot gitlab at gitlab.haskell.org
Wed Apr 15 03:30:35 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
7b41f21b by Matthew Pickering at 2020-04-14T23:30:24-04:00
Hadrian: Make -i paths absolute

The primary reason for this change is that ghcide does not work with
relative paths. It also matches what cabal and stack do, they always
pass absolute paths.

- - - - -


1 changed file:

- hadrian/src/Settings/Builders/Ghc.hs


Changes:

=====================================
hadrian/src/Settings/Builders/Ghc.hs
=====================================
@@ -11,6 +11,7 @@ import Settings.Builders.Common
 import Settings.Warnings
 import qualified Context as Context
 import Rules.Libffi (libffiName)
+import System.Directory
 
 ghcBuilderArgs :: Args
 ghcBuilderArgs = mconcat [ compileAndLinkHs, compileC, findHsDependencies
@@ -215,18 +216,20 @@ packageGhcArgs = do
 includeGhcArgs :: Args
 includeGhcArgs = do
     pkg     <- getPackage
-    path    <- getBuildPath
+    path    <- exprIO . makeAbsolute =<< getBuildPath
     context <- getContext
     srcDirs <- getContextData srcDirs
-    autogen <- expr $ autogenPath context
+    abSrcDirs <- exprIO $ mapM makeAbsolute [ (pkgPath pkg -/- dir) | dir <- srcDirs ]
+    autogen <- expr (autogenPath context)
+    cautogen <-  exprIO (makeAbsolute autogen)
     stage <- getStage
-    libPath <- expr $ stageLibPath stage
+    libPath <- expr (stageLibPath stage)
     let cabalMacros = autogen -/- "cabal_macros.h"
     expr $ need [cabalMacros]
     mconcat [ arg "-i"
             , arg $ "-i" ++ path
-            , arg $ "-i" ++ autogen
-            , pure [ "-i" ++ pkgPath pkg -/- dir | dir <- srcDirs ]
+            , arg $ "-i" ++ cautogen
+            , pure [ "-i" ++ d | d <- abSrcDirs ]
             , cIncludeArgs
             , arg $      "-I" ++ libPath
             , arg $ "-optc-I" ++ libPath



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7b41f21bbfa9e266ba6654b08c3f9fec549c8bca

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7b41f21bbfa9e266ba6654b08c3f9fec549c8bca
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200414/d6aa4ad5/attachment-0001.html>


More information about the ghc-commits mailing list