diff options
Diffstat (limited to 'hadrian/src/Rules/BinaryDist.hs')
-rw-r--r-- | hadrian/src/Rules/BinaryDist.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs index 8a03064ffd..743547917c 100644 --- a/hadrian/src/Rules/BinaryDist.hs +++ b/hadrian/src/Rules/BinaryDist.hs @@ -192,6 +192,7 @@ bindistRules = do copyDirectory (ghcBuildDir -/- "lib") bindistFilesDir copyDirectory (rtsIncludeDir) bindistFilesDir + when windowsHost $ createGhcii (bindistFilesDir -/- "bin") -- The settings file must be regenerated by the bindist installation -- logic to account for the environment discovered by the bindist @@ -467,3 +468,17 @@ but on linux these wrappers are symlinks. -} +-- | On Windows ghci must be invoked via this wrapper script due to signal craziness. +-- When WinIO becomes the default it can be removed. See #19339 and #12720. +createGhcii :: FilePath -> Action () +createGhcii outDir = do + version <- setting ProjectVersion + create (outDir -/- "ghcii.sh") + create (outDir -/- "ghcii"++version++".sh") + where + create out = writeFileChanged out content >> makeExecutable out + content = unlines + [ "#!/bin/sh" + , "exec \"$(dirname \"$0\")\"/ghc --interactive \"$@\"" + ] + |