[Haskell-cafe] Building a Haskell project which depends on an old version of base
Rogan Creswick
creswick at gmail.com
Tue Feb 14 22:53:38 CET 2012
On Tue, Feb 14, 2012 at 12:14 PM, Steven J. Murdoch
<Steven.Murdoch at cl.cam.ac.uk> wrote:
> $ ghc-pkg list base
> /Users/ghc6/homebrew/Cellar/ghc/6.12.3/lib/ghc/package.conf.d
> base-3.0.3.2
> base-4.2.0.2
I'm a bit fuzzy on the details when it comes to the core packages that
are distributed with ghc, but my understanding is that the compiler is
/very/ needy about which base it can use. As far as I know, the only
way to change versions of Base is by changing the compiler to the
version that uses the desired base.
With that in mind, having two base libraries installed in the same
package database seems like a recipe for disaster.
Can you install the older ghc in a separate (fresh) location, and try
again with either a sandbox, or after moving your local package db
too?
If you're confident with ghc-pkg, you can probably fix up the existing
package databases, but it's not for the faint of heart. (although,
depending on which base came with ghc 6.12.3, that may not be fruitful
anyway.)
--Rogan
> /Users/ghc6/.ghc/i386-darwin-6.12.3/package.conf.d
>
> However, when I try to cabal build the package, I get the following error:
> $ cabal -v build
> Creating dist/build (and its parents)
> Creating dist/build/autogen (and its parents)
> Preprocessing executables for TorDNSEL-0.1.1...
> Building TorDNSEL-0.1.1...
> Building executable tordnsel...
> Creating dist/build/tordnsel (and its parents)
> Creating dist/build/tordnsel/tordnsel-tmp (and its parents)
> /Users/ghc6/homebrew/bin/ghc --make -o dist/build/tordnsel/tordnsel
> -hide-all-packages -fbuilding-cabal-package -package-conf
> dist/package.conf.inplace -i -idist/build/tordnsel/tordnsel-tmp -isrc
> -idist/build/autogen -Idist/build/autogen
> -Idist/build/tordnsel/tordnsel-tmp -optP-include
> -optPdist/build/autogen/cabal_macros.h -odir
> dist/build/tordnsel/tordnsel-tmp -hidir
> dist/build/tordnsel/tordnsel-tmp -stubdir
> dist/build/tordnsel/tordnsel-tmp -package-id
> HUnit-1.2.2.1-6237339c6ad5673d3cd8f82c4c7f6343 -package-id
> array-0.3.0.1-438000c197b51c147f229b54edbf632e -package-id
> base-3.0.3.2-260693a92016991a03206b5a55f6a411 -package-id
> binary-0.5.1.0-b72d4a82a5aecd9243ff0f50456b3d47 -package-id
> bytestring-0.9.1.7-64b858f95ff0dacc8acf396bb53cf4b9 -package-id
> containers-0.3.0.0-ee442470d8dcc9e45f31677c400c5379 -package-id
> directory-1.0.1.1-fa3418f21f42269537be694d5922dd6d -package-id
> mtl-1.1.0.2-336254fecf8a77054f76cb33671a5177 -package-id
> network-2.2.1.7-2eb3746f71ba30c3e4940b75df5ea8b8 -package-id
> stm-2.1.2.1-95639ea16e2e2cbf4accbabda98a1809 -package-id
> time-1.1.4-d9f7b7932dc3a4863006ed6b1d525856 -package-id
> unix-2.4.0.2-94ca14c8a73570f9d75aca642b4de0c6 -O -O2 -Wall
> -DVERSION="0.1.1-dev" src/tordnsel.hs -lcrypto
> [ 4 of 39] Compiling TorDNSEL.Util (
> dist/build/tordnsel/tordnsel-tmp/TorDNSEL/Util.hs,
> dist/build/tordnsel/tordnsel-tmp/TorDNSEL/Util.o )
>
> src/TorDNSEL/Util.hsc:143:23:
> Module `GHC.Handle' does not export `fillReadBuffer'
>
> src/TorDNSEL/Util.hsc:143:39:
> Module `GHC.Handle' does not export `readCharFromBuffer'
>
> src/TorDNSEL/Util.hsc:145:26:
> Module `GHC.IOBase' does not export `Buffer(..)'
>
> The flags to ghc indicate that base-3.0.3.2 is being requested, and
> the documentation for base-3.0.3.2 indicates that
> GHC.Handle.fillReadBuffer exists[2]. Can anyone explain why I am
> getting this error message? Could it be because Util is a .hsc rather
> than .hs file?
>
> In tordnsel.cabal I've made two changes: set Build-Depends to include
> "base>=2.0 && < 4" to tell ghc that I really want base-3 and removed
> -Werror from GHC-Options (to ignore the deprecation warnings).
> Otherwise it is as provided in this distribution[3].
>
> Building manually has the same result (though oddly I get a
> deprecation warning from building the .hs files but not the .hsc file,
> which led to my suspicion about hsc being an issue.
>
> $ hsc2hs TorDNSEL/Util.hsc
> $ ghc -package-id base-3.0.3.2-260693a92016991a03206b5a55f6a411 --make
> TorDNSEL/Util.hs
> [1 of 3] Compiling TorDNSEL.DeepSeq ( TorDNSEL/DeepSeq.hs, TorDNSEL/DeepSeq.o )
>
> TorDNSEL/DeepSeq.hs: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.
>
> TorDNSEL/Util.hs:1:11:
> Warning: -#include and INCLUDE pragmas are deprecated: They no
> longer have any effect
> [2 of 3] Compiling TorDNSEL.Compat.Exception (
> TorDNSEL/Compat/Exception.hs, TorDNSEL/Compat/Exception.o )
>
> TorDNSEL/Compat/Exception.hs: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.
> [3 of 3] Compiling TorDNSEL.Util ( TorDNSEL/Util.hs, TorDNSEL/Util.o )
>
> TorDNSEL/Util.hsc:143:23:
> Module `GHC.Handle' does not export `fillReadBuffer'
>
> TorDNSEL/Util.hsc:143:39:
> Module `GHC.Handle' does not export `readCharFromBuffer'
>
> TorDNSEL/Util.hsc:145:26:
> Module `GHC.IOBase' does not export `Buffer(..)'
>
> Thanks in advance,
> Steven.
>
> [1] https://gitweb.torproject.org/tordnsel.git
> [2] http://hackage.haskell.org/packages/archive/base/3.0.3.2/doc/html/GHC-Handle.html#v%3AfillReadBuffer
> [3] https://gitweb.torproject.org/tordnsel.git/blob/HEAD:/tordnsel.cabal
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe
mailing list