Skip to content

Avoid global caches (hie-bios, cabal) #160

@srid

Description

@srid

Can haskell-flake provide a default configuration that stores ~/.cache/cabal and ~/.cache/hie-bios in project-local (gitignore'ed) directories?

Why do we need this? These caches if corrupt or out of date can break the Haskell dev environment. HLS can stop working after macOS upgrade, for instance. To mitigate this "reproducibility" issue, we can configure all these build tools cache to be stored under project root:

{
        devShell.mkShellArgs.shellHook = ''
          export HIE_BIOS_CACHE_DIR=''${FLAKE_ROOT}/Backend/.hie-bios-cache
          export CABAL_DIR=''${FLAKE_ROOT}/Backend/.cabal-dir
        '';
}

Then people can simply run git clean -X to nuke these caches and start a fresh dev env.

But it does require using https://github.com/srid/flake-root and knowing which sub directory the haskell project is on (although the latter can be probably automated using projectRoot option).

At minimum we can document this as recommendation, rather than having haskell-flake do it automatically for users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions