diff options
author | ARATA Mizuki <minorinoki@gmail.com> | 2021-11-01 13:27:39 +0900 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2021-12-16 16:21:09 +0530 |
commit | 60b02896e406c36591520eac2018ea1ba0c770ce (patch) | |
tree | fa550aeaab5e38fda0d9928ae558d8c09744bd03 | |
parent | cf37552894879524c023f5f2a460ee6bc130322d (diff) | |
download | haskell-60b02896e406c36591520eac2018ea1ba0c770ce.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
(cherry picked from commit 9f42a6dcebf12a8c3e7c18d8291c0fa95e3c4d86)
-rw-r--r-- | hadrian/src/Rules/BinaryDist.hs | 3 |
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 |