GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - kfigiela/stack-cache

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
README.md
README.md
 
 
StackCache.hs
StackCache.hs
 
 
package.yaml
package.yaml
 
 
post-checkout.example
post-checkout.example
 
 
stack-cache
stack-cache
 
 
stack-cache.cabal
stack-cache.cabal
 
 
stack.yaml
stack.yaml
 
 
stack.yaml.lock
stack.yaml.lock
 
 

Repository files navigation

Haskell Stack .stack-work cache management helper

Motivation

Switching branches often triggers significant rebuilds. While this is not an issue for small projects, it gets quite frustrating for larger codebases with long build times (such as half an hour).

Solution

Have separate .stack-work per branch. We'd also like to reuse existing cache for new branches – we copy cache from master branch using Copy-on-Write strategy available on APFS (macOS) and some Linux filesystems (e.g. btrfs).

Note: We could not use --work-dir Stack flag, since changing this also triggers rebuilds – this prevents from copying cache between branches.

As a bonus, we also exclude stack cache from Time Machine backups.

Setup

  1. Add stack-cache to $PATH

  2. Perform stack-cache init from the directory with stack.yaml

  3. Add post-checkout git hook to call stack-cache relink on branch change (with appropriate working directory)

  4. Make sure to ignore stack-cache directories:

git config --global core.excludesfile ~/.gitignore
echo .stack-work-cache >> ~/.gitignore
echo .stack-work >> ~/.gitignore
  1. Periodically run stack-cache clean-all to free some disk space

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

2 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.