Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628330 - dev-haskell/connection-0.2.4: build fails when depending on >=dev-haskell/tls-1.3 due to change in API between TLS-1.2 and 1.3 (in particular contextNew function)
Summary: dev-haskell/connection-0.2.4: build fails when depending on >=dev-haskell/tls...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-19 19:50 UTC by Didier Colle
Modified: 2018-10-25 04:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Colle 2017-08-19 19:50:55 UTC
I am trying to emerge dev-haskell/stack. Apparently only ebuild for stack-1.3.2 is available. This ebuild contains in RDEPEND: >=dev-haskell/tls-1.3.8:=[profile?] <dev-haskell/tls-1.4:=[profile?]
I assume this is the reason why I was suggested (and which I did) to add amongst many many more things the following to my package.accept_keywords file:
# required by dev-haskell/stack-1.3.2::gentoo
# required by stack (argument)
=dev-haskell/tls-1.3.9 ~x86

dev-haskell/connection-0.2.4 is indirectly pulled in by emerging stack.
The build of connection-0.2.4 fails: see complete build.log below.
The relevant part is:
Network/Connection.hs:316:12:
    Couldn't match type ‘TLS.Context’ with ‘IO TLS.Context’
    Expected type: RNG.ChachaRNG -> IO TLS.Context
      Actual type: RNG.ChachaRNG -> TLS.Context
    The function ‘TLS.contextNew’ is applied to three arguments,
    its type is ‘backend0 -> params0 -> m0 TLS.Context’,
    it is specialized to ‘Handle
                          -> TLS.ClientParams -> RNG.ChachaRNG -> TLS.Context’
    In a stmt of a 'do' block:
      ctx <- TLS.contextNew handle tlsParams rng
    In the expression:
      do { rng <- RNG.initialize
                  <$> grabEntropyIO 40 (globalEntropyPool cg);
           ctx <- TLS.contextNew handle tlsParams rng;
           TLS.handshake ctx;
           return ctx }

From https://hackage.haskell.org/package/tls-1.2.18/docs/Network-TLS.html :
contextNew Source
:: (MonadIO m, CPRG rng, HasBackend backend, TLSParams params)	 
=> backend	Backend abstraction with specific method to interact with the connection type.
-> params	Parameters of the context.
-> rng	Random number generator associated with this context.
-> m Context	 

And from hhttps://hackage.haskell.org/package/tls-1.3.0/docs/Network-TLS.html :
contextNew Source
:: (MonadIO m, HasBackend backend, TLSParams params)	 
=> backend	Backend abstraction with specific method to interact with the connection type.
-> params	Parameters of the context.
-> m Context	 

Thus between version 1.2(.18) and 1.3(.0) the TLS API has changed in the signature of the contextNew function.

In the dev-haskell/connection-0.2.4.ebuild RDEPEND contains >=dev-haskell/tls-1.2:=[profile?] . As such, connection-0.2.4 is happy with tls-1.3.9 (although unmasked in accept_keywords file) pulled in by emerging stack.

Simply limiting the connection-0.2.4 RDEPEND to <dev-haskell/tls-1.3.0 might look attractive as solution, but is not good enough as I assume it will prohibit me emerging stack which was my intention in the first place ...

Complete build.log:
 * Package:    dev-haskell/connection-0.2.4
 * Repository: gentoo
 * Maintainer: haskell@gentoo.org
 * USE:        abi_x86_32 elibc_glibc kernel_linux userland_GNU x86
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking connection-0.2.4.tar.gz to /var/tmp/portage/dev-haskell/connection-0.2.4/work
>>> Source unpacked in /var/tmp/portage/dev-haskell/connection-0.2.4/work
>>> Preparing source in /var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4 ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4 ...
 * Using cabal-1.22.8.0.
 * Prepending /usr/lib/ghc-7.10.3 to LD_LIBRARY_PATH
