Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't pass unsupported flags to setups built with old Cabal versions. #1133

Merged
merged 1 commit into from

2 participants

@23Skidoo
Collaborator

We must not pass --disable-benchmarks to setup scripts built with Cabal < 1.14; the same is also true for --disable-tests and Cabal < 1.10.

Fixes #932 and #1004.

Without this patch:

$ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
[...]
unrecognized option `--disable-benchmarks'
Failed to install syb-0.3.7

With this patch:

$ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
[...]
Registering syb-0.3.7...
Installed syb-0.3.7
@23Skidoo 23Skidoo Don't pass unsupported flags to setups built with old Cabal versions.
We must not pass '--disable-benchmarks' to setup scripts built with Cabal <
1.14; the same is also true for '--disable-tests' and Cabal < 1.10.

Fixes #932 and #1004.

Without this patch:

    $ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
    [...]
    unrecognized option `--disable-benchmarks'
    Failed to install syb-0.3.7

With this patch:

    $ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
    [...]
    Registering syb-0.3.7...
    Installed syb-0.3.7
582d12e
@tibbe tibbe merged commit 582d12e into haskell:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 26, 2012
  1. @23Skidoo

    Don't pass unsupported flags to setups built with old Cabal versions.

    23Skidoo authored
    We must not pass '--disable-benchmarks' to setup scripts built with Cabal <
    1.14; the same is also true for '--disable-tests' and Cabal < 1.10.
    
    Fixes #932 and #1004.
    
    Without this patch:
    
        $ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
        [...]
        unrecognized option `--disable-benchmarks'
        Failed to install syb-0.3.7
    
    With this patch:
    
        $ cabal install -w /path/to/ghc-7.2.1/bin/ghc syb
        [...]
        Registering syb-0.3.7...
        Installed syb-0.3.7
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 3 deletions.
  1. +14 −3 cabal-install/Distribution/Client/Setup.hs
View
17 cabal-install/Distribution/Client/Setup.hs
@@ -230,9 +230,20 @@ configureOptions = commandOptions configureCommand
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags flags cabalLibVersion
- | cabalLibVersion >= Version [1,3,10] [] = flags
- -- older Cabal does not grok the constraints flag:
- | otherwise = flags { configConstraints = [] }
+ | cabalLibVersion >= Version [1,14,0] [] = flags
+ | cabalLibVersion < Version [1,3,10] [] = flags_1_3_10
+ | cabalLibVersion < Version [1,10,0] [] = flags_1_10_0
+ | cabalLibVersion < Version [1,14,0] [] = flags_1_14_0
+
+ -- A no-op that silences the "pattern match is non-exhaustive" warning.
+ | otherwise = flags
+ where
+ -- Cabal < 1.14.0 doesn't know about --disable-benchmarks.
+ flags_1_14_0 = flags { configBenchmarks = NoFlag }
+ -- Cabal < 1.10.0 doesn't know about --disable-tests.
+ flags_1_10_0 = flags_1_14_0 { configTests = NoFlag }
+ -- Cabal < 1.3.10 does not grok the constraints flag.
+ flags_1_3_10 = flags_1_10_0 { configConstraints = [] }
-- ------------------------------------------------------------
-- * Config extra flags
Something went wrong with that request. Please try again.