Fix unlit by placing it under lib/bin/ instead of bin/ (#591)
authorAlp Mestanogullari <alpmestan@gmail.com>
Thu, 10 May 2018 22:29:34 +0000 (00:29 +0200)
committerAndrey Mokhov <andrey.mokhov@gmail.com>
Thu, 10 May 2018 22:29:34 +0000 (00:29 +0200)
A nicer fix would involve patching GHC to not just look under
$libexec/ but also under the directory where the GHC binary itself lives
(bin/ for hadrian), so that we can leave all binaries under bin/.

Addresses Trac #15132.

src/GHC.hs

index 0262823..5c690dd 100644 (file)
@@ -131,8 +131,10 @@ programPath context@Context {..} = do
     -- The @touchy@ utility lives in the @lib/bin@ directory instead of @bin@,
     -- which is likely just a historical accident that will hopefully be fixed.
     -- See: https://github.com/snowleopard/hadrian/issues/570
-    path <- if package /= touchy then stageBinPath stage
-                                 else stageLibPath stage <&> (-/- "bin")
+    -- Likewise for 'unlit'.
+    path <- if package `elem` [touchy, unlit]
+      then stageLibPath stage <&> (-/- "bin")
+      else stageBinPath stage
     pgm  <- programName context
     return $ path -/- pgm <.> exe