summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-02-20 18:58:03 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-20 21:56:23 -0500
commite2cce997320652031e0c6cc62db5e35deff43a79 (patch)
treebaaa36f4d08d18c6595027db60c371a8adf49178 /hadrian
parent3cea67955a5ae7d3de7aa9dcfdabaf6ee3681ffc (diff)
downloadhaskell-e2cce997320652031e0c6cc62db5e35deff43a79.tar.gz
Hadrian: fix source-dist target (#17849)
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/src/Rules/SourceDist.hs32
1 files changed, 11 insertions, 21 deletions
diff --git a/hadrian/src/Rules/SourceDist.hs b/hadrian/src/Rules/SourceDist.hs
index b6b41f1677..b844c54c8a 100644
--- a/hadrian/src/Rules/SourceDist.hs
+++ b/hadrian/src/Rules/SourceDist.hs
@@ -43,15 +43,15 @@ prepareTree dest = do
where
copyAlexHappyFiles root =
- forM_ alexHappyFiles $ \(stg, pkg, inp, srcDir, out) -> do
+ forM_ alexHappyFiles $ \(stg, pkg, inp, out) -> do
let dir = root -/- buildDir (Context stg pkg vanilla)
- srcInputFile = dest -/- pkgPath pkg -/- maybe id (-/-) srcDir inp
+ srcInputFile = dest -/- pkgPath pkg -/- inp
-- We first make sure that the generated file is... generated.
need [ dir -/- out ]
-- We then copy the generated file in the source dist, right
-- next to the input file.
copyFile (dir -/- out)
- (dest -/- pkgPath pkg -/- maybe id (-/-) srcDir out)
+ (dest -/- pkgPath pkg -/- out)
-- We finally add a ".source" suffix to the input file to
-- prevent it from being used when building GHC, since the
-- generated file being there already should prevent
@@ -134,23 +134,13 @@ prepareTree dest = do
, "llvm-passes"
]
- -- (stage, package, input file, dir, output file)
- --
- -- where "dir" is the subdirectory of the package's directory
- -- where the input file resides and where we're supposed to
- -- put the output file, in the source distribution.
- --
- -- This list was taken from ghc.mk. The treatment of those
- -- alex/happy files is exactly the one implemented in ghc.mk,
- -- where Make ends up calling 'sdist-ghc-file' on all those
- -- files, which implements exactly the logic that we
- -- have for 'alexHappyFiles' above.
+ -- (stage, package, input file, output file)
alexHappyFiles =
- [ (Stage0, compiler, "Parser.y", Just ("GHC" -/- "Cmm"), "Parser.hs")
- , (Stage0, compiler, "Lexer.x", Just ("GHC" -/- "Cmm"), "Lexer.hs")
- , (Stage0, compiler, "Parser.y", Just "parser", "Parser.hs")
- , (Stage0, compiler, "Lexer.x", Just "parser", "Lexer.hs")
- , (Stage0, hpcBin, "HpcParser.y", Nothing, "HpcParser.hs")
- , (Stage0, genprimopcode, "Parser.y", Nothing, "Parser.hs")
- , (Stage0, genprimopcode, "Lexer.x", Nothing, "Lexer.hs")
+ [ (Stage0, compiler, "GHC/Cmm/Parser.y", "GHC/Cmm/Parser.hs")
+ , (Stage0, compiler, "GHC/Cmm/Lexer.x", "GHC/Cmm/Lexer.hs")
+ , (Stage0, compiler, "parser/Parser.y", "Parser.hs")
+ , (Stage0, compiler, "parser/Lexer.x", "Lexer.hs")
+ , (Stage0, hpcBin, "HpcParser.y", "HpcParser.hs")
+ , (Stage0, genprimopcode, "Parser.y", "Parser.hs")
+ , (Stage0, genprimopcode, "Lexer.x", "Lexer.hs")
]