Note that there are some explanatory texts on larger screens.

plurals
  1. POOverride -Werror when installing from Cabal
    text
    copied!<p>I'm trying to install the <a href="http://hackage.haskell.org/package/nano-hmac-0.2.0" rel="noreferrer">nano-hmac-0.2.0</a> package (a dependency of a package I want) from Hackage using Cabal and GHC 6.12.1, but it fails with the following error:</p> <pre><code>Data/Digest/OpenSSL/HMAC.hsc:1:0: Warning: Module `Prelude' is deprecated: You are using the old package `base' version 3.x. Future GHC versions will not support base version 3.x. You should update your code to use the new base version 4.x. &lt;no location info&gt;: Failing due to -Werror. </code></pre> <p>Sure enough, the package's .cabal file has the following line in it:</p> <pre><code> ghc-options: -Wall -Werror -O2 -fvia-C </code></pre> <p>I'd like to be able to override the <code>-Werror</code> option so I can install the package without manually modifying the .cabal file, but can't find a way that will work. In particular, I tried passing <code>--ghc-options</code> to Cabal to stick a <code>-Wwarn</code> in GHC's argument list, like this:</p> <pre><code>$ cabal install nano-hmac-0.2.0 -v2 --ghc-options='-Wwarn' </code></pre> <p>This doesn't do what I want, though; the verbose output verifies that <code>-Wwarn</code> is getting added to the beginning of GHC's argument list, but the <code>-Werror</code> from the .cabal file appears later and seems to override it:</p> <pre><code>/usr/bin/ghc -Wwarn --make -package-name nano-hmac-0.2.0 -hide-all-packages -fbuilding-cabal-package -i -idist/build -i. -idist/build/autogen -Idist/build/autogen -Idist/build -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build -hidir dist/build -stubdir dist/build -package-id base-3.0.3.2-0092f5a086872e0cdaf979254933cd43 -package-id bytestring-0.9.1.5-125aff5b9d19ec30231ae2684b8c8577 -O -Wall -Werror -O2 -fvia-C -XForeignFunctionInterface -XBangPatterns -XCPP Data.Digest.OpenSSL.HMAC </code></pre> <p>I also tried passing <code>--constraint='base &gt;= 4'</code> to Cabal to force it to use a more recent version of base and avoid the warning entirely, but I get the same failure, and I still see the following in the verbose output:</p> <pre><code>Dependency base ==3.0.3.2: using base-3.0.3.2 </code></pre> <p>Is there a way to get rid of or override the <code>-Werror</code> coming from the .cabal file via the Cabal command line, or am I stuck modifying the .cabal file myself?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload