Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561100 - dev-haskell/attoparsec-0.13.0.1 cannot be built
Summary: dev-haskell/attoparsec-0.13.0.1 cannot be built
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Haskell Language team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-22 07:55 UTC by Paul Osmialowski
Modified: 2015-09-26 12:36 UTC (History)
0 users

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


Attachments
emerge --info (emerge-info.txt,16.29 KB, text/plain)
2015-09-22 18:53 UTC, Paul Osmialowski
Details
build.log as requested (build.log,5.91 KB, text/plain)
2015-09-22 19:22 UTC, Paul Osmialowski
Details
One more build.log, as requested. (build.log,10.82 KB, text/plain)
2015-09-23 20:26 UTC, Paul Osmialowski
Details
B.hs - sample test (B.hs,2.23 KB, text/x-haskell)
2015-09-24 20:46 UTC, Sergei Trofimovich (RETIRED)
Details
tc.log file as requested (tc.log,204.80 KB, text/plain)
2015-09-24 21:17 UTC, Paul Osmialowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Osmialowski 2015-09-22 07:55:38 UTC
>>> Source configured.                                                                                                                                                                        
>>> Compiling source in /var/tmp/portage/dev-haskell/attoparsec-0.13.0.1/work/attoparsec-0.13.0.1 ...                                                                                         
./setup build                                                                                                                                                                                 
Building attoparsec-0.13.0.1...                                                                                                                                                               
Preprocessing library attoparsec-0.13.0.1...                                                                                                                                                  
[ 1 of 21] Compiling Data.Attoparsec.Text.FastSet ( Data/Attoparsec/Text/FastSet.hs, dist/build/Data/Attoparsec/Text/FastSet.o )                                                              
[ 2 of 21] Compiling Data.Attoparsec.Internal.Fhthagn ( Data/Attoparsec/Internal/Fhthagn.hs, dist/build/Data/Attoparsec/Internal/Fhthagn.o )                                                  
[ 3 of 21] Compiling Data.Attoparsec.Text.Buffer ( Data/Attoparsec/Text/Buffer.hs, dist/build/Data/Attoparsec/Text/Buffer.o )                                                                 
                                                                                                                                                                                              
