From a1f35d7b9942a49ce36d2c5ec5f34d90070452a8 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Thu, 21 Apr 2016 20:23:02 -0700 Subject: [PATCH] Fix when --exact-configuration is used #1579 --- src/Stack/Types/Build.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Stack/Types/Build.hs b/src/Stack/Types/Build.hs index f0e4d8dc83..286d02a699 100644 --- a/src/Stack/Types/Build.hs +++ b/src/Stack/Types/Build.hs @@ -584,6 +584,7 @@ isStackOpt t = any (`T.isPrefixOf` t) , "--enable-benchmarks" , "--enable-library-profiling" , "--enable-executable-profiling" + , "--exact-configuration" ] || elem t [ "--user" ] @@ -656,7 +657,9 @@ configureOptsNoDir econfig bco deps wanted isLocal package = concat -- TODO: instead always enable this when the cabal version is new -- enough. That way we'll detect bugs with --exact-configuration -- earlier. Cabal also might do less work then. - useExactConf = envConfigCabalVersion econfig >= $(mkVersion "1.22") + useExactConf = configAllowNewer config + + newerCabal = envConfigCabalVersion econfig >= $(mkVersion "1.22") -- Unioning atop defaults is needed so that all flags are specified -- with --exact-configuration. @@ -665,7 +668,7 @@ configureOptsNoDir econfig bco deps wanted isLocal package = concat depOptions = map (uncurry toDepOption) $ Map.toList deps where - toDepOption = if useExactConf then toDepOption1_22 else toDepOption1_18 + toDepOption = if newerCabal then toDepOption1_22 else toDepOption1_18 toDepOption1_22 ident gid = concat [ "--dependency="