CIFASIS / QuickFuzz

An experimental grammar fuzzer in Haskell using QuickCheck
http://QuickFuzz.org
GNU General Public License v3.0
199 stars 45 forks source link

Build error due to overlapping instances #17

Closed redNixon closed 8 years ago

redNixon commented 8 years ago

I have tried building QuickFuzz a variety of ways over the last week with no luck. I am making the assumption that this is either being caused by a bug in the source or in the build documentation. The error that I always end up with is "Overlapping instances for Arbitrary String".

My environment: Ubuntu 14.04 x64 GHC: 7.10.2(From the PPA source) Cabal: 1.24(From the PPA source)

Log snippet from ./install.sh(-m gives the same results as well) Configuring QuickFuzz-0.1.0.0... Building QuickFuzz-0.1.0.0... Preprocessing executable 'QuickFuzz' for QuickFuzz-0.1.0.0... [ 1 of 33] Compiling Vector ( src/Vector.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Vector.o ) [ 2 of 33] Compiling DeriveArbitrary ( src/DeriveArbitrary.hs, dist/build/QuickFuzz/QuickFuzz-tmp/DeriveArbitrary.o ) [ 3 of 33] Compiling Images ( src/Images.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Images.o ) [] [ 4 of 33] Compiling Args ( src/Args.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Args.o ) [ 5 of 33] Compiling Parallel ( src/Parallel.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Parallel.o ) [ 6 of 33] Compiling Check ( src/Check.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Check.o ) [ 7 of 33] Compiling Unicode ( src/Unicode.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Unicode.o ) [ 8 of 33] Compiling ByteString ( src/ByteString.hs, dist/build/QuickFuzz/QuickFuzz-tmp/ByteString.o ) [ 9 of 33] Compiling TTF ( src/TTF.hs, dist/build/QuickFuzz/QuickFuzz-tmp/TTF.o ) [ConT GHC.Word.Word8,ConT GHC.Int.Int8,ConT GHC.Word.Word16,ConT GHC.Int.Int16,ConT GHC.Word.Word32,ConT GHC.Int.Int32,ConT GHC.Base.String] [10 of 33] Compiling Wav ( src/Wav.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Wav.o ) [ConT Sound.Wav.Data.WaveFormat,ConT Sound.Wav.Data.RawWaveData,ConT Sound.Wav.Data.WaveFact,ConT Sound.Wav.Data.WaveInfo] recursively deriving Arbitrary instance for Sound.Wav.Data.WaveFormat [ConT Sound.Wav.AudioFormats.AudioFormat,ConT GHC.Word.Word16,ConT Sound.Wav.Data.SampleRate,ConT Sound.Wav.Data.ByteRate,ConT Sound.Wav.Data.BlockAlignment,ConT Sound.Wav.Data.BitsPerSample] recursively deriving Arbitrary instance for Sound.Wav.AudioFormats.AudioFormat [ConT Sound.Wav.AudioFormats.AudioFormatData] recursively deriving Arbitrary instance for Sound.Wav.Data.WaveFact [ConT GHC.Word.Word32] recursively deriving Arbitrary instance for Sound.Wav.Data.WaveInfo [ConT GHC.Base.String] [11 of 33] Compiling CPIO ( src/CPIO.hs, dist/build/QuickFuzz/QuickFuzz-tmp/CPIO.o )

src/CPIO.hs:40:31: Warning: No explicit implementation for ‘arbitrary’ In the instance declaration for ‘Arbitrary Entry’ [12 of 33] Compiling MarkUp ( src/MarkUp.hs, dist/build/QuickFuzz/QuickFuzz-tmp/MarkUp.o ) [13 of 33] Compiling Dot ( src/Dot.hs, dist/build/QuickFuzz/QuickFuzz-tmp/Dot.o )

src/Dot.hs:33:1: Overlapping instances for Arbitrary String arising from a use of ‘arbitrary’ Matching instances: instance [safe] Arbitrary a => Arbitrary [a] -- Defined in ‘Test.QuickCheck.Arbitrary’ instance Arbitrary String -- Defined at src/Dot.hs:27:10 In a stmt of a 'do' block: x1 <- arbitrary In the expression: do { x1 <- arbitrary; return (NameId x1) } In a case alternative: 0 -> do { x1 <- arbitrary; return (NameId x1) } Failed to install QuickFuzz-0.1.0.0 cabal: Error: some packages failed to install: QuickFuzz-0.1.0.0 failed during the building phase. The exception was: ExitFailure 1

gaa-cifasis commented 8 years ago

It is odd, since it compiles here in my machine (also ubuntu 14.04 with GHC 7.10.2). In any case, i just added the "missing" IncoherentInstances flag in the Dot module. Please re-compile and let me know if it is fixed.

Thanks!

martinceresa commented 8 years ago

Hi! It was indeed a problem. A clash between two instances declaration of String, the one in the Dot.hs file and in QuickCheck.Arbitrary 'disguised' as "instance Arbitrary a => Arbitrary [a]". I repaired it using a ghc pragma to override the latter one with the one in Dot.hs. It should work all right now. Thank you!! Bye

redNixon commented 8 years ago

Confirmed that the fix worked, thanks