>>> 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.
Can't paste emerge --info, it says "too many characters", sorry.
(In reply to Paul Osmialowski from comment #1) > Can't paste emerge --info, it says "too many characters", sorry. Please attach it instead, then.
Created attachment 412596 [details] emerge --info
Can you attach actual build.log for attoparsec? It will contain versions of libraries and ghc used to build it.
Created attachment 412598 [details] build.log as requested
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) #)
Created attachment 412680 [details] One more build.log, as requested.
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
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) #) $
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.8.4 $ which ghc /usr/bin/ghc
(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.
Created attachment 412832 [details] tc.log file as requested
(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.
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.
(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.