Git Product home page Git Product logo

halive's Introduction

██╗  ██╗ █████╗ ██╗     ██╗██╗   ██╗███████╗
██║  ██║██╔══██╗██║     ██║██║   ██║██╔════╝
███████║███████║██║     ██║██║   ██║█████╗
██╔══██║██╔══██║██║     ██║╚██╗ ██╔╝██╔══╝
██║  ██║██║  ██║███████╗██║ ╚████╔╝ ███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝  ╚══════╝

Live recompiler for Haskell

Halive Demo

Halive uses the GHC API to instantly recompile and reload your code any time you change it.

Usage: stack install halive

and then

halive <path/to/mymain.hs> <extra-include-dirs>

Any time you change a file in the current directory or its subdirectories, halive will recompile and rerun the main function in the file you gave it.

If the program is long-running (e.g. a daemon, GUI or game loop) it will be killed and restarted. Learn how to maintain state in the next section.

Try a live-coding GL demo by running:

# Grab the demo package and install the demo's dependencies - only need to do this once
stack unpack halive
cd halive-0.1.5
stack build --test --no-run-tests

# Now run Halive
halive demo/Main.hs

Changing values in Main.hs or Green.hs and saving should live-update the program.

Keeping values alive

To keep state alive, import Halive.Utils and wrap your value in reacquire along with a unique identifier, like:

win <- reacquire "win" (setupGLFW "HotGLFW" 640 480)

to only create the resource the first time you run the program, and then reuse it on subsequent recompilations.

You can see this in action in demo/Main.hs.

Thanks to Chris Done's foreign-store library for enabling this.

Watch custom file types for changes

By default, Halive will reload your code when files with the following extensions change: hs, pd, frag, vert.

If you have any other file type that you'd like to be watched by Halive, use the -f/--file-type option.

halive app/Main.hs -f html -f hamlet

Passing command-line arguments

To use Halive with haskell code that is expecting command-line arguments, separate the arguments to Halive and the arguments to the app with a -- such as:

halive <path/to/mymain.hs> <extra-include-dirs> -- <args-to-myapp>

Compiled Code

You can pass --compiled (or -c) to Halive to compile to faster object code.

This will be slower to recompile but faster to run.

Notes

Creating, updating, and deleting modules in the include path should work fine during a Halive session.

Halive supports Stack projects and Cabal sandboxes; if run within a directory containing a stack.yaml or cabal.sandbox.config file it will use the appropriate package databases when running the target.

Halive works nicely with either batch-processing or run-loop type programs — if the program finishes, it will be restarted on next save, and if it's still running, it will be killed and restarted on save.

To kill Halive during run-loop type programs, you may need to hold down Ctrl-C to get GHC to recognize the double-Control-C-kill sequence.

Halive works on Windows, Mac, and Linux

As a Library

Halive can also be integrated into your own project as a library in a few lines of code. See test/TestSubHalive.hs for an example. IMPORTANT: You must link your binary with ghc-options: -dynamic for this to work! Otherwise you'll get mysterious linking errors on Mac and Linux.

Troubleshooting

If Halive with GLFW segfaults on windows, try git clone -b win-halive-fix http://github.com/lukexi/bindings-GLFW and adding the folder you cloned it to to your project's stack.yaml in the packages section

@lukexi

halive's People

Contributors

gelisam avatar jargv avatar joshuahhh avatar lnl7 avatar lukexi avatar schell avatar zudov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

halive's Issues

Problem loading halive dynamic library

I'm getting an error on startup using the latest halive on hackage:

halive app/Main.hs src/ shaders/
dyld: Library not loaded: @rpath/libHShalive-0.1.2-1eAxOISDAIf2KiZ8BV0psF-ghc8.0.1.dylib
  Referenced from: /Users/schell/.local/bin/halive
  Reason: image not found
fish: 'halive app/Main.hs src/ shaders/' terminated by signal SIGTRAP (Trace or breakpoint trap)

Any thoughts?

Halive Can't Find Shared Libraries

Fresh project, using stack. Tiny scotty app. I install halive and run it stack install halive and halive src/Main.hs and I get the following:

halive: error while loading shared libraries: libHShalive-0.1.2-Ky2u3hrsJP5HmZWlprED0o-ghc8.0.2.so: cannot open shared object file: No such file or directory

Any thoughts? Maybe I need to run stack as sudo?

