Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
srid opened this issue May 12, 2023 · 0 comments
Open

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

srid opened this issue May 12, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@srid
Copy link
Owner

srid commented May 12, 2023

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.

@srid srid added the question Further information is requested label May 12, 2023
@srid srid added the documentation Improvements or additions to documentation label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant