From 60b02896e406c36591520eac2018ea1ba0c770ce Mon Sep 17 00:00:00 2001 From: ARATA Mizuki Date: Mon, 1 Nov 2021 13:27:39 +0900 Subject: 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) --- hadrian/src/Rules/BinaryDist.hs | 3 +-- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.1