summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-09-06 14:40:03 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-07 04:50:59 -0400
commitb0fdd7fe666ae61044f041233354765c4bb68529 (patch)
treeee4e24e3e5e7699fb5b91ad91d19a4b0d5d00c00
parent821bece9e7b59272e779193d558298ba4cc7b888 (diff)
downloadhaskell-b0fdd7fe666ae61044f041233354765c4bb68529.tar.gz
hadrian: fix _build/ghc-stage1 to make it callable from any directory
-rw-r--r--hadrian/src/Rules/Generate.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index 1736405a15..ef3d8aa3b4 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -209,8 +209,9 @@ emptyTarget = vanillaContext (error "Rules.Generate.emptyTarget: unknown stage")
ghcWrapper :: Stage -> Expr String
ghcWrapper Stage0 = error "Stage0 GHC does not require a wrapper script to run."
ghcWrapper stage = do
- dbPath <- expr $ packageDbPath stage
- ghcPath <- expr $ programPath (vanillaContext (pred stage) ghc)
+ dbPath <- expr $ (</>) <$> topDirectory <*> packageDbPath stage
+ ghcPath <- expr $ (</>) <$> topDirectory
+ <*> programPath (vanillaContext (pred stage) ghc)
return $ unwords $ map show $ [ ghcPath ]
++ [ "-package-db " ++ dbPath | stage == Stage1 ]
++ [ "$@" ]