[tor-dev] PRELIMINARY: [PATCH] Adapt to changes in 'GHC.Handle'. (was: Haskell packages?)

Nikita Karetnikov nikita at karetnikov.org
Wed Jun 19 04:12:50 UTC 2013


> In order to have TorDNSEL work on Debian Squeeze, I did some small
> changes to make it uses Control.OldException. But this does not work
> anymore on GHC 7.4. The later is the version currently in Debian Wheezy.

Hm, I can't build it with GHC 6.10.4.  'cabal build' returns the
following:

src/TorDNSEL/Compat/Exception.hs:23:7:
    Could not find module `Control.OldException':
      it is a member of the hidden package `base'
      Use -v to see a list of the files searched for.

(Oh, I guess I've just found a workaround.  I'll try it later.)

I tried with GHC 6.12.1 as well:

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(..)'

GHC 6.12.1 uses a different version of 'base' (see [1]).  That's why
the above errors appeared.

After that I also tried to build with GHC 7.6.3 and got the same
errors.  What version of GHC do you use?  What about versions of
libraries?  Note that 'tordnsel.cabal' says that the package should
work with GHC 6.6, GHC 6.8, GHC 6.10, and GHC 6.12.

I'm attaching two /preliminary/ patches:

  * The first patch removes '-Werror' from 'tordnsel.cabal'.  I guess
    that '-Werror' shouldn't be there because "Hackage prevents people
    uploading packages with '-Werror' in their '.cabal' file" [2].  But
    I'd prefer to fix other 'cabal'-related warnings before pushing, for
    instance:

    Warning: Instead of 'ghc-options: -DVERSION="0.1.1-dev"' use 'cpp-options:
    -DVERSION="0.1.1-dev"'

    This patch is needed to produce more verbose error messages on
    'cabal build'.

  * The second patch tries to adapt to changes in 'GHC.Handle'.

If you apply both patches (with GHC 7.6.3), the following errors will
appear:

[ 3 of 39] Compiling TorDNSEL.Compat.Exception ( src/TorDNSEL/Compat/Exception.hs, dist/build/tordnsel/tordnsel-tmp/TorDNSEL/Compat/Exception.o ) [dist/build/autogen/cabal_macros.h changed]
[ 4 of 39] Compiling TorDNSEL.System.Timeout ( src/TorDNSEL/System/Timeout.hs, dist/build/tordnsel/tordnsel-tmp/TorDNSEL/System/Timeout.o )

I don't know how many things I'll have to change to build TorDNSEL.
I know about changes in 'base', exceptions, and 'binary'.  For
example:

  - Compare [3] and [4];
  - This version [5] doesn't have 'lookAhead', which is used in
    TorDNSEL.

('tordnsel.cabal' should be adjusted accordingly, by the way.)

My plan is to build TorDNSEL first.  I assume it'll take a lot of time.
So I decided not to look through 'getRequest', 'hGetLine',
'startSocketReader', and other affected functions at this point.
Basically, 'hGetLineN' is based on a docstring of 'hGetLine' and its
type declaration.

I'd like to send more preliminary patches if you don't mind.  That
will help to ensure that I'm on the right track.  Also, it's possible
that someone will be able to spot bugs at preliminary stages.

I'll inspect each preliminary patch when I build the program.

What do you think?

[1] http://www.haskell.org/ghc/docs/6.12.1/html/users_guide/release-6-12-1.html
[2] http://stackoverflow.com/a/5588790
[3] http://hackage.haskell.org/packages/archive/binary/0.4.5/doc/html/src/Data-Binary-Get.html#Get
[4] http://hackage.haskell.org/packages/archive/binary/0.7.1.0/doc/html/src/Data-Binary-Get-Internal.html#Get
[5] http://hackage.haskell.org/packages/archive/binary/0.6.0.0/doc/html/src/Data-Binary-Get.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Adapt-to-changes-in-GHC.Handle.patch
Type: text/x-diff
Size: 9399 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20130619/34418869/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-Werror-from-tordnsel.cabal.patch
Type: text/x-diff
Size: 1048 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20130619/34418869/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20130619/34418869/attachment.pgp>


More information about the tor-dev mailing list