I try to install TidalCycles 1.6.1 locally from the GitHub repository, but I got an error, when I use cabal install. Interestingly, I can install it successfully using cabal install tidal --lib
What I try to achieve is that I want to experiment locally with the TidalCycles source code.
The error message is:
cabal: Could not resolve dependencies:
[__0] trying: tidal-parse-0.0.1 (user goal)
[__1] next goal: template-haskell (dependency of tidal-parse)
[__1] rejecting: template-haskell-2.15.0.0/installed-2.15.0.0 (conflict:
tidal-parse => template-haskell>=2.10.0.0 && <2.15)
[__1] skipping: template-haskell-2.16.0.0, template-haskell-2.15.0.0 (has the
same characteristics that caused the previous version to fail: excluded by
constraint '>=2.10.0.0 && <2.15' from 'tidal-parse')
[__1] rejecting: template-haskell-2.14.0.0, template-haskell-2.13.0.0,
template-haskell-2.12.0.0, template-haskell-2.11.1.0,
template-haskell-2.11.0.0, template-haskell-2.10.0.0,
template-haskell-2.9.0.0, template-haskell-2.8.0.0, template-haskell-2.7.0.0,
template-haskell-2.6.0.0, template-haskell-2.5.0.0, template-haskell-2.4.0.1,
template-haskell-2.4.0.0, template-haskell-2.3.0.1, template-haskell-2.3.0.0,
template-haskell-2.2.0.0 (constraint from non-upgradeable package requires
installed instance)
[__1] fail (backjumping, conflict set: template-haskell, tidal-parse)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: template-haskell, tidal-parse
The error message appeared when I use cabal install --lib.
I have removed all tidal references from ~/.cabal and ~/.ghc and also run ghc-pkg unregister tidal. Now in the source folder I can use cabal v1-install which build everything successfully:
Starting tidal-1.6.1
Building tidal-1.6.1
Completed tidal-1.6.1
However, it seems that no references are created by this?
Unfortunately no. When I try to import Sound.Tidal.Context in ghci I get this error message:
Prelude> import Sound.Tidal.Context
**<no location info>:**
**error:**
**Could not load module ‘Sound.Tidal.Context’**
**It is a member of the hidden package ‘tidal-1.6.1’.**
**You can run ‘:set -package tidal’ to expose it.**
**(Note: this unloads all the modules in the current scope.)**
Prelude>
The generated build files with cabal v1-install end up successfully in .cabal/lib/x86_64-osx-ghc-8.8.3/tidal-1.6.1-IxLdK44qt4X5pkdahLbi1n/
I should be able to add the package with ghc-pkg expose tidal, but unfortunately this does not work.
And when I start the ghci session for testing with ghci -package tidal or type in :set -package tidal, then I get this error message:
Prelude> import Sound.Tidal.Context
**<no location info>:** **error:**
**Could not find module ‘Sound.Tidal.Context’**
**Perhaps you haven't installed the "dyn" libraries for package ‘tidal-1.6.1’?**
**Use -v (or `:set -v` in ghci) to see a list of the files searched for.**
Prelude>
Interestingly, when I download it from the hackage server with cabal install tidal --lib, everything still works flawlessly even now.
That's very frustrating. When you start ghci, I think it will give you the location of an environment file. You could try deleting that, and re-installing, to see if that helps. Due to a known bug, you will have to delete this file every time you re-install the tidal library.
If that doesn't help, you could report the issue here:
Otherwise, install with cabal v1-install instead of cabal install --lib. This will use the older install method which is far less buggy. This is what I do.
I deleted the environment file under ~/.ghc/x86_64-darwin-8.8.3/environments/default and that actually fixed the problem for me. Thanks for the help!
@jwaldmann should I have this problem the next time, (i.e when I re-install the tidal library) then I will first try to delete the offending lines in the default. Thanks for the hint!