/usr/bin/ghc -package Cabal-1.22.8.0 --make /var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4/Setup.hs -j1 +RTS -A256M -qb0 -RTS -threaded -dynamic -o setup
[1 of 1] Compiling Main             ( /var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4/Setup.hs, /var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4/Setup.o )
Linking setup ...
./setup configure --ghc --prefix=/usr --with-compiler=/usr/bin/ghc --with-hc-pkg=/usr/bin/ghc-pkg --prefix=/usr --libdir=/usr/lib --libsubdir=connection-0.2.4/ghc-7.10.3 --datadir=/usr/share/ --datasubdir=connection-0.2.4/ghc-7.10.3 --ghc-options=-j1 +RTS -A256M -qb0 -RTS --with-ar=i686-pc-linux-gnu-ar --ghc-option=-optc-O2 --ghc-option=-optc-march=i686 --ghc-option=-optc-pipe --ghc-option=-optl-Wl,-O1 --ghc-option=-optl-Wl,--as-needed --disable-executable-stripping --docdir=/usr/share/doc/connection-0.2.4 --verbose --enable-shared --enable-executable-dynamic --sysconfdir=/etc --disable-library-stripping
Configuring connection-0.2.4...
Dependency base >=3 && <5: using base-4.8.2.0
Dependency byteable -any: using byteable-0.1.1
Dependency bytestring -any: using bytestring-0.10.6.0
Dependency containers -any: using containers-0.5.6.2
Dependency crypto-random -any: using crypto-random-0.0.9
Dependency data-default-class -any: using data-default-class-0.0.1
Dependency network >=2.3: using network-2.6.2.1
Dependency securemem -any: using securemem-0.1.3
Dependency socks >=0.4: using socks-0.5.4
Dependency tls >=1.2: using tls-1.3.9
Dependency x509 >=1.4: using x509-1.6.5
Dependency x509-store >=1.4: using x509-store-1.6.2
Dependency x509-system >=1.4: using x509-system-1.6.4
Dependency x509-validation >=1.5: using x509-validation-1.6.5
Using Cabal-1.22.8.0 compiled by ghc-7.10
Using compiler: ghc-7.10.3
Using install prefix: /usr
Binaries installed in: /usr/bin
Libraries installed in: /usr/lib/connection-0.2.4/ghc-7.10.3
Private binaries installed in: /usr/libexec
Data files installed in: /usr/share/connection-0.2.4/ghc-7.10.3
Documentation installed in: /usr/share/doc/connection-0.2.4
Configuration files installed in: /etc
No alex found
Using ar given by user at: /usr/bin/i686-pc-linux-gnu-ar
No c2hs found
No cpphs found
Using gcc version 5.4.0 found on system at: /usr/bin/gcc
Using ghc version 7.10.3 given by user at: /usr/bin/ghc
Using ghc-pkg version 7.10.3 given by user at: /usr/bin/ghc-pkg
No ghcjs found
No ghcjs-pkg found
No greencard found
No haddock found
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.67 found on system at: /usr/bin/hpc
Using hsc2hs version 0.67 found on system at: /usr/bin/hsc2hs
No hscolour found
No jhc found
Using ld found on system at: /usr/bin/ld
No lhc found
No lhc-pkg found
Using pkg-config version 0.28 found on system at: /usr/bin/pkg-config
Using strip version 2.28 found on system at: /usr/bin/strip
Using tar found on system at: /bin/tar
No uhc found
>>> Source configured.
>>> Compiling source in /var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4 ...
./setup build
Building connection-0.2.4...
Preprocessing library connection-0.2.4...
[1 of 3] Compiling Network.Connection.Types ( Network/Connection/Types.hs, dist/build/Network/Connection/Types.o )
[2 of 3] Compiling Network.Connection.ChachaRNG ( Network/Connection/ChachaRNG.hs, dist/build/Network/Connection/ChachaRNG.o )

Network/Connection/ChachaRNG.hs:27:10: Warning:
    No explicit implementation for
      ‘cprgSetReseedThreshold’, ‘cprgFork’, and ‘cprgGenerateWithEntropy’
    In the instance declaration for ‘CPRG ChachaRNG’
[3 of 3] Compiling Network.Connection ( Network/Connection.hs, dist/build/Network/Connection.o )

Network/Connection.hs:316:12:
    Couldn't match type ‘TLS.Context’ with ‘IO TLS.Context’
    Expected type: RNG.ChachaRNG -> IO TLS.Context
      Actual type: RNG.ChachaRNG -> TLS.Context
    The function ‘TLS.contextNew’ is applied to three arguments,
    its type is ‘backend0 -> params0 -> m0 TLS.Context’,
    it is specialized to ‘Handle
                          -> TLS.ClientParams -> RNG.ChachaRNG -> TLS.Context’
    In a stmt of a 'do' block:
      ctx <- TLS.contextNew handle tlsParams rng
    In the expression:
      do { rng <- RNG.initialize
                  <$> grabEntropyIO 40 (globalEntropyPool cg);
           ctx <- TLS.contextNew handle tlsParams rng;
           TLS.handshake ctx;
           return ctx }
 * ERROR: dev-haskell/connection-0.2.4::gentoo failed (compile phase):
 *   setup build failed
 *
 * Call stack:
 *     ebuild.sh, line  115:  Called src_compile
 *   environment, line 2805:  Called haskell-cabal_src_compile
 *   environment, line 1915:  Called cabal_src_compile
 *   environment, line  704:  Called cabal-build
 *   environment, line  468:  Called die
 * The specific snippet of code:
 *       ./setup "$@" || die "setup build failed"
 *
 * If you need support, post the output of `emerge --info '=dev-haskell/connection-0.2.4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-haskell/connection-0.2.4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-haskell/connection-0.2.4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-haskell/connection-0.2.4/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4'
 * S: '/var/tmp/portage/dev-haskell/connection-0.2.4/work/connection-0.2.4'
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2017-08-26 10:15:02 UTC
I suggest using the same keywording policy for all dev-haskell/* ebuilds like 'dev-haskell/* ~x86'.

Thanks for the report! I'll all upper bound to dev-haskell/connection-0.2.4