Cabal strange dependencies

Hello,
I have a project that include the library vty-6.0 in the dependencies.
Strangely I cannot compile it:

$ cabal install                                                                                                                                         
cabal: Could not resolve dependencies:                                                                                                                                                                      
[__0] trying: timetravel-0.1.0.0 (user goal)                                                                                                                                                                
[__1] next goal: vty (dependency of timetravel)                                                                                                                                                             
[__1] rejecting: vty-5.39 (conflict: timetravel => vty==6.0)                                                                                                                                                
[__1] skipping: vty-5.38, vty-5.37, vty-5.36, vty-5.35.1, vty-5.35, vty-5.34,                                                                                                                               
vty-5.33, vty-5.32, vty-5.31, vty-5.30, vty-5.29, vty-5.28.2, vty-5.28.1,                                                                                                                                   
vty-5.28, vty-5.27, vty-5.26, vty-5.25.1, vty-5.25, vty-5.24.1, vty-5.24,                                                                                                                                   
vty-5.23.1, vty-5.23, vty-5.22, vty-5.21, vty-5.20, vty-5.19.2, vty-5.19.1,                                                                                                                                 
vty-5.19, vty-5.18.1, vty-5.18, vty-5.17.1, vty-5.17, vty-5.16, vty-5.15.1,                                                                                                                                 
vty-5.15, vty-5.14, vty-5.13, vty-5.11.3, vty-5.11.2, vty-5.11.1, vty-5.11,                                                                                                                                 
vty-5.10, vty-5.9.1, vty-5.9, vty-5.8.1, vty-5.8, vty-5.7.1, vty-5.7, vty-5.6,                                                                                                                              
vty-5.5.0, vty-5.4.0, vty-5.3.1, vty-5.3, vty-5.2.11, vty-5.2.10, vty-5.2.9,                                                                                                                                
vty-5.2.8, vty-5.2.7, vty-5.2.6, vty-5.2.5, vty-5.2.4, vty-5.2.3, vty-5.2.2,                                                                                                                                
vty-5.2.1, vty-5.2.0, vty-5.1.4, vty-5.1.3, vty-5.1.1, vty-5.1.0, vty-5.0.2,                                                                                                                                
vty-5.0.1, vty-5.0.0, vty-4.7.5, vty-4.7.4, vty-4.7.3, vty-4.7.2, vty-4.7.1,                                                                                                                                
vty-4.7.0.20, vty-4.7.0.18, vty-4.7.0.14, vty-4.7.0.12, vty-4.7.0.10,                                                                                                                                       
vty-4.7.0.8, vty-4.7.0.6, vty-4.7.0.4, vty-4.7.0.0, vty-4.6.0.6, vty-4.6.0.4,                                                                                                                               
vty-4.6.0.2, vty-4.6.0.1, vty-4.4.0.0.1, vty-4.4.0.0, vty-4.2.1.0,                                                                                                                                          
vty-4.0.0.1, vty-4.0.0, vty-3.1.8.4, vty-3.1.8.2, vty-3.1.8, vty-3.1.6,                                                                                                                                     
vty-3.1.4, vty-3.1.2, vty-3.1.0, vty-3.0.4, vty-3.0.2, vty-3.0.1, vty-3.0.0,                                                                                                                                
vty-5.12 (has the same characteristics that caused the previous version to                                                                                                                                  
fail: excluded by constraint '==6.0' from 'timetravel')                                                                                                                                                     
[__1] fail (backjumping, conflict set: timetravel, vty)                                                                                                                                                     
After searching the rest of the dependency tree exhaustively, these were the                                                                                                                                
goals I've had most trouble fulfilling: timetravel, vty                        

Why cabal doesn’t install vty-6.0? It is in my package list:

$ cabal list vty
* vty                                                                                                                                                                                                       
    Synopsis: A simple terminal UI library                                                                                                                                                                  
    Default available version: 6.0                                                                                                                                                                          
    Installed versions: [ Not installed ]                                                                                                                                                                   
    Homepage: https://github.com/jtdaugherty/vty                                                                                                                                                            
    License:  BSD3     

Thanks

1 Like

Have you tried cabal update in the last 8-ish days? vty-6.0 was only published on the 31st October.

Yes, I get the same result.
Is it because the package is recent?

Well, for some reason cabal doesn’t know about vty-6.0. I assumed it was because you hadn’t run cabal update since vty-6.0 was uploaded, but if you have then I don’t know any explanation for the observed behaviour!

There is something strange.
I tried:

$ cabal install vty-6.0                                                                                                                                 
cabal: Could not resolve dependencies:                                                                                                                                                                      
[__0] trying: timetravel-0.1.0.0 (user goal)                                                                                                                                                                
[__1] next goal: vty (dependency of timetravel)                                                                                                                                                             
[__1] rejecting: vty-5.39 (conflict: timetravel => vty==6.0)            
...

If I change folder, I can install it. But it give some strange warning message.

/workspace$ cabal install vty-6.0                                                                                                                                            
Resolving dependencies...                                                                                                                                                                                   
Up to date                                                                                                                                                                                                  
Warning:                                                                                                                                                                                                    
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                                                                                                                
@ WARNING: Installation might not be completed as desired! @                                                                                                                                                
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                                                                                                                                                
The command "cabal install [TARGETS]" doesn't expose libraries.                                                                                                                                             
* You might have wanted to add them as dependencies to your package. In this                                                                                                                                
case add "vty" to the build-depends field(s) of your package's .cabal file.                                                                                                                                 
* You might have wanted to add them to a GHC environment. In this case use                                                                                                                                  
"cabal install --lib vty". The "--lib" flag is provisional: see                                                                                                                                             
https://github.com/haskell/cabal/issues/6481 for more information.                  

Yes, because you don’t install libraries with cabal install.

Something here is not as actually presented. Can you please paste the output of running cabal update followed by cabal install in your project directory?

OK, my bad: I had a cabal.project.freeze file in that folder! :sweat_smile:

That doesn’t explain the error message. It should still have explain why it was or wasn’t using vty-6.0.

After I removed the cabal.project.freeze file, the error message is gone. I agree the message was not explicit.

Well, I suspect it was actually the cabal update that fixed it, but we can never know now!

1 Like

index-state would be a plausible explanation.

4 Likes

Ah yes! I forgot that freeze files also contain index state. That’s a much more convincing explanation.

1 Like