turion / essence-of-live-coding-tutorial

Tutorial for essence-of-live-coding
BSD 3-Clause "New" or "Revised" License
16 stars 4 forks source link

"unknown command ':livereload'" #15

Open reubenharry opened 1 year ago

reubenharry commented 1 year ago

(Running on ubuntu)

Installation works, and cabal run essence-of-live-coding-tutorial works as expected, but run I run ghcid, I see "unknown command ':livereload'", and no gloss window appearing (or localhost running).

Is this a known issue?

turion commented 1 year ago

Do you do nix-shell first? Or do you install the dependencies differently?

I have different problems...

$ ghcid
Loading cabal repl ...
Warning: The package list for 'hackage.haskell.org' is 53 days old.
Run 'cabal update' to get the latest list of available packages.
Warning: Parsing the index cache failed (Data.Binary.Get.runGet at position
16: Non-matching structured hashes: f46da61e7afa58a5e8fd1d2b6fb79899;
expected: a257ca064dfb5e0cb74f74e64a975b9e). Trying to regenerate the index
cache...
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
 - essence-of-live-coding-tutorial-0.2.4 (exe:essence-of-live-coding-tutorial) (first run)
Configuring executable 'essence-of-live-coding-tutorial' for essence-of-live-coding-tutorial-0.2.4..
Preprocessing executable 'essence-of-live-coding-tutorial' for essence-of-live-coding-tutorial-0.2.4..
GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/turion/haskell/essence-of-live-coding-tutorial/.ghci
[1 of 1] Compiling Main             ( Main.hs, interpreted )
Ok, one module loaded.
Command "cabal repl" exited unexpectedly with error message:

(Yes, no error message follows.)

$ cabal repl
Warning: The package list for 'hackage.haskell.org' is 53 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
 - essence-of-live-coding-tutorial-0.2.4 (exe:essence-of-live-coding-tutorial) (first run)
Preprocessing executable 'essence-of-live-coding-tutorial' for essence-of-live-coding-tutorial-0.2.4..
GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/turion/haskell/essence-of-live-coding-tutorial/.ghci
[1 of 1] Compiling Main             ( Main.hs, interpreted )
Ok, one module loaded.
*Main LiveCoding LiveCoding.GHCi> 
Leaving GHCi.

cabal run and cabal repl fail:

$ cabal repl
Build profile: -w ghc-8.8.4 -O1
In order, the following will be built (use -v for more details):
 - essence-of-live-coding-tutorial-0.2.4 (exe:essence-of-live-coding-tutorial) (ephemeral targets)
Preprocessing executable 'essence-of-live-coding-tutorial' for essence-of-live-coding-tutorial-0.2.4..
GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/turion/haskell/essence-of-live-coding-tutorial/.ghci
[1 of 1] Compiling Main             ( Main.hs, interpreted )
Ok, one module loaded.
*Main LiveCoding LiveCoding.GHCi> :live
:liveinit    :livelaunch  :livereload  :livestep    :livestop
*Main LiveCoding LiveCoding.GHCi> :live
:liveinit    :livelaunch  :livereload  :livestep    :livestop
*Main LiveCoding LiveCoding.GHCi> :livelaunch 
*Main LiveCoding LiveCoding.GHCi> freeglut (<interactive>):  ERROR:  Internal error <FBConfig with necessary capabilities not found> in function fgOpenWindow
cabal: repl failed for exe:essence-of-live-coding-tutorial from
essence-of-live-coding-tutorial-0.2.4.

But I think I can get rid of all these problems by switching to flakes.

turion commented 1 year ago

@reubenharry can you try https://github.com/turion/essence-of-live-coding-tutorial/pull/16?

reubenharry commented 1 year ago

I'm a nix novice, but I took this to mean:

  1. Run `nix develop --extra-experimental-features 'flakes nix-command'
  2. Run ghcid

Doing that didn't throw an error, but I still don't see the gloss window appear, and see the unknown command message

turion commented 1 year ago

What happens if you do nix develop (plus extra stuff you figured out) and then cabal repl? Can you do :livelaunch and then :livereload? Maybe there is an error message on the way there that gets suppressed by ghcid?

reubenharry commented 1 year ago

I get: unknown command ':livelaunch' and same for livereload.