• Grégoire Locqueville's avatar
    README improvements · e947e2b9
    Grégoire Locqueville authored
    Various clarifications and reformulations based on my experience using
    the README to build and run Gargantext. In particular:
    - Information related to development has been given its own section
    - Docker Compose has been added to the list of prerequisites
    - Information pertaining to using Stack has been moved to an annex file
    - The content to be copypasted into a `cabal.project.local` file has been moved
      out of the README into a separate file `cabal.project.local_toCopy`
    
    Those may not be the best decisions, I am happy to discuss them if
    needed
    e947e2b9
using_stack.md 1.72 KB

Building Gargantext using the Stack tool

Those are the instructions for developers who wish to build Gargantext using stack instead of cabal.

Prerequisites

You need Stack (obviously). You can install it with:

curl -sSL https://get.haskellstack.org/ | sh

Check that the installation is complete with:

stack --version
Version 2.9.1

Building and setting up

To build with stack, follow the instructions in README.md, with the following changes:

  • Replace the cabal update and cabal install commands with (still from within a Nix shell!):
stack build --fast

Note: The default build (with optimizations) requires large amounts of RAM (16GB at least). The (recommended) --fast flag is here to avoid heavy compilation times and swapping out your machine; just omit it if you want to build with optimizations.

  • After you have run the docker compose up command, install with
stack install

Keeping the stack.yaml updated with the cabal.project

Once you have a valid version of stack, building requires generating a valid stack.yaml. This can be obtained by installing cabal2stack:

git clone https://github.com/iconnect/cabal2stack.git
cd cabal2stack

Then, depending on what build system you are using, either build with cabal install --overwrite-policy=always or stack install. And finally:

cabal2stack --system-ghc --allow-newer --resolver lts-21.17 --resolver-file devops/stack/lts-21.17.yaml -o stack.yaml
stack build

The good news is you don't have to do all of this manually; during development, after modifying cabal.project, it's enough to run:

./bin/update-project-dependencies