Qirky / Troop

Real-time Live Coding collaboration app
311 stars 37 forks source link

how to find tidal's data-dir (for BootTidal.hs) #47

Open jwaldmann opened 4 years ago

jwaldmann commented 4 years ago

recent ghc/cabal use "environment files", so that this does no longer works:

ghc-pkg field  tidal data-dir
==>
ghc-pkg: cannot find package tidal

and that's what I see after

python run-client.py --mode=TidalCycles

This works (source: https://github.com/tidalcycles/Tidal/blob/master/tidal.el#L69)

ghc-pkg field -f ~/.cabal/store/ghc-$(ghc --numeric-version)/package.db tidal data-dir
==>
data-dir: /home/waldmann/.cabal/store/ghc-8.8.3/tidal-1.4.8-bd176be4c94cf8efad3cce89b1e0cca21d9c99d367393ed31b94deb43da4f207/share

so how do I tell Troop about this?

Qirky commented 4 years ago

Can I check you use ghci or ghc for running Tidal? And for what version of Tidal? I checked out your branch and it didn't work for me but, tbf. the current code still works for my installation of Tidal (installed this morning) on Ubuntu 18.04

jwaldmann commented 4 years ago

With ghci.

I think this depends not so much on the version of Tidal but of ghc and cabal. My patch works for ghc-8.8.3, cabal-installl 3.0.0.0. This is the "new-style cabal" that had (has) the world confused, see also https://github.com/tidalcycles/Tidal/issues/572

Instead of patching Troop-client, there might be a work-around. I need to start ghci in this way:

ghci -ghci-script $(ghc-pkg field -f $HOME/.cabal/store/ghc-$(ghc --numeric-version)/package.db tidal data-dir | awk '{print $2}')/BootTidal.hs

I am trying

python run-client.py -H localhost -s tidalcycles -m $(which ghci) -a "-ghci-script $(ghc-pkg field -f $HOME/.cabal/store/ghc-$(ghc --numeric-version)/package.db tidal data-dir | awk '{print $2}')/BootTidal.hs"

hoping for $(which ghci) to be a "valid executable" but

When start the client as above, and I manually put the path to ghci in the GUI splash screen entry, then it works, but only for one-liners. (Troop is not sending :{ .. :} ?)