Not a valid Unicode code point!

I have an issue:

  1. I successfully build halive and it locate here
    /Users/jim/clone/halive/.stack-work/install/x86_64-osx/lts-8.2/8.0.2/bin/halive

  2. But when I build other haskell project with
    stack exec -- ghc --version
    The Glorious Glasgow Haskell Compilation System, version 8.2.2
    and try to run halive I got an error like this:
    /Users/jim/.stack/snapshots/x86_64-osx/lts-10.3/8.2.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (Not a valid Unicode code point!)

Can't install

stack install halive results in this

    Configuring halive-0.1.3...
    Preprocessing library for halive-0.1.3..
    Building library for halive-0.1.3..
    [1 of 6] Compiling Halive.Concurrent ( src\Halive\Concurrent.hs, .stack-work\dist\5c8418a7\build\Halive\Concurrent.o )
    [2 of 6] Compiling Halive.FileListener ( src\Halive\FileListener.hs, .stack-work\dist\5c8418a7\build\Halive\FileListener.o )
    [3 of 6] Compiling Halive.FindPackageDBs ( src\Halive\FindPackageDBs.hs, .stack-work\dist\5c8418a7\build\Halive\FindPackageDBs.o )

    src\Halive\FindPackageDBs.hs:33:7: error:
        Not in scope: `extraPkgConfs'
       |
    33 |     { extraPkgConfs =
       |       ^^^^^^^^^^^^^

    src\Halive\FindPackageDBs.hs:56:29: error:
        Not in scope: `extraPkgConfs'
       |
    56 |             return dflags { extraPkgConfs = (pkgs ++) . extraPkgConfs dflags }
       |                             ^^^^^^^^^^^^^

    src\Halive\FindPackageDBs.hs:78:29: error:
        Not in scope: `extraPkgConfs'
       |
    78 |             return dflags { extraPkgConfs = (pkgs ++) . extraPkgConfs dflags }
       |                             ^^^^^^^^^^^^^

    src\Halive\FindPackageDBs.hs:85:38: error:
        Not in scope: `extraPkgConfs'
       |
    85 |         [pkgconf] -> return dflags { extraPkgConfs = (PkgConfFile pkgconf :) . extraPkgConfs dflags }
       |                                      ^^^^^^^^^^^^^

OS Windows 10

Testsuite subhalive hangs on d2b91df8182d23fe3d0b7b1b2f885db07b7a6e06

Running 2 test suites...
Test suite demo: RUNNING...
MAIN BEGIN
demo: SDLCallFailed {sdlExceptionCaller = "SDL.Init.init", sdlFunction = "SDL_Init", sdlExceptionError = "No available video device"}
Test suite demo: FAIL
Test suite logged to: dist/test/halive-0.1.0.8-demo.log
Test suite subhalive: RUNNING...

Commit-id: d2b91df

Halive can't find cabal generated Paths

This might not be a bug so much as a misunderstanding. How do I tell halive about the Paths_my_exe module generated by cabal? I need this in order to access data files packaged with cabal.

src/Main.hs:14:8:
    Could not find module ‘Paths_gelatin_example’
    Use -v to see a list of the files searched for.

Novice problems running demo