Data/Attoparsec/Text/Buffer.hs:159:26:                                                                                                                                                        
    Couldn't match type ‘Int -> A.MArray s0’ with ‘A.MArray s’                                                                                                                                
    Expected type: ST s (A.MArray s)                                                                                                                                                          
      Actual type: ST s (Int -> A.MArray s0)                                                                                                                                                  
    Relevant bindings include                                                                                                                                                                 
      unsafeThaw :: A.Array -> ST s (A.MArray s)                                                                                                                                              
        (bound at Data/Attoparsec/Text/Buffer.hs:159:1)                                                                                                                                       
    In the expression:                                                                                                                                                                        
      ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)                                                                                                                                     
    In an equation for ‘unsafeThaw’:                                                                                                                                                          
        unsafeThaw (A.Array {..})                                                                                                                                                             
          = ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)                                                                                                                               
 .[31;01m*.[0m ERROR: dev-haskell/attoparsec-0.13.0.1::gentoo failed (compile phase):                                                                                                         
 .[31;01m*.[0m   setup build failed

Reproducible: Always

Steps to Reproduce:
1. try to emerge pandoc
2.
3.



This effectively prevents pandoc from being built.

The system is after yesterdays update of ghc to version 7.8.4.
haskel-updater --upgrade was already executed.
Comment 1 Paul Osmialowski 2015-09-22 07:58:00 UTC
Can't paste emerge --info, it says "too many characters", sorry.
Comment 2 Michael Palimaka (kensington) gentoo-dev 2015-09-22 13:33:33 UTC
(In reply to Paul Osmialowski from comment #1)
> Can't paste emerge --info, it says "too many characters", sorry.

Please attach it instead, then.
Comment 3 Paul Osmialowski 2015-09-22 18:53:59 UTC
Created attachment 412596 [details]
emerge --info
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2015-09-22 19:18:20 UTC
Can you attach actual build.log for attoparsec?
It will contain versions of libraries and ghc used to build it.
Comment 5 Paul Osmialowski 2015-09-22 19:22:51 UTC
Created attachment 412598 [details]
build.log as requested
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2015-09-23 20:11:56 UTC
OK, I can't reproduce the failure (amd64 stable + gcc-4.7.4). That's very strange
as the error is clearly about argument mismatch
for a simple record wrap/unwrap:

  Data/Attoparsec/Text/Buffer.hs:159:26:
    Couldn't match type ‘Int -> A.MArray s0’ with ‘A.MArray s’
    Expected type: ST s (A.MArray s)
      Actual type: ST s (Int -> A.MArray s0)

I suspect it's related to preprocessor pass.

Let's try to make sure we get the same source after a parse pass. Run a:
    $ HCFLAGS="-ddump-parsed" emerge -1 attoparsec
and attach a 'build log'.

I get this on successful compile:
  unsafeThaw :: A.Array -> ST s (A.MArray s)
  unsafeThaw (A.Array {..})
    = ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)
Comment 7 Paul Osmialowski 2015-09-23 20:26:00 UTC
Created attachment 412680 [details]
One more build.log, as requested.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2015-09-24 20:46:10 UTC
Created attachment 412830 [details]
B.hs - sample test

I don't see any divergence from my output.

Let's try small subset of the source file to see if that part of code is enough.
Does attached B.hs build for you as:

$ ghc -c B.hs -fforce-recomp -hide-all-packages -package=base -package=text
Comment 9 Paul Osmialowski 2015-09-24 21:05:38 UTC
ghc produces following output:

$ ghc -c B.hs -fforce-recomp -hide-all-packages -package=base -package=text

B.hs:58:26:
    Couldn't match type ‘Int -> A.MArray s0’ with ‘A.MArray s’
    Expected type: ST s (A.MArray s)
      Actual type: ST s (Int -> A.MArray s0)
    Relevant bindings include
      unsafeThaw :: A.Array -> ST s (A.MArray s) (bound at B.hs:58:1)
    In the expression:
      ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)
    In an equation for ‘unsafeThaw’:
        unsafeThaw (A.Array {..})
          = ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)
$
Comment 10 Paul Osmialowski 2015-09-24 21:06:29 UTC
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.8.4
$ which ghc
/usr/bin/ghc
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2015-09-24 21:13:54 UTC
(In reply to Paul Osmialowski from comment #9)
> ghc produces following output:
> 
> $ ghc -c B.hs -fforce-recomp -hide-all-packages -package=base -package=text
> 
> B.hs:58:26:
>     Couldn't match type ‘Int -> A.MArray s0’ with ‘A.MArray s’
>     Expected type: ST s (A.MArray s)
>       Actual type: ST s (Int -> A.MArray s0)
>     Relevant bindings include
>       unsafeThaw :: A.Array -> ST s (A.MArray s) (bound at B.hs:58:1)
>     In the expression:
>       ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)
>     In an equation for ‘unsafeThaw’:
>         unsafeThaw (A.Array {..})
>           = ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)
> $

Interesting. Let's get an output from typechecker:

$ ghc -c B.hs -fforce-recomp -hide-all-packages -package=base -package=text -ddump-rn-trace -ddump-if-trace -ddump-cs-trace -ddump-tc-trace -ddump-vt-trace 2>tc.log

and attach tc.log here.
Comment 12 Paul Osmialowski 2015-09-24 21:17:28 UTC
Created attachment 412832 [details]
tc.log file as requested
Comment 13 Sergei Trofimovich (RETIRED) gentoo-dev 2015-09-24 21:50:06 UTC
(In reply to Paul Osmialowski from comment #12)
> Created attachment 412832 [details]
> tc.log file as requested

Aha I see now: You are building dev-haskell/text with USE=developer,
but that USE flag changes MArray arity from 1-argument to 2-argunet constructor:

-- | Mutable array type, for use in the ST monad.
data MArray s = MArray {
      maBA :: MutableByteArray# s
#if defined(ASSERTS)
    , maLen :: {-# UNPACK #-} !Int -- length (in units of Word16, not bytes)
#endif
    }

and it breaks Array to MArray cast at:
  unsafeThaw (A.Array {..})
    = ST $ \ s# -> (# s#, A.MArray (unsafeCoerce# aBA) #)

There is no nice way to check how exactly text was built
to workaround it in attoparsec, thus I've dropped support
for USE=developer from dev-haskell/text as:

- https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c3798799a2ac677bc7ca510b751c551b7a3016b
- https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7d424d6c5062db72e0fa1e525d1b54b3301831dc

You'll have to rebuild dev-haskell/text and fix the breakage
by running haskell-updater. That should get you working attoparsec.

Thanks for help to nail it down!
Sorry, took a while of back and forth to figure out.
Comment 14 Paul Osmialowski 2015-09-25 08:06:50 UTC
Now it works, I was able to successfully build attoparsec and then pandoc.

Thanks for your help!

Note that when I was building pandoc I encountered two more problems that I could sort out myself:

- aeson-0.7.0.6 can't be built with developer flag - it spits a lot of warning and due to developer flag it is built with -Werror so it stops on all warnings

- pandoc-1.15.0.6 cannot be build with embed_data_files flag, it is hit by following error:

hsb2hs: --version: openFile: does not exist (No such file or directory) 

And indeed, hsb2hs always produces output like this:

$ hsb2hs --version
hsb2hs: --version: openFile: does not exist (No such file or directory)

You can also check this out:

https://groups.google.com/forum/#!topic/pandoc-discuss/UzMZkVi6uMA

Nevertheless, original problem is resolved and fixed. Thanks again.
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2015-09-26 12:36:54 UTC
(In reply to Paul Osmialowski from comment #14)
> Now it works, I was able to successfully build attoparsec and then pandoc.
> 
> Thanks for your help!
> 
> Note that when I was building pandoc I encountered two more problems that I
> could sort out myself:
> 
> - aeson-0.7.0.6 can't be built with developer flag - it spits a lot of
> warning and due to developer flag it is built with -Werror so it stops on
> all warnings

Dropped USE=developer flag as: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f48ffef3726fbd7e2d025382adbc810c6321055d

> - pandoc-1.15.0.6 cannot be build with embed_data_files flag, it is hit by
> following error:
> 
> hsb2hs: --version: openFile: does not exist (No such file or directory) 
> 
> And indeed, hsb2hs always produces output like this:
> 
> $ hsb2hs --version
> hsb2hs: --version: openFile: does not exist (No such file or directory)

Pushed 0.3 to stable as: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4f6773c0fca4ce83a7591df6cfd826403d9ae36

> You can also check this out:
> 
> https://groups.google.com/forum/#!topic/pandoc-discuss/UzMZkVi6uMA
> 
> Nevertheless, original problem is resolved and fixed. Thanks again.