commercialhaskell / commercialhaskell/stack
WISH: sandboxing and/or stashing of compilations when switching git branches
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
When I change back and forth between two git branches that may be distinct enough to require a large recompile for the project, I wish Stack would keep the compiled stuff around from each branch and use it accordingly. Thus, each branch would only need to compile the updates that are since the last compile of that branch rather than run a large recompile every time I switch.
Ideally, this would recognize that some files are totally unchanged and have unchanged dependencies among branches and somehow know to use that same compilation even when distinct files are sandboxed for each branch. That may not be feasible, but it would be the ideal.
Perhaps as a practical matter, a "save this branch compilation" function could be added so that even if the whole wish idea above is impossible or unrealistic to automate, I could decide myself that I want to effectively _stash_ a current compilation of the project, move to another branch, do whatever there, including recompiling, and then be able to go back to the first branch and _stash pop_ so-to-speak to get back the stashed compilation and not have to recompile.
Ideally, I could stash with a name, like using memory registers to have a few stashed compilations, but a single stash at first would still be a useful step. The multi-register stashing manually would be effectively a manual version of the automated per-branch operation. An intermediate would be to have the stashing be manual but still know to be tied to a particular git branch.
In the end, some sort of this working could end a lot of excessive recompiling for all Haskell development…
Contributor guide
Assessment
This issue has not been assessed yet.