Skip to content

Custom ghc-options lost when calling cabal build in sandbox #2236

Closed
@snoyberg

Description

@snoyberg

Actions:

  1. Set up a project that has a warning in it when compiled with -Wall (I took acme-missiles and removed a type signature).
  2. cabal sandbox init.
  3. cabal install --ghc-options="-Wall -Werror"
  4. As expected, above fails due to warning
  5. cabal build

Expected: fails again

Actual: Get the surprising output:

$ cabal build
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Resolving dependencies...
Configuring acme-missiles-0.3...
Building acme-missiles-0.3...
Preprocessing library acme-missiles-0.3...
[1 of 2] Compiling Acme.Missiles    ( Acme/Missiles.hs, dist/build/Acme/Missiles.o )

Acme/Missiles.hs:17:1: Warning:
    Top-level binding with no type signature: launchMissiles :: IO ()
[2 of 2] Compiling Acme.Missiles.STM ( Acme/Missiles/STM.hs, dist/build/Acme/Missiles/STM.o )
In-place registering acme-missiles-0.3...

Note that during testing, I switched between a cabal-install compiled with Cabal-1.20.0.0 and Cabal-1.20.0.2, and got the error message:

cabal: You need to re-run the 'configure' command. The version of Cabal being
used has changed (was Cabal-1.20.0.0, now Cabal-1.20.0.2). Additionally the
compiler is different (was ghc-7.4, now ghc-7.8) which is probably the cause
of the problem.
ubuntu@picard-precise:~/Desktop/acme-missiles-0.3$ cabal --version
cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions