Commit 701b5ba7 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Don't pass '--{en,dis}able-profiling' to old setup exes.

Fixes #2409.
parent b3017e2f
......@@ -458,7 +458,18 @@ configureOptions showOrParseArgs =
,option "" ["profiling"]
"Executable profiling (requires library profiling)"
configProfExe (\v flags -> flags { configProfLib = v, configProfExe = v })
-- HACK: See #2409. Thankfully, this is 1.22-specific.
(\flags ->
case (configProfLib flags, configProfExe flags) of
(Flag a, Flag b)
| (a == b)
&& ("cabalConfProf", "/TRUE") `elem` configProgramPaths flags
-> configProfExe flags
_ -> NoFlag)
(\v flags -> flags
{ configProfLib = v, configProfExe = v
, configProgramPaths = ("cabalConfProf", "/TRUE")
: configProgramPaths flags })
(boolOpt [] [])
,option "" ["executable-profiling"]
......
......@@ -93,7 +93,7 @@ import Distribution.Simple.Utils
import Data.Char
( isSpace, isAlphaNum )
import Data.List
( intercalate, deleteFirstsBy )
( intercalate, delete, deleteFirstsBy )
import Data.Maybe
( listToMaybe, maybeToList, fromMaybe )
#if !MIN_VERSION_base(4,8,0)
......@@ -392,6 +392,9 @@ filterConfigureFlags flags cabalLibVersion
, configProfLib = configProfLib flags
, configCoverage = NoFlag
, configLibCoverage = configCoverage flags
-- HACK: See #2409.
, configProgramPaths =
("cabalConfProf", "/TRUE") `delete` configProgramPaths flags
}
-- Cabal < 1.19.2 doesn't know about '--exact-configuration'.
flags_1_19_1 = flags_1_20_0 { configExactConfiguration = NoFlag }
......
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