unison/development.markdown

41 lines
2.2 KiB
Markdown
Raw Normal View History

These are commands that will likely be useful during development.
2019-03-29 00:21:20 +03:00
__General:__ `./scripts/test.sh` compiles and builds the Haskell code and runs all tests. Recommended that you run this before pushing any code to a branch that others might be working on.
_Disclaimer_ If you have trouble getting started, please get in touch via [Slack](https://unisonweb.org/community) so we can help. If you have any fixes to the process, please send us a PR!
## Running Unison
To get cracking with Unison:
2019-03-29 00:46:39 +03:00
* [Install `stack`](https://docs.haskellstack.org/en/stable/README/#how-to-install).
* Build the project with `stack build`. This builds all executables.
2019-03-29 00:46:39 +03:00
* After building, `stack exec unison` will fire up the codebase editor, create a codebase in the current directory, and watch for `.u` file changes. If you want to run it in a different directory, just add `unison` to your `PATH`, after finding it with `find .stack-work -name unison -type f`. (For me, this finds two, they both work, but have different contents. ¯\\\_(ツ)\_/¯ )
* `stack exec tests` runs the tests
* `stack exec transcripts` runs all the integration tests, found in `unison-src/transcripts`. You can add more tests to this directory.
2019-03-29 00:46:39 +03:00
### What if you want a profiled build?
2019-03-29 00:46:39 +03:00
Do:
2019-03-30 01:02:36 +03:00
stack build --executable-profiling --library-profiling --ghc-options="-fprof-auto -rtsopts" unison-parser-typechecker
Again you can leave off the flag. To run an executable with profiling enabled, do:
stack exec -- <executable-name> +RTS -p
That will generate a `<executable-name>.prof` plain text file with profiling data. [More info on profiling](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html).
## Building with cabal
Unison can also be built/installed with cabal. You'll need ghc 8.6.x to
successfully build its dependencies.
* To configure the build, you can use e.g. `cabal v2-configure --with-ghc=ghc-8.6.5`
if you have multiple versions of GHC installed
* To build all projects use `cabal v2-build all`
* Tests can be run with e.g. `cabal v2-run parser-typechecker:tests`
* The executable can be installed with `cabal v2-install unison` the install
directory can be modified by setting `installdir: ...` or`install-dirs`
in `.cabal/config`