summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-07-28 16:37:33 -0400
committerBen Gamari <ben@smart-cactus.org>2021-07-28 16:58:17 -0400
commit201d3a5303057b025c245bc02f0126faaf0eef1e (patch)
tree086cda66fd52badbe6a18531d8796ce42c9a29e5
parent10678945c1d3261273a1d7a389d14a69f4e28567 (diff)
downloadhaskell-wip/kill-hadrian-configure.tar.gz
hadrian: Drop --configure supportwip/kill-hadrian-configure
Hadrian's `--configure` support has long been a point of contention. While it's convenient, it also introduces a fair bit of implementation complexity and quite a few non-trivial failure modes (see #19804, 17883, and #15948). Moreover, the feature is actively misleading to the user: `./configure` is the primary means for the user to inform the build system about the system environment and in general will require input from the user. This commits removes the feature, replacing the flag with a stub message informing the user of the deprecation. Closes #20167.
-rw-r--r--hadrian/hadrian.cabal1
-rw-r--r--hadrian/src/CommandLine.hs9
-rw-r--r--hadrian/src/Rules.hs2
-rw-r--r--hadrian/src/Rules/Configure.hs84
4 files changed, 3 insertions, 93 deletions
diff --git a/hadrian/hadrian.cabal b/hadrian/hadrian.cabal
index 783de96934..173fc84459 100644
--- a/hadrian/hadrian.cabal
+++ b/hadrian/hadrian.cabal
@@ -67,7 +67,6 @@ executable hadrian
, Rules.BinaryDist
, Rules.Clean
, Rules.Compile
- , Rules.Configure
, Rules.Dependencies
, Rules.Docspec
, Rules.Documentation
diff --git a/hadrian/src/CommandLine.hs b/hadrian/src/CommandLine.hs
index c08eb6a2f4..2c5b90c499 100644
--- a/hadrian/src/CommandLine.hs
+++ b/hadrian/src/CommandLine.hs
@@ -1,6 +1,6 @@
module CommandLine (
optDescrs, cmdLineArgsMap, cmdFlavour, lookupFreeze1, lookupFreeze2, lookupSkipDepends,
- cmdBignum, cmdBignumCheck, cmdProgressInfo, cmdConfigure, cmdCompleteSetting,
+ cmdBignum, cmdBignumCheck, cmdProgressInfo, cmdCompleteSetting,
cmdDocsArgs, lookupBuildRoot, TestArgs(..), TestSpeed(..), defaultTestArgs,
cmdPrefix
) where
@@ -95,7 +95,7 @@ defaultTestArgs = TestArgs
, testAccept = False }
readConfigure :: Either String (CommandLineArgs -> CommandLineArgs)
-readConfigure = Right $ \flags -> flags { configure = True }
+readConfigure = Left "hadrian --configure has been deprecated (see #20167). Please run ./boot; ./configure manually"
readFlavour :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs)
readFlavour ms = Right $ \flags -> flags { flavour = lower <$> ms }
@@ -250,7 +250,7 @@ readDocsArg ms = maybe (Left "Cannot parse docs argument") (Right . set) (go =<<
optDescrs :: [OptDescr (Either String (CommandLineArgs -> CommandLineArgs))]
optDescrs =
[ Option ['c'] ["configure"] (NoArg readConfigure)
- "Run the boot and configure scripts (if you do not want to run them manually)."
+ "Deprecated: Run the boot and configure scripts."
, Option ['o'] ["build-root"] (OptArg readBuildRoot "BUILD_ROOT")
"Where to store build artifacts. (Default _build)."
, Option [] ["flavour"] (OptArg readFlavour "FLAVOUR")
@@ -345,9 +345,6 @@ cmdLineArgsMap = do
cmdLineArgs :: Action CommandLineArgs
cmdLineArgs = userSetting defaultCommandLineArgs
-cmdConfigure :: Action Bool
-cmdConfigure = configure <$> cmdLineArgs
-
cmdFlavour :: Action (Maybe String)
cmdFlavour = flavour <$> cmdLineArgs
diff --git a/hadrian/src/Rules.hs b/hadrian/src/Rules.hs
index e06a99136d..99cf293c99 100644
--- a/hadrian/src/Rules.hs
+++ b/hadrian/src/Rules.hs
@@ -13,7 +13,6 @@ import qualified Oracles.ModuleFiles
import Packages
import qualified Rules.BinaryDist
import qualified Rules.Compile
-import qualified Rules.Configure
import qualified Rules.Dependencies
import qualified Rules.Documentation
import qualified Rules.Generate
@@ -130,7 +129,6 @@ packageRules = do
buildRules :: Rules ()
buildRules = do
Rules.BinaryDist.bindistRules
- Rules.Configure.configureRules
Rules.Generate.copyRules
Rules.Generate.generateRules
Rules.Gmp.gmpRules
diff --git a/hadrian/src/Rules/Configure.hs b/hadrian/src/Rules/Configure.hs
deleted file mode 100644
index 6787bacf04..0000000000
--- a/hadrian/src/Rules/Configure.hs
+++ /dev/null
@@ -1,84 +0,0 @@
-module Rules.Configure (configureRules) where
-
-import Base
-import Builder
-import CommandLine
-import Context
-import Packages
-import Target
-import Utilities
-
-import qualified System.Info.Extra as System
-
--- | Files generated by running the @configure@ script.
-configureResults :: [FilePath]
-configureResults =
- [ configFile
- , configH
- , "compiler/ghc.cabal"
- , "rts/rts.cabal"
- , "ghc/ghc-bin.cabal"
- , "utils/iserv/iserv.cabal"
- , "utils/iserv-proxy/iserv-proxy.cabal"
- , "utils/remote-iserv/remote-iserv.cabal"
- , "utils/ghc-pkg/ghc-pkg.cabal"
- , "utils/runghc/runghc.cabal"
- , "utils/gen-dll/gen-dll.cabal"
- , "libraries/ghc-boot/ghc-boot.cabal"
- , "libraries/ghc-boot-th/ghc-boot-th.cabal"
- , "libraries/ghci/ghci.cabal"
- , "libraries/ghc-heap/ghc-heap.cabal"
- , "libraries/libiserv/libiserv.cabal"
- , "libraries/template-haskell/template-haskell.cabal"
- , "docs/users_guide/ghc_config.py"
- , "docs/index.html"
- , "libraries/prologue.txt"
- , "distrib/configure.ac"
- ]
-
-configureRules :: Rules ()
-configureRules = do
- configureResults &%> \outs -> do
- -- Do not cache the results. The true dependencies of the configure
- -- script are not tracked. This includes e.g. the ghc source path.
- historyDisable
-
- skip <- not <$> cmdConfigure
- if skip
- then unlessM (doesFileExist configFile) $
- error $ "Configuration file " ++ configFile ++ " is missing.\n"
- ++ "Run the configure script manually or let Hadrian run it "
- ++ "automatically by passing the flag --configure."
- else do
- -- We cannot use windowsHost here due to a cyclic dependency.
- when windowsHost $ do
- putBuild "| Checking for Windows tarballs..."
- pythonPath <- builderPath Python
- quietly $ cmd [pythonPath, "mk/get-win32-tarballs.py", "download", System.arch]
- let srcs = map (<.> "in") outs
- context = vanillaContext Stage0 compiler
- need srcs
- build $ target context (Configure ".") srcs outs
- -- TODO: This is fragile: we should remove this from behind the
- -- @--configure@ flag and add a proper dependency tracking.
- -- We need to copy the directory with unpacked Windows tarball to
- -- the build directory, so that the built GHC has access to it.
- -- See https://github.com/snowleopard/hadrian/issues/564.
- when windowsHost $ do
- root <- buildRoot
- copyDirectory "inplace/mingw" (root -/- "mingw")
- mingwFiles <- liftIO $ getDirectoryFilesIO "." [root -/- "mingw/**"]
- produces mingwFiles
-
- ["configure", configH <.> "in"] &%> \_ -> do
- skip <- not <$> cmdConfigure
- if skip
- then unlessM (doesFileExist "configure") $
- error $ "The configure script is missing.\nRun the boot script "
- ++ "manually let Hadrian run it automatically by passing the "
- ++ "flag --configure."
- else do
- need ["configure.ac"]
- putBuild "| Running boot..."
- verbosity <- getVerbosity
- quietly $ cmd [EchoStdout (verbosity >= Loud)] "python3 boot --hadrian"