Rename --ar-does-not-support-response-files argument to --disable-response-files

Also rename config field configArDoesNotSupportResponseFiles into
configUseResponseFiles
parent ac0bd04f
......@@ -34,7 +34,7 @@ import Distribution.Simple.Program.Run
( programInvocation, multiStageProgramInvocation
, runProgramInvocation )
import Distribution.Simple.Setup
( fromFlagOrDefault, configArDoesNotSupportResponseFiles )
( fromFlagOrDefault, configUseResponseFiles )
import Distribution.Simple.Utils
( defaultTempFileOptions, dieWithLocation', withTempDirectory )
import Distribution.System
......@@ -89,9 +89,7 @@ createArLibArchive verbosity lbi targetPath files = do
final = programInvocation ar (finalArgs ++ extraArgs)
oldVersionManualOverride =
fromFlagOrDefault False $
configArDoesNotSupportResponseFiles $
configFlags lbi
fromFlagOrDefault False $ configUseResponseFiles $ configFlags lbi
responseArgumentsNotSupported =
not (arResponseFilesSupported (compiler lbi))
......
......@@ -355,9 +355,9 @@ data ConfigFlags = ConfigFlags {
-- ^Halt and show an error message indicating an error in flag assignment
configRelocatable :: Flag Bool, -- ^ Enable relocatable package built
configDebugInfo :: Flag DebugInfoLevel, -- ^ Emit debug info.
configArDoesNotSupportResponseFiles :: Flag Bool
-- ^ Enable old code paths for old versions of 'ar' that don't
-- support @file arguments
configUseResponseFiles :: Flag Bool
-- ^ Whether to use response files at all. They're used for such tools
-- as haddock, or or ld.
}
deriving (Generic, Read, Show)
......@@ -414,7 +414,7 @@ instance Eq ConfigFlags where
&& equal configFlagError
&& equal configRelocatable
&& equal configDebugInfo
&& equal configArDoesNotSupportResponseFiles
&& equal configUseResponseFiles
where
equal f = on (==) f a b
......@@ -461,7 +461,7 @@ defaultConfigFlags progDb = emptyConfigFlags {
configFlagError = NoFlag,
configRelocatable = Flag False,
configDebugInfo = Flag NoDebugInfo,
configArDoesNotSupportResponseFiles = NoFlag
configUseResponseFiles = NoFlag
}
configureCommand :: ProgramDb -> CommandUI ConfigFlags
......@@ -754,11 +754,11 @@ configureOptions showOrParseArgs =
configRelocatable (\v flags -> flags { configRelocatable = v})
(boolOpt [] [])
,option "" ["ar-does-not-support-response-files"]
"enable workaround for old versions of \"ar\" that do not support @file arguments"
configArDoesNotSupportResponseFiles
(\v flags -> flags { configArDoesNotSupportResponseFiles = v })
(boolOpt' ([],["ar-does-not-support-response-files"]) ([], []))
,option "" ["response-files"]
"enable workaround for old versions of programs like \"ar\" that do not support @file arguments"
configUseResponseFiles
(\v flags -> flags { configUseResponseFiles = v })
(boolOpt' ([], ["disable-response-files"]) ([], []))
]
where
readFlagList :: String -> FlagAssignment
......
......@@ -1356,14 +1356,14 @@ Miscellaneous options
Specify a soft constraint on versions of a package. The solver will
attempt to satisfy these preferences on a "best-effort" basis.
.. option:: --ar-does-not-support-response-files
Enable workaround for older versions of ``ar`` program that do not
support response file arguments (i.e. ``@file`` arguments). You
may want this flag only if you specify custom ar executable. For
system ``ar`` or the one bundled with ``ghc`` on Windows the
``cabal`` should do the right thing and hence should normally not
require this flag.
.. option:: --disable-response-files
Enable workaround for older versions of programs such as ``ar`` or
``ld`` that do not support response file arguments (i.e. ``@file``
arguments). You may want this flag only if you specify custom ar
executable. For system ``ar`` or the one bundled with ``ghc`` on
Windows the ``cabal`` should do the right thing and hence should
normally not require this flag.
.. _setup-build:
......
......@@ -332,7 +332,7 @@ instance Semigroup SavedConfig where
configExactConfiguration = combine configExactConfiguration,
configFlagError = combine configFlagError,
configRelocatable = combine configRelocatable,
configArDoesNotSupportResponseFiles = combine configArDoesNotSupportResponseFiles
configUseResponseFiles = combine configUseResponseFiles
}
where
combine = combine' savedConfigureFlags
......
......@@ -593,7 +593,7 @@ convertToLegacyAllPackageConfig
configFlagError = mempty, --TODO: ???
configRelocatable = mempty,
configDebugInfo = mempty,
configArDoesNotSupportResponseFiles = mempty
configUseResponseFiles = mempty
}
haddockFlags = mempty {
......@@ -659,7 +659,7 @@ convertToLegacyPerPackageConfig PackageConfig {..} =
configFlagError = mempty, --TODO: ???
configRelocatable = packageConfigRelocatable,
configDebugInfo = packageConfigDebugInfo,
configArDoesNotSupportResponseFiles = mempty
configUseResponseFiles = mempty
}
installFlags = mempty {
......
......@@ -3070,7 +3070,7 @@ setupHsConfigureFlags (ReadyPackage elab@ElaboratedConfiguredPackage{..})
configScratchDir = mempty -- never use
configUserInstall = mempty -- don't rely on defaults
configPrograms_ = mempty -- never use, shouldn't exist
configArDoesNotSupportResponseFiles = mempty
configUseResponseFiles = mempty
setupHsConfigureArgs :: ElaboratedConfiguredPackage
-> [String]
......
......@@ -7,7 +7,7 @@ import Test.Cabal.CheckArMetadata
-- Test that setup determinstically generates object archives
main = setupAndCabalTest $ do
setup_build ["--ar-does-not-support-response-files"]
setup_build ["--disable-response-files"]
dist_dir <- fmap testDistDir getTestEnv
lbi <- getLocalBuildInfoM
liftIO $ checkMetadata lbi (dist_dir </> "build")
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