Trouble installing the Tidal Library and potentially Haskell

I'm totally new to installing programs via Powershell and have had some trouble getting TidalCycles to work.

After installing through Automatic installation I had trouble booting TidalCycles from Atom. It came up with:

error:
    Could not find module `Sound.Tidal.Context'
    It is not a module in the current program, or in any known package.

After finding this issue I went to the troubleshoot page and followed the instructions in order. To begin with, I don't believe Haskell was fully installed so followed the installation process here: GHCup. I actually ended up following this process twice as I had tried to uninstall Haskell and other Tidal programs to start again today - I'm not sure if that could also be causing a problem.

Anyway, GHCI returned with a version number after this, so I ran this command suggested.

ghci> import Sound.Tidal.Context

<no location info>: error:
    Could not find module `Sound.Tidal.Context'
    It is not a module in the current program, or in any known package.

Same error as in Atom. So I need to install the Tidal library again.

I perform cabal v2-update with no errors.

Then I got stuck here:

C:\Users\caleb>cabal new-install tidal --lib
Resolving dependencies...
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
 - network-3.1.2.5 (lib:network) (requires build)
 - hosc-0.19.1 (lib) (requires build)
 - tidal-1.7.8 (lib) (requires build)
Starting     network-3.1.2.5 (all, legacy fallback)

Failed to build network-3.1.2.5. The failure occurred during the configure
step.
Build log (
C:\cabal\logs\ghc-9.2.1\network-3.1.2.5-ac6adcfc0ca9db361f8b37d5f2d5756e8a3744e3.log
):
Configuring network-3.1.2.5...
cabal.exe: The package has a './configure' script. If you are on Windows, This
requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. If you
are not on Windows, ensure that an 'sh' command is discoverable in your path.

cabal.exe: Failed to build network-3.1.2.5 (which is required by tidal-1.7.8).
See the build log above for details.

The error suggests getting a hold of MinGW+MSYS which installed during my full Haskell installation. I also installed all the packages for MinGW+MSYS here: Installing MinGW & MSYS on Windows - Genome Analysis Wiki

However, every time I run 'cabal V2-Install tidal' (or cabal new-install tidal --lib) I still run into the same error, and I'm not really sure where to go from here. I'm guessing my Haskell install doesn't work properly for some reason?

The Chocolatey package is not up to date at present. I have a PR waiting which updates it, but the SuperCollider package needs to be updated first.

To install Tidal Cycles from where you're at, try running cabal v1-install tidal.

Thank you for that - it seems to have progressed things but I'm still running into errors.
No luck on Atom after receiving this in Terminal:

C:\Users\caleb>cabal v1-install tidal
Resolving dependencies...
Starting     data-binary-ieee754-0.4.4
Starting     clock-0.8.2
Starting     indexed-traversable-0.1.2
Starting     th-abstraction-0.4.3.0
Starting     base-orphans-0.8.6
Starting     splitmix-0.1.0.4
Starting     transformers-compat-0.7.1
Starting     tagged-0.8.6.1
Starting     colour-2.3.6
Starting     blaze-builder-0.4.2.2
Starting     network-3.1.2.5
Starting     primitive-0.7.3.0
Building     transformers-compat-0.7.1
Building     clock-0.8.2
Building     splitmix-0.1.0.4
Building     indexed-traversable-0.1.2
Building     base-orphans-0.8.6
Building     th-abstraction-0.4.3.0
Building     colour-2.3.6
Building     data-binary-ieee754-0.4.4
Building     tagged-0.8.6.1
Failed to install network-3.1.2.5
Build log ( C:\cabal\logs\ghc-9.2.1\network-3.1.2.5-9l2dFurXMjb8j342YjkPVB.log ):
Configuring network-3.1.2.5...
cabal.exe: The package has a './configure' script. If you are on Windows, This
requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. If you
are not on Windows, ensure that an 'sh' command is discoverable in your path.

cabal: Leaving directory 'C:\Users\caleb\AppData\Local\Temp\cabal-tmp-11250\network-3.1.2.5'
Building     primitive-0.7.3.0
Building     blaze-builder-0.4.2.2
Completed    base-orphans-0.8.6
Completed    data-binary-ieee754-0.4.4
Completed    tagged-0.8.6.1
Completed    transformers-compat-0.7.1
Completed    indexed-traversable-0.1.2
Completed    th-abstraction-0.4.3.0
Completed    colour-2.3.6
Completed    splitmix-0.1.0.4
Completed    blaze-builder-0.4.2.2
Completed    clock-0.8.2
Completed    primitive-0.7.3.0
cabal.exe: Error: some packages failed to install:
hosc-0.19.1-4jj8Av7KULg1HQBiDxHjEW depends on hosc-0.19.1 which failed to
install.
network-3.1.2.5-9l2dFurXMjb8j342YjkPVB failed during the configure step. The
exception was:
ExitFailure 1
tidal-1.7.8-ImGpyKFiHAg5Kp2Jbm9gJL depends on tidal-1.7.8 which failed to
install.

Oh my apologies, I should have been clear that cabal commands should be called from an msys2 shell.

Ah got you - cabal isn't recognised on the Msys2 shell so I'm attempting to build GHC in Msys2 but now i'm stuck at step 3 of these instructions: windows · Wiki · Glasgow Haskell Compiler / GHC · GitLab

Here's what i'm getting:

$ curl libtool automake python python3 p7zip patch ca-certificates
curl: (6) Could not resolve host: libtool
curl: (6) Could not resolve host: automake
curl: (6) Could not resolve host: python
curl: (6) Could not resolve host: python3
curl: (6) Could not resolve host: p7zip
curl: (6) Could not resolve host: patch
curl: (6) Could not resolve host: ca-certificates

I understand I might need to take this issue elsewhere since we're no longer talking about TidalCycles - but thought i'd post here in case you know anything.

Thanks for your help so far! :slight_smile:

If you already have cabal installed on your system, you just have to add it to your $PATH in msys2. Alternatively, you can cd to the directory containing cabal.exe and execute the command directly there.

Okay so MSYS2 finally recognises cabal commands and I can perform an update. I'm not sure what happened but I got a response telling me Cabal.exe was missing from a certain folder so I moved the Cabal folder into the directory it specified and things seemed to work from there.

On to a new problem though, when running cabal v1-install tidal I get:

cabal.exe: The program 'ghc' version >=7.0.1 is required but it could not be
found.

I'm guessing I now need to get ghc in to the correct directory also, but I don't seem to be able to locate it, I did an install of ghc.7.0.1 and moved the folder into the same directory I had put cabal, but no luck.