Trouble setting up Tidal – stack install

Hi there !
I am very new to Tidal and Haskell in general, and I am having trouble installing Tidal for the first time (MacOS 10.9).

I tried installing tidal the bootstrap way, which failed installing cabal. I always got "Failed to create temporary directory" when trying ghcup cabal-install.
So I then tried to install tidal with stack. It seemed to work normally, I changed the GHCI path in the Atom plugin to : stack exec ghci -- as discussed here. But Tidal won’t boot.
I tried troubleshooting but import Sound.Tidal.Context gives me the following error : Could not find module ‘Sound.Tidal.Context’.
Furthermore, tidal is not listed in stack exec ghc-pkg list. I checked the detail of that list, and the list doesn’t include the snapshot where stack installed tidal.

Any advice on how to solve this ? Thank you !

Hi @WQT, that’s a shame that the bootstrap didn’t work. Could you share the full error log of running cabal v2-install tidal --lib please? I haven’t seen this error before.

There have been changes to the atom plugin recently that could be the issue with running stack. I’ll look into this.

1 Like

Sorry, I meant cabal v2-install tidal --lib
(edited previous message now)
You might need to run this sequence of commands:

. "$HOME/.ghcup/env"
cabal v2-update
cabal v2-install tidal --lib
1 Like

Thank you so much for looking into this !
My problem is I can’t even install cabal. So cabal v1-install tidal --lib gives me
-bash: cabal: command not found.
When I tried to install cabal with ghcup it kept failing with this error :

...~myusername$ ghcup install-cabal
Installing cabal-install-3.0.0.0 into "/Users/myusername/.ghcup/bin"
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
mktemp [-d] [-q] [-u] -t prefix
Failed to create temporary directory

That is why I tried to install tidal with stack instead.

Hmm, ghcup should come with cabal. I updated my previous comment, did you try with those three commands?

1 Like

Apparently I have only ghcup without cabal, the installation might have failed partway.
And yes I have tried it with . "$HOME/.ghcup/env", still getting the same cabal error.

Ah OK, you could try running the instructions here again: https://www.haskell.org/ghcup/

I did, got the following error :

Installing GHC-8.6.5 for Darwin on architecture x86_64
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
mktemp [-d] [-q] [-u] -t prefix
Failed to create temporary directory
"ghcup --cache install" failed!

@WGT Ah, I see.

Could you try just doing this please: mktemp -d

That’s the command that the script is trying to run. I think that command shouldn’t normally fail.

usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
mktemp [-d] [-q] [-u] -t prefix
No error message

Thanks, I think we have uncovered a bug in the ghcup installation script. Am I right that your MacOS installation is a little old?

You are absolutely right about that ! I can’t update to a more recent OS due to a few things I have on this thare are compatible up to 10.9 only.
Does that mean I can’t install Tidal on 10.9 ? If so sorry if I have wasted your time.

No you’re not wasting time! You’ve uncovered a bug in the Haskell install. I’ve proposed a fix to the haskell people https://github.com/haskell/ghcup/pull/101/commits/1dee527e9eb4954b8595ba7d7175bdea7370c049

Just working out how you can test this…

1 Like

Ok try this @WQT:

curl https://raw.githubusercontent.com/yaxu/ghcup/patch-1/ghcup  -o ~/.ghcup/bin/ghcup
chmod u+x .ghcup/bin/ghcup 
ghcup --cache install
ghcup set
ghcup --cache install-cabal

(ignore the colour highlighting, just paste those lines in, probably best to paste them in line-by-line, waiting for them to run each time)

Thank you !

I tried your previous commands, it worked until the last one failed again
ghcup --cache install-cabal
same error as before : Failed to create temporary directory

Hm, does this work?

mktemp -d -t ghcup.XXXXXXXX

Or this?

~/.ghcup/bin/ghcup --cache install-cabal

This one does

And this one fails. How strange

Ah my fault I think, one sec

Ok, try running this again:

curl https://raw.githubusercontent.com/yaxu/ghcup/patch-1/ghcup  -o ~/.ghcup/bin/ghcup
chmod u+x .ghcup/bin/ghcup 
ghcup --cache install
ghcup set
ghcup --cache install-cabal
1 Like