[Solved] Broken tidal dependencies after system update (comonad/tagged)

Hi there, since a system update (Arch Linux) I got the following error when launching tidal:

cannot satisfy -package-id bifunctors-5.5.11-927899763fe924987e356b351cccc8848a5fc71a14592f412c979b1de3f29517: 
    bifunctors-5.5.11-927899763fe924987e356b351cccc8848a5fc71a14592f412c979b1de3f29517 is unusable due to missing dependencies:
      base-orphans-0.8.5-9CO98S38s8N9I6X76hRWN7 comonad-5.0.8-744cc826f3220db0d8f5a7b9fee88b6a5d39f9b5c6113023753865015fe87125
    (use -v for more information)

Digging a bit deeper, it looks like the comonad package fails to build:

  • cabal install --lib tidal:
17:43:11
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - comonad-5.0.8 (lib) (requires build)
 - bifunctors-5.5.11 (lib) (requires build)
 - tidal-1.7.10 (lib) (requires build)
 - tidal-1.7.10 (exe:tidal) (requires build)
Starting     comonad-5.0.8 (lib)
Building     comonad-5.0.8 (lib)

Failed to build comonad-5.0.8.
Build log (
/home/pln/.cabal/logs/ghc-9.0.2/comonad-5.0.8-36c18b4378167a729d889a82a069e1708eff5a3c62616dc2805642c8625c5585.log
):
Configuring library for comonad-5.0.8..
Preprocessing library for comonad-5.0.8..
Building library for comonad-5.0.8..
[ 1 of 15] Compiling Control.Comonad  ( src/Control/Comonad.hs, dist/build/Control/Comonad.o, dist/build/Control/Comonad.dyn_o )

src/Control/Comonad.hs:62:1: error:
    Could not find module ‘Data.Tagged’
    There are files missing in the ‘tagged-0.8.6.1’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
62 | import Data.Tagged
   | ^^^^^^^^^^^^^^^^^^
cabal: Failed to build comonad-5.0.8 (which is required by exe:tidal from
tidal-1.7.10). See the build log above for details.
  • cabal install --lib comonad:
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - comonad-5.0.8 (lib) (requires build)
Starting     comonad-5.0.8 (lib)
Building     comonad-5.0.8 (lib)

Failed to build comonad-5.0.8.
Build log (
/home/pln/.cabal/logs/ghc-9.0.2/comonad-5.0.8-36c18b4378167a729d889a82a069e1708eff5a3c62616dc2805642c8625c5585.log
):
Configuring library for comonad-5.0.8..
Preprocessing library for comonad-5.0.8..
Building library for comonad-5.0.8..
[ 1 of 15] Compiling Control.Comonad  ( src/Control/Comonad.hs, dist/build/Control/Comonad.o, dist/build/Control/Comonad.dyn_o )

src/Control/Comonad.hs:62:1: error:
    Could not find module ‘Data.Tagged’
    There are files missing in the ‘tagged-0.8.6.1’ package,
    try running 'ghc-pkg check'.
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
62 | import Data.Tagged
   | ^^^^^^^^^^^^^^^^^^
cabal: Failed to build comonad-5.0.8. See the build log above for details.
  • However, cabal install --lib tagged works fine:
cabal install --lib tagged                                                                                                                        17:43:55
cabaResolving dependencies...
Up to date

Anyone ever encountered a similar issue?

Looks like there is some dynamic black-magic at play here. I went through my shell history, remembered a time where I had to do cabal install --ghc-options=-dynamic bifunctors --reinstall --lib to solve an issue with bifunctor dependency.

And indeed, when I tried to reinstall with this ghc-options flag, it works better:

cabal install --ghc-options=-dynamic tagged --reinstall --lib                                                                                     17:44:15
Resolving dependencies...
Up to date

cabal install --ghc-options=-dynamic comonad --reinstall --lib                                                                                    17:44:24
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - transformers-compat-0.7.1 (lib) (requires build)
 - comonad-5.0.8 (lib) (requires build)
Starting     transformers-compat-0.7.1 (lib)
Building     transformers-compat-0.7.1 (lib)
Installing   transformers-compat-0.7.1 (lib)
Completed    transformers-compat-0.7.1 (lib)
Starting     comonad-5.0.8 (lib)
Building     comonad-5.0.8 (lib)
Installing   comonad-5.0.8 (lib)
Completed    comonad-5.0.8 (lib)

cabal install --ghc-options=-dynamic tagged --reinstall --lib                                                                                     17:44:36
Resolving dependencies...
Up to date

At that point, I tried running tidal again, no luck:

ghci                                                                                                                                              17:44:44
Loaded package environment from /home/pln/.ghc/x86_64-linux-9.0.2/environments/default
GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> import Sound.Tidal.Context

<no location info>: error:
    Could not load module ‘Sound.Tidal.Context’
    It is a member of the package ‘tidal-1.7.10-DUPgZBJWaIl6mejhl2wRjr’
    which is unusable due to missing dependencies:
      bifunctors-5.5.11-LVvQ4PbsonB4VIzLU1O7SN
ghci> exit

...and as now it complains about bifunctors, I did the same dynamic rebuilding for both it and tidal:

cabal install --ghc-options=-dynamic bifunctors --reinstall --lib                                                                                 17:45:43
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - bifunctors-5.5.11 (lib) (requires build)
Starting     bifunctors-5.5.11 (lib)
Building     bifunctors-5.5.11 (lib)
Installing   bifunctors-5.5.11 (lib)
Completed    bifunctors-5.5.11 (lib)
[~] cabal install --ghc-options=-dynamic tidal --reinstall --lib                                                                                      17:46:02
Resolving dependencies...
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - tidal-1.7.10 (lib) (requires build)
 - tidal-1.7.10 (exe:tidal) (requires build)
Starting     tidal-1.7.10 (lib)
Building     tidal-1.7.10 (lib)
Installing   tidal-1.7.10 (lib)
Completed    tidal-1.7.10 (lib)
Starting     tidal-1.7.10 (exe:tidal)
Building     tidal-1.7.10 (exe:tidal)
Installing   tidal-1.7.10 (exe:tidal)
Completed    tidal-1.7.10 (exe:tidal)
[~] ghci                                                                                                                                              17:47:52
Loaded package environment from /home/pln/.ghc/x86_64-linux-9.0.2/environments/default
GHCi, version 9.0.2: https://www.haskell.org/ghc/  :? for help
ghci> import Sound.Tidal.Context
ghci> *SUCCESS*

And after a little TidalCycles: reboot in atom, my installation's back and ready to rock! :metal:

I hope this can be useful to others :hugging_face:

1 Like