summaryrefslogtreecommitdiff
path: root/hadrian/src/Packages.hs
diff options
context:
space:
mode:
authorAlp Mestanogullari <alp@well-typed.com>2018-11-01 18:31:46 -0400
committerBen Gamari <ben@smart-cactus.org>2018-11-01 18:36:08 -0400
commit695f1f2fe03d71bad47d52f003881b34eb5083b4 (patch)
tree7259dc9204959d1eb68e6742e5468b0d5dc3fd2d /hadrian/src/Packages.hs
parentfcd919f991452cc0d42805fca6e549c2efeb0dde (diff)
downloadhaskell-695f1f2fe03d71bad47d52f003881b34eb5083b4.tar.gz
hadrian: build ghc-iserv-prof in addition to ghc-iserv
As it is required for 10+ tests. Hadrian didn't give us a chance to build a given executable in vanilla and profiling, simultaneously, under two different names. This patch implements support for this in general and applies it to ghc-iserv[-prof]. Test Plan: scc001 fails without this patch, passes with it. Reviewers: snowleopard, bgamari Reviewed By: bgamari Subscribers: simonpj, ndmitchell, simonmar, rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5255
Diffstat (limited to 'hadrian/src/Packages.hs')
-rw-r--r--hadrian/src/Packages.hs16
1 files changed, 12 insertions, 4 deletions
diff --git a/hadrian/src/Packages.hs b/hadrian/src/Packages.hs
index 8a9a48faf5..4ce1a2cfb0 100644
--- a/hadrian/src/Packages.hs
+++ b/hadrian/src/Packages.hs
@@ -132,10 +132,17 @@ programName Context {..} = do
targetPlatform <- setting TargetPlatformFull
let prefix = if cross then targetPlatform ++ "-" else ""
-- TODO: Can we extract this information from Cabal files?
+ -- Alp: We could, but then the iserv package would have to
+ -- use Cabal conditionals + a 'profiling' flag
+ -- to declare the executable name, and I'm not sure
+ -- this is allowed (or desired for that matter).
return $ prefix ++ case package of
p | p == ghc -> "ghc"
| p == hpcBin -> "hpc"
- | p == iserv -> "ghc-iserv"
+ | p == iserv ->
+ if Profiling `wayUnit` way
+ then "ghc-iserv-prof"
+ else "ghc-iserv"
_ -> pkgName package
-- | The 'FilePath' to a program executable in a given 'Context'.
@@ -144,10 +151,11 @@ programPath context@Context {..} = do
-- TODO: The @touchy@ utility lives in the @lib/bin@ directory instead of
-- @bin@, which is likely just a historical accident that should be fixed.
-- See: https://github.com/snowleopard/hadrian/issues/570
- -- Likewise for 'unlit'.
+ -- Likewise for @iserv@ and @unlit@.
name <- programName context
- path <- if package `elem` [touchy, unlit] then stageLibPath stage <&> (-/- "bin")
- else stageBinPath stage
+ path <- if package `elem` [iserv, touchy, unlit]
+ then stageLibPath stage <&> (-/- "bin")
+ else stageBinPath stage
return $ path -/- name <.> exe
-- TODO: Move @timeout@ to the @util@ directory and build in a more standard