The live coding and diagramming packages look interesting. Not being a Haskell person I could use a hand trying out your live coding system. My first step was to clone your repo. Then using "stack" (rather than "cabal install") I did "stack build." That command downloaded dependencies and built your halive executable. But I'm not able to successfully run the demo. When I type "halive demo/Main.hs" I get a bunch of "could not find module" errors for the included modules. Clearly the compiler's not looking in the right places for the required modules. I know this is my fault for not being a haskell programmer, and it probably has something to do with using stack (https://github.com/commercialhaskell/stack). By the way, the error messages about modules not being found come with a bunch of unprintable characters.

I'm running on an Ubuntu box. If you can advise on how I should modify the command line to point to the required Haskell modules/libraries, and also will I need to install libraries on my OS?

halive-0.1.0.0 does not compile

Citing from http://hydra.cryp.to/build/889395/log/raw:

Preprocessing executable 'halive' for halive-0.1.0.0...

exec/main.hs:1:8:
    Could not find module ‘Halive’
    Use -v to see a list of the files searched for.

exec/main.hs:2:8:
    Could not find module ‘Banner’
    Use -v to see a list of the files searched for.

It appears that the published release tarball is incomplete.

Support for more file extensions

Currently it looks like the supported file extensions for watching are hardcoded. I'd like to be able to supply a list of extra file formats to watch as a command-line argument (or just add more of them). The file format I'd like to watch right now is .hamlet files that are the templates in my webapp.

CPP statements cause error on startup

Hey there - it seems that when using halive the c preprocessor is erring at a (pretty common) macro in my program:

██╗  ██╗ █████╗ ██╗     ██╗██╗   ██╗███████╗
██║  ██║██╔══██╗██║     ██║██║   ██║██╔════╝
███████║███████║██║     ██║██║   ██║█████╗  
██╔══██║██╔══██║██║     ██║╚██╗ ██╔╝██╔══╝  
██║  ██║██║  ██║███████╗██║ ╚████╔╝ ███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝  ╚══════╝
                  engaged

src/Control/Varying/Spline.hs:105:21:
     error: token is not a valid binary operator in a preprocessor subexpression
#if MIN_VERSION_base(4,8,0)
    ~~~~~~~~~~~~~~~~^
1 error generated.

maybe I should be passing in some extra data on the command line? Or maybe CPP isn't supported yet? Compilation through stack is working, it's only halive that encounters the error.

`stb-image` -related failure with `lambdacube-quake3`

[nix-shell:~/src/lambdacube-quake3]$ cabal clean; cabal build; halive mapviewer/MapViewer.hs . ./dist/build/autogen/
cleaning...
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Warning: The package list for 'hackage.haskell.org' is 330 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Configuring lambdacube-quake3-0.1.0.0...
Building lambdacube-quake3-0.1.0.0...
Preprocessing library lambdacube-quake3-0.1.0.0...
[ 1 of 24] Compiling Paths_lambdacube_quake3 ( dist/build/autogen/Paths_lambdacube_quake3.hs, dist/build/Paths_lambdacube_quake3.o )
[ 2 of 24] Compiling GameEngine.Utils ( GameEngine/Utils.hs, dist/build/GameEngine/Utils.o )
[ 3 of 24] Compiling GameEngine.Graphics.Frustum ( GameEngine/Graphics/Frustum.hs, dist/build/GameEngine/Graphics/Frustum.o )
[ 4 of 24] Compiling GameEngine.Scene ( GameEngine/Scene.hs, dist/build/GameEngine/Scene.o )
[ 5 of 24] Compiling GameEngine.Loader.Image ( GameEngine/Loader/Image.hs, dist/build/GameEngine/Loader/Image.o )
[ 6 of 24] Compiling GameEngine.Loader.Zip ( GameEngine/Loader/Zip.hs, dist/build/GameEngine/Loader/Zip.o )
[ 7 of 24] Compiling GameEngine.Loader.Entity ( GameEngine/Loader/Entity.hs, dist/build/GameEngine/Loader/Entity.o )
[ 8 of 24] Compiling GameEngine.Data.Material ( GameEngine/Data/Material.hs, dist/build/GameEngine/Data/Material.o )
[ 9 of 24] Compiling GameEngine.Loader.ShaderParser ( GameEngine/Loader/ShaderParser.hs, dist/build/GameEngine/Loader/ShaderParser.o )
[10 of 24] Compiling GameEngine.Graphics.Storage ( GameEngine/Graphics/Storage.hs, dist/build/GameEngine/Graphics/Storage.o )
[11 of 24] Compiling GameEngine.Content ( GameEngine/Content.hs, dist/build/GameEngine/Content.o )
[12 of 24] Compiling GameEngine.Data.GameCharacter ( GameEngine/Data/GameCharacter.hs, dist/build/GameEngine/Data/GameCharacter.o )
[13 of 24] Compiling GameEngine.Loader.GameCharacter ( GameEngine/Loader/GameCharacter.hs, dist/build/GameEngine/Loader/GameCharacter.o )
[14 of 24] Compiling GameEngine.Data.MD3 ( GameEngine/Data/MD3.hs, dist/build/GameEngine/Data/MD3.o )
[15 of 24] Compiling GameEngine.Loader.MD3 ( GameEngine/Loader/MD3.hs, dist/build/GameEngine/Loader/MD3.o )
[16 of 24] Compiling GameEngine.Graphics.MD3 ( GameEngine/Graphics/MD3.hs, dist/build/GameEngine/Graphics/MD3.o )
[17 of 24] Compiling GameEngine.Graphics.GameCharacter ( GameEngine/Graphics/GameCharacter.hs, dist/build/GameEngine/Graphics/GameCharacter.o )
[18 of 24] Compiling GameEngine.Data.BSP ( GameEngine/Data/BSP.hs, dist/build/GameEngine/Data/BSP.o )
[19 of 24] Compiling GameEngine.Loader.BSP ( GameEngine/Loader/BSP.hs, dist/build/GameEngine/Loader/BSP.o )
[20 of 24] Compiling GameEngine.Graphics.Culling ( GameEngine/Graphics/Culling.hs, dist/build/GameEngine/Graphics/Culling.o )
[21 of 24] Compiling GameEngine.Graphics.BezierSurface ( GameEngine/Graphics/BezierSurface.hs, dist/build/GameEngine/Graphics/BezierSurface.o )
[22 of 24] Compiling GameEngine.Graphics.BSP ( GameEngine/Graphics/BSP.hs, dist/build/GameEngine/Graphics/BSP.o )
[23 of 24] Compiling GameEngine.RenderSystem ( GameEngine/RenderSystem.hs, dist/build/GameEngine/RenderSystem.o )
[24 of 24] Compiling GameEngine.Collision ( GameEngine/Collision.hs, dist/build/GameEngine/Collision.o )
Preprocessing executable 'q3mapviewer' for lambdacube-quake3-0.1.0.0...
[1 of 7] Compiling Items            ( mapviewer/Items.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Items.o )
[2 of 7] Compiling Content          ( mapviewer/Content.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Content.o )
[3 of 7] Compiling Entity           ( mapviewer/Entity.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Entity.o )
[4 of 7] Compiling Camera           ( mapviewer/Camera.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Camera.o )
[5 of 7] Compiling Paths_lambdacube_quake3 ( dist/build/autogen/Paths_lambdacube_quake3.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Paths_lambdacube_quake3.o )
[6 of 7] Compiling Engine           ( mapviewer/Engine.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Engine.o )
[7 of 7] Compiling Main             ( mapviewer/MapViewer.hs, dist/build/q3mapviewer/q3mapviewer-tmp/Main.o )
Linking dist/build/q3mapviewer/q3mapviewer ...
Preprocessing executable 'shooter' for lambdacube-quake3-0.1.0.0...
[1 of 9] Compiling Items            ( game/Items.hs, dist/build/shooter/shooter-tmp/Items.o )
[2 of 9] Compiling Visuals          ( game/Visuals.hs, dist/build/shooter/shooter-tmp/Visuals.o )
[3 of 9] Compiling Entities         ( game/Entities.hs, dist/build/shooter/shooter-tmp/Entities.o )
[4 of 9] Compiling Collision        ( game/Collision.hs, dist/build/shooter/shooter-tmp/Collision.o )
[5 of 9] Compiling LoadEntities     ( game/LoadEntities.hs, dist/build/shooter/shooter-tmp/LoadEntities.o )
[6 of 9] Compiling World            ( game/World.hs, dist/build/shooter/shooter-tmp/World.o )
[7 of 9] Compiling GameLogic        ( game/GameLogic.hs, dist/build/shooter/shooter-tmp/GameLogic.o )

game/GameLogic.hs:245:5: warning: [-Woverlapping-patterns]
    Pattern match is redundant
    In a case alternative: e -> ...
[8 of 9] Compiling RenderGame       ( game/RenderGame.hs, dist/build/shooter/shooter-tmp/RenderGame.o )
[9 of 9] Compiling Main             ( game/GameMain.hs, dist/build/shooter/shooter-tmp/Main.o )
Linking dist/build/shooter/shooter ...
██╗  ██╗ █████╗ ██╗     ██╗██╗   ██╗███████╗
██║  ██║██╔══██╗██║     ██║██║   ██║██╔════╝
███████║███████║██║     ██║██║   ██║█████╗
██╔══██║██╔══██║██║     ██║╚██╗ ██╔╝██╔══╝
██║  ██║██║  ██║███████╗██║ ╚████╔╝ ███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝  ╚══════╝
                  engaged
SubHalive recompiling: ("mapviewer/MapViewer.hs","main")
Caught exception during recompileExpressionInFile:
ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
  stbi_load_from_memory
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  [email protected]

************************* Compilation Errors, Waiting...      *************************

ByteCodeLink: can't find label
During interactive linking, GHCi couldn't find the following symbol:
  stbi_load_from_memory
This may be due to you not asking GHCi to load extra object files,
archives or DLLs needed by your current session.  Restart GHCi, specifying
the missing library using the -L/path/to/object/dir and -lmissinglibname
flags, or simply by naming the relevant files on the GHCi command line.
Alternatively, this link failure might indicate a bug in GHCi.
If you suspect the latter, please send a bug report to:
  [email protected]

^Chalive: thread killed

`default-extensions` from cabal file is not taken

With a new stack project, this code works fine with halive.

Lib.hs

{-# LANGUAGE TupleSections #-}
module Lib
    ( someFunc
    ) where

someFunc :: IO ()
someFunc = print $ (3,) 4

But when moving the language pragma from the source file to cabal settings like:

library
  hs-source-dirs:      src
  exposed-modules:     Lib
  ...
  default-extensions:  TupleSections

Despite stack build success, halive fails to compile saying:

************************* Compilation Errors, Waiting...      *************************

src/Lib.hs:6:20: error: Illegal tuple section: use TupleSections

Is there any way to make this work?
Maybe, a way of providing default extensions to halive?

I have tried this with the head of master of this repository (a1ddda4).

Thanks.

Inconsistent reloading on Linux

Hello,
I'm trying to use halive along with spacemacs on Ubuntu.
I observed a pretty odd frequence of reloading while typing :

  • Each time I type something in my .hs file, halive reloads, and it displays the output of the previous build.
  • When I finally save my file, halive reloads and I got the expected output, but I got it twice.

I tried to watch my file with inotifywait -e modify filename.hs to be sure that the modification only happens when I really save my file, and it works at expected.

Thanks for this useful tool, coming from node.js it's refreshing to find live-reloading in Haskell. 👍

Larger GIF demo

Great thinking to add the demo for halive. It's a little hard to see though and I don't think you're getting the full benefit with it being hard to see.

Halive not finding any installed libraries

$ halive src/Main.hs src
[stuff...]
src/StaticFiles/Delegated.hs:10:1: error:
    Failed to load interface for ‘Data.Text’
    Perhaps you meant Data.Set (from containers-0.5.7.1)
    Use -v to see a list of the files searched for.
src/StaticFiles/Delegated.hs:11:1: error:
    Failed to load interface for ‘Data.Text.Lazy’
    Perhaps you meant
      Data.Map.Lazy (from containers-0.5.7.1)
      Data.STRef.Lazy (from base-4.9.0.0)
    Use -v to see a list of the files searched for.
src/StaticFiles/Delegated.hs:12:1: error:
    Failed to load interface for ‘Data.Text.Lazy.Encoding’
    Use -v to see a list of the files searched for.
src/StaticFiles/Delegated.hs:15:1: error:
    Failed to load interface for ‘System.Process.ByteString.Lazy’
    Use -v to see a list of the files searched for.
$ ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /Users/jude/.dotfiles/ghci
λ import Data.Text
λ :t pack "foo"
pack "foo" ∷ Text

What's going on?

errors are printed twice

$ cat src/Main.hs
main :: IO ()
main = putStrLn "incomplete string
$ halive src/Main.hs src/
██╗  ██╗ █████╗ ██╗     ██╗██╗   ██╗███████╗
██║  ██║██╔══██╗██║     ██║██║   ██║██╔════╝
███████║███████║██║     ██║██║   ██║█████╗  
██╔══██║██╔══██║██║     ██║╚██╗ ██╔╝██╔══╝  
██║  ██║██║  ██║███████╗██║ ╚████╔╝ ███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝  ╚══════╝
                  engaged

src/Main.hs:2:35:
    lexical error in string/character literal at character '\n'

src/Main.hs:2:35:
    lexical error in string/character literal at character '\n'

This is important to me because I usually want to focus on the first error, which is now twice as far back in the history (I have a simple custom patch which prints "===" between runs so I can see where the first error is)

Fails on NixOS

For some reason, halive tries to open a GHC that doesn't exist. It's probably saving an incorrect path:

$ halive My/File.hs
██╗  ██╗ █████╗ ██╗     ██╗██╗   ██╗███████╗
██║  ██║██╔══██╗██║     ██║██║   ██║██╔════╝
███████║███████║██║     ██║██║   ██║█████╗  
██╔══██║██╔══██║██║     ██║╚██╗ ██╔╝██╔══╝  
██║  ██║██║  ██║███████╗██║ ╚████╔╝ ███████╗
╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═══╝  ╚══════╝
                  engaged
halive: /nix/store/mz4mmizf0h33q3sybibkp476a7ixkpq7-ghc-8.6.5-with-packages/lib/ghc-8.6.5/settings: openFile: does not exist (No such file or directory)
halive: thread blocked indefinitely in an MVar operation

stack build error in linux docker container

Here's the issue I'm struggling with right now:

appuser@8be60e71ef81:~/user/halive$ stack build
Building all executables for `halive' once. After a successful build of all of them, only specified executables will be rebuilt.
halive-0.1.6: build (lib + exe)
Preprocessing library for halive-0.1.6..
Building library for halive-0.1.6..
[5 of 8] Compiling Halive.SubHalive ( src/Halive/SubHalive.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Halive/SubHalive.o )

/app/user/halive/src/Halive/SubHalive.hs:248:17: error: parse error on input ‘#’
    |
248 |                 #else
    |                 ^


--  While building package halive-0.1.6 using:
      /app/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build lib:halive exe:halive --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

And my cpp :

appuser@8be60e71ef81:~/user/halive$ cpp --version
cpp (Ubuntu 7.3.0-16ubuntu3) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
appuser@8be60e71ef81:~/user/halive$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

It makes absolutely no sense to me (I unerstand the preprocessor is not doing its job correctly, but is it the cpp preprocessor, or the ghc one ?) if somebody's got any direction I'll take it ...

feature request: Add `ignore dir` command line arg

Use-case:
I have a project structured like so:

myproject
  \_ app
    \_ Main.hs
  \_ src
    \_ Lib.hs
  \_ test
    \_ test.hs

So if I do halive app/Main.hs, it gets reloaded on any change in the test dir, which should not happen - tests have no influence over the main app.

And if I do halive Main.hs from app dir, it doesn't get reloaded on changes in the src.

So having an ignore feature would allow me to exclude test files from restarting my app.

Btw, this project is super cool! Works really nice and extra fast reload.

Unable to `stack install` with GHC 8.6.3

❯ stack install halive
halive-0.1.3: configure
halive-0.1.3: build

--  While building package halive-0.1.3 using:
      /Users/daniel/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/daniel/Code/ppdd/.stack-work/logs/halive-0.1.3.log

    Configuring halive-0.1.3...
    Preprocessing library for halive-0.1.3..
    Building library for halive-0.1.3..
    [1 of 6] Compiling Halive.Concurrent ( src/Halive/Concurrent.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Halive/Concurrent.o )
    [2 of 6] Compiling Halive.FileListener ( src/Halive/FileListener.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Halive/FileListener.o )

    /private/var/folders/f0/s7rcj7gx6_7936b8mjbd23xr0000gn/T/stack73810/halive-0.1.3/src/Halive/FileListener.hs:43:5: error:
        • The constructor ‘Modified’ should have 3 arguments, but has been given 2
        • In the pattern: Modified path _
          In a case alternative: Modified path _ -> path == fileName
          In the expression:
            case event of
              Modified path _ -> path == fileName
              _ -> False
       |
    43 |     Modified path _ -> path == fileName
       |     ^^^^^^^^^^^^^^^

    /private/var/folders/f0/s7rcj7gx6_7936b8mjbd23xr0000gn/T/stack73810/halive-0.1.3/src/Halive/FileListener.hs:79:5: error:
        • The constructor ‘Modified’ should have 3 arguments, but has been given 2
        • In the pattern: Modified path _
          In a case alternative:
              Modified path _
                -> null fileTypes || drop 1 (takeExtension path) `elem` fileTypes
          In the expression:
            case event of
              Modified path _
                -> null fileTypes || drop 1 (takeExtension path) `elem` fileTypes
              _ -> False
       |
    79 |     Modified path _ -> null fileTypes || drop 1 (takeExtension path) `elem` fileTypes
       |     ^^^^^^^^^^^^^^^


❯ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1

❯ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.3

❯ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.3
BuildVersion:   18D109

Let me know if any other information would be helpful! 🙂

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.