Commit a06460c3 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Add configArgs parameter to ConfigFlags.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent e08a1ea8
......@@ -187,7 +187,8 @@ allSuffixHandlers hooks
configureAction :: UserHooks -> ConfigFlags -> Args -> IO LocalBuildInfo
configureAction hooks flags args = do
distPref <- findDistPrefOrDefault (configDistPref flags)
let flags' = flags { configDistPref = toFlag distPref }
let flags' = flags { configDistPref = toFlag distPref
, configArgs = args }
-- See docs for 'HookedBuildInfo'
pbi <- preConf hooks args flags'
......
......@@ -347,6 +347,10 @@ relaxDepsPrinter (Just (RelaxDepsSome pkgs)) = map (Just . display) $ pkgs
-- IMPORTANT: every time a new flag is added, 'D.C.Setup.filterConfigureFlags'
-- should be updated.
data ConfigFlags = ConfigFlags {
-- This is the same hack as in 'buildArgs' and 'copyArgs'.
-- TODO: Stop using this eventually when 'UserHooks' gets changed
configArgs :: [String],
--FIXME: the configPrograms is only here to pass info through to configure
-- because the type of configure is constrained by the UserHooks.
-- when we change UserHooks next we should pass the initial
......@@ -435,6 +439,7 @@ configAbsolutePaths f =
defaultConfigFlags :: ProgramConfiguration -> ConfigFlags
defaultConfigFlags progConf = emptyConfigFlags {
configArgs = [],
configPrograms_ = pure progConf,
configHcFlavor = maybe NoFlag Flag defaultCompilerFlavor,
configVanillaLib = Flag True,
......@@ -875,6 +880,7 @@ data CopyFlags = CopyFlags {
copyAssumeDepsUpToDate :: Flag Bool,
-- This is the same hack as in 'buildArgs'. But I (ezyang) don't
-- think it's a hack, it's the right way to make hooks more robust
-- TODO: Stop using this eventually when 'UserHooks' gets changed
copyArgs :: [String]
}
deriving (Show, Generic)
......
......@@ -266,6 +266,7 @@ instance Semigroup SavedConfig where
lastNonEmptyNL = lastNonEmptyNL' savedInstallFlags
combinedSavedConfigureFlags = ConfigFlags {
configArgs = lastNonEmpty configArgs,
configPrograms_ = configPrograms_ . savedConfigureFlags $ b,
-- TODO: NubListify
configProgramPaths = lastNonEmpty configProgramPaths,
......
......@@ -532,6 +532,7 @@ convertToLegacyAllPackageConfig
}
where
configFlags = ConfigFlags {
configArgs = mempty,
configPrograms_ = mempty,
configProgramPaths = mempty,
configProgramArgs = mempty,
......@@ -595,6 +596,7 @@ convertToLegacyPerPackageConfig PackageConfig {..} =
}
where
configFlags = ConfigFlags {
configArgs = mempty,
configPrograms_ = configPrograms_ mempty,
configProgramPaths = Map.toList (getMapLast packageConfigProgramPaths),
configProgramArgs = Map.toList (getMapMappend packageConfigProgramArgs),
......
......@@ -1935,6 +1935,7 @@ setupHsConfigureFlags (ReadyPackage
sanityCheckElaboratedConfiguredPackage sharedConfig pkg
(Cabal.ConfigFlags {..})
where
configArgs = []
configDistPref = toFlag builddir
configCabalFilePath = mempty
configVerbosity = toFlag verbosity
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment