👍🎉 First off, thanks for taking the time to contribute! 🎉👍
This project and everyone participating in it is governed by the Contributor Covenant Code of Conduct.
TL;DR: Use nix develop, but you may be able to scrape by with cargo.
A standard Rust installation with cargo is sufficient to build
ghciwatch. If you're new to Rust, check out Rust for
Haskellers.
To run tests, you'll need Nix/Lix installed. Run nix develop to enter a development shell with all the dependencies
available and then use cargo nextest run to run the tests (including the
integration tests) with cargo-nextest. (cargo test will work,
too, but slower.)
You can run the tests with coverage output with cargo llvm-cov nextest.
it is possible to display coverage information in VSCode, with cargo llvm-cov --lcov --output-path lcov.info.
Running the tests outside of Nix is generally not supported, but may be
possible. You'll need a Haskell installation including GHC, cabal, and
hpack. If you'd like to run the tests with (e.g.) GHC 9.6.5 and 9.8.2, run
GHC="9.6.5 9.8.2" cargo nextest run. The test suite will expect to find
executables named ghc-9.6.5 and ghc-9.8.2 on your $PATH.
Rust makes it easy to ship static binaries. Rust also shares many features with
Haskell: a Hindley-Milner type system with inference, pattern matching,
and immutability by default. Rust can also interoperate with
Haskell, so in the future we'll be able to ship ghciwatch as a
Hackage package natively. Also, Rust's commitment to stability makes coping
with multiple GHC versions and GHC upgrades easy. Finally, Rust is home to the
excellent cross-platform and battle-tested notify library, used to
implement the watchexec binary and cargo-watch, which solves a
lot of the thorny problems of watching files for us.