Skip to content
Snippets Groups Projects
Commit 65b4b92f authored by Cheng Shao's avatar Cheng Shao Committed by Marge Bot
Browse files

hadrian: remove obsolete Patch logic

This commit removes obsolete Patch logic from hadrian, given we no
longer need to patch the gmp tarball when building in-tree GMP.
parent 6399d52b
No related branches found
No related tags found
No related merge requests found
...@@ -8,10 +8,7 @@ module Builder ( ...@@ -8,10 +8,7 @@ module Builder (
-- * Builder properties -- * Builder properties
builderProvenance, systemBuilderPath, builderPath, isSpecified, needBuilders, builderProvenance, systemBuilderPath, builderPath, isSpecified, needBuilders,
runBuilder, runBuilderWith, runBuilderWithCmdOptions, getBuilderPath, runBuilder, runBuilderWith, runBuilderWithCmdOptions, getBuilderPath,
builderEnvironment, builderEnvironment
-- * Ad hoc builder invocation
applyPatch
) where ) where
import Control.Exception.Extra (Partial) import Control.Exception.Extra (Partial)
...@@ -184,7 +181,6 @@ data Builder = Alex ...@@ -184,7 +181,6 @@ data Builder = Alex
| MergeObjects Stage -- ^ linker to be used to merge object files. | MergeObjects Stage -- ^ linker to be used to merge object files.
| Nm | Nm
| Objdump | Objdump
| Patch
| Python | Python
| Ranlib | Ranlib
| Testsuite TestMode | Testsuite TestMode
...@@ -443,7 +439,6 @@ systemBuilderPath builder = case builder of ...@@ -443,7 +439,6 @@ systemBuilderPath builder = case builder of
Makeinfo -> fromKey "makeinfo" Makeinfo -> fromKey "makeinfo"
Nm -> fromTargetTC "nm" (Toolchain.nmProgram . tgtNm) Nm -> fromTargetTC "nm" (Toolchain.nmProgram . tgtNm)
Objdump -> fromKey "objdump" Objdump -> fromKey "objdump"
Patch -> fromKey "patch"
Python -> fromKey "python" Python -> fromKey "python"
Ranlib -> fromTargetTC "ranlib" (maybeProg Toolchain.ranlibProgram . tgtRanlib) Ranlib -> fromTargetTC "ranlib" (maybeProg Toolchain.ranlibProgram . tgtRanlib)
Testsuite _ -> fromKey "python" Testsuite _ -> fromKey "python"
...@@ -511,15 +506,6 @@ systemBuilderPath builder = case builder of ...@@ -511,15 +506,6 @@ systemBuilderPath builder = case builder of
isSpecified :: Builder -> Action Bool isSpecified :: Builder -> Action Bool
isSpecified = fmap (not . null) . systemBuilderPath isSpecified = fmap (not . null) . systemBuilderPath
-- | Apply a patch by executing the 'Patch' builder in a given directory.
applyPatch :: FilePath -> FilePath -> Action ()
applyPatch dir patch = do
let file = dir -/- patch
needBuilders [Patch]
path <- builderPath Patch
putBuild $ "| Apply patch " ++ file
quietly $ cmd' [Cwd dir, FileStdin file] [path, "-p0"]
-- Note [cmd wrapper] -- Note [cmd wrapper]
-- ~~~~~~~~~~~~~~~~~~ -- ~~~~~~~~~~~~~~~~~~
-- `cmd'` is a wrapper for Shake's `cmd` that allows us to customize what is -- `cmd'` is a wrapper for Shake's `cmd` that allows us to customize what is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment