summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorARATA Mizuki <minorinoki@gmail.com>2021-11-01 13:27:39 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-03 09:19:17 -0400
commit9f42a6dcebf12a8c3e7c18d8291c0fa95e3c4d86 (patch)
tree9f3c9a5f2478174e961b437846f6e04fe9a1a754
parent39eed84c2188b15ed312b4468f1a44c6a49fb268 (diff)
downloadhaskell-9f42a6dcebf12a8c3e7c18d8291c0fa95e3c4d86.tar.gz
hadrian: Use $bindir instead of `dirname $0` in ghci wrapper
`dirname $0` doesn't work when the wrapper is called via a symbolic link. Fix #20589
-rw-r--r--hadrian/src/Rules/BinaryDist.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs
index dc86af3c4f..c86d42d8f0 100644
--- a/hadrian/src/Rules/BinaryDist.hs
+++ b/hadrian/src/Rules/BinaryDist.hs
@@ -420,8 +420,7 @@ runGhcWrapper = pure $ "exec \"$executablename\" -f \"$exedir/ghc\" ${1+\"$@\"}\
-- | --interactive flag.
ghciScriptWrapper :: Action String
ghciScriptWrapper = pure $ unlines
- [ "DIR=`dirname \"$0\"`"
- , "executable=\"$DIR/ghc\""
+ [ "executable=\"$bindir/ghc\""
, "exec $executable --interactive \"$@\"" ]
-- | When not on Windows, we want to ship the 3 flavours of the iserv program