QuickChick / Luck

Luck -- A Language for Property-Based Generators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failure

yilongli opened this issue · comments

I tried to build Luck on a freshly installed Ubuntu 16.04 system and got the following error:

yilongl@node:~/Luck/luck$ ghc --version                                                           
The Glorious Glasgow Haskell Compilation System, version 7.10.3                                   
yilongl@node:~/Luck/luck$ cabal --version                                                         
cabal-install version 1.22.6.0                                                                    
using version 1.22.5.0 of the Cabal library                                                       
yilongl@node:~/Luck/luck$ lsb_release -a                                                          
No LSB modules are available.                                                                     
Distributor ID: Ubuntu                                                                            
Description:    Ubuntu 16.04.1 LTS                                                                
Release:        16.04                                                                             
Codename:       xenial                                                                            

yilongl@node:~/Luck/luck$ cabal install                                                           
Resolving dependencies...                                                                         
Configuring luck-0.1.0.0...                                                                       
Building luck-0.1.0.0...                                                                          
Failed to install luck-0.1.0.0                                                                    
Build log ( /users/yilongl/.cabal/logs/luck-0.1.0.0.log ):                                        
Configuring luck-0.1.0.0...                                                                       
Building luck-0.1.0.0...                                                                          
Preprocessing library luck-0.1.0.0...                                                             
[ 1 of 27] Compiling Paths_luck       ( dist/build/autogen/Paths_luck.hs, dist/build/Paths_luck.o 
)                                                                                                 
[ 2 of 27] Compiling Common.Pretty    ( src/Common/Pretty.hs, dist/build/Common/Pretty.o )        
[ 3 of 27] Compiling Common.Types     ( src/Common/Types.hs, dist/build/Common/Types.o )          
[ 4 of 27] Compiling Common.SrcLoc    ( src/Common/SrcLoc.hs, dist/build/Common/SrcLoc.o )        
[ 5 of 27] Compiling Outer.AST        ( src/Outer/AST.hs, dist/build/Outer/AST.o )                
[ 6 of 27] Compiling Core.AST         ( src/Core/AST.hs, dist/build/Core/AST.o )                  
[ 7 of 27] Compiling Common.Error     ( src/Common/Error.hs, dist/build/Common/Error.o )          
[ 8 of 27] Compiling Common.Util      ( src/Common/Util.hs, dist/build/Common/Util.o )            
[ 9 of 27] Compiling Core.IntRep      ( src/Core/IntRep.hs, dist/build/Core/IntRep.o )            
[10 of 27] Compiling Core.Pretty      ( src/Core/Pretty.hs, dist/build/Core/Pretty.o )            
[11 of 27] Compiling Core.CSet        ( src/Core/CSet.hs, dist/build/Core/CSet.o )                
[12 of 27] Compiling Core.Optimizations ( src/Core/Optimizations.hs, dist/build/Core/Optimizations
.o )                                                                                              
[13 of 27] Compiling Core.Rigidify.Generator ( src/Core/Rigidify/Generator.hs, dist/build/Core/Rig
idify/Generator.o )                                                                               
[14 of 27] Compiling Core.Rigidify.Pretty ( src/Core/Rigidify/Pretty.hs, dist/build/Core/Rigidify/
Pretty.o )                                                                                        
[15 of 27] Compiling Outer.Types      ( src/Outer/Types.hs, dist/build/Outer/Types.o )            
[16 of 27] Compiling Common.Conversions ( src/Common/Conversions.hs, dist/build/Common/Conversions
.o )                                                                                              
[17 of 27] Compiling Core.Rigidify.Data ( src/Core/Rigidify/Data.hs, dist/build/Core/Rigidify/Data
.o )                                                                                              
[18 of 27] Compiling Core.Rigidify    ( src/Core/Rigidify.hs, dist/build/Core/Rigidify.o )        
[19 of 27] Compiling Outer.ParseMonad ( src/Outer/ParseMonad.hs, dist/build/Outer/ParseMonad.o )  
[20 of 27] Compiling Outer.Lexer      ( dist/build/Outer/Lexer.hs, dist/build/Outer/Lexer.o )     
[21 of 27] Compiling Outer.Parser     ( dist/build/Outer/Parser.hs, dist/build/Outer/Parser.o )   
[22 of 27] Compiling Outer.Renamer    ( src/Outer/Renamer.hs, dist/build/Outer/Renamer.o )        
[23 of 27] Compiling Outer.Expander   ( src/Outer/Expander.hs, dist/build/Outer/Expander.o )      
[24 of 27] Compiling Outer.ClassMono  ( src/Outer/ClassMono.hs, dist/build/Outer/ClassMono.o )    
[25 of 27] Compiling Core.Semantics   ( src/Core/Semantics.hs, dist/build/Core/Semantics.o )      
                                                                                                  
src/Core/Semantics.hs:102:5:                                                                      
    Overlapping instances for MonadError                                                          
                                Message (RandT StdGen (Either Message))                           
      arising from a use of ‘throwError’                                                          
    Matching instances:                                                                           
      instance MonadError e m => MonadError e (RandT g m)                                         
        -- Defined in ‘Control.Monad.Trans.Random.Lazy’                                           
      instance MonadError e m => MonadError e (RandT StdGen m)                                    
        -- Defined at src/Core/Semantics.hs:91:10                                                 
    In the expression: throwError                                                                 
    In a stmt of a 'do' block: throwError $ mkUnSat msg                                           
    In the expression:                                                                            
      do { backRem -= 1;                                                                          
           throwError $ mkUnSat msg }                                                             
                                                                                                  
src/Core/Semantics.hs:128:7:                                                                      
    Overlapping instances for MonadError                                                          
                                Message (RandT StdGen (Either Message))                           
      arising from a use of ‘catchError’                                                          
    Matching instances:                                                                           
      instance MonadError e m => MonadError e (RandT g m)                                         
        -- Defined in ‘Control.Monad.Trans.Random.Lazy’                                           
      instance MonadError e m => MonadError e (RandT StdGen m)                                    
        -- Defined at src/Core/Semantics.hs:91:10                                                 
    In the expression:                                                                            
      m                                                                                           
      `catchError`                                                                                
        (\ err                                                                                    
           -> if isUnSat err then do { backtrack s ms } else throwError err)                      
    In an equation for ‘backtrack’:                                                               
        backtrack s (m : ms)                                                                      
          = m                                                                                     
            `catchError`                                                                          
              (\ err                                                                              
                 -> if isUnSat err then do { backtrack s ms } else throwError err)                
cabal: Error: some packages failed to install:                                                    
luck-0.1.0.0 failed during the building phase. The exception was:                                 
ExitFailure 1                                                                                     
yilongl@node:~/Luck/luck$ 

We need MonadRandom < 0.5 because it used not to provide those instances.

Or we could remove them and then require MonadRandom >= 0.5.

Thanks for the quick response. Adding MonadRandom < 0.5 does solve the problem. Two more minor issues: 1) the build dependency seem to lack alex and happy and 2) calling cabal install under luck doesn't produce the executable in the same directory as the readme suggests (it's actually inside luck/dist/build/luck).