Closed
Description
stack
will recompile packages when the root of a project is moved. This hinders use cases where, in a CI system, a big project is recompiled each time in a different directory, but one would still like to cache the .stack-work
directory to speed-up builds.
A possible solution is to use relative rather than absolute paths for directories that are at the same level or below the stack.yaml
file. Keep paths that are specified as absolute in the stack.yaml
file as absolute, and ditto for relative paths.
Steps to reproduce
- Go into any stack project, remove
.stack-work
directory. - Run command
stack build
- Stuff happens.
- Run command
stack build
again. - Nothing happens, because all the work has been done already.
- Go to parent directory. Rename the directory containing the stack project to something else.
- Go back into the stack project.
- Run
stack build
again.
Expected
Nothing happens, because there is no more work to do.
Actual
<project-name>-<project-version>: unregistering (switching from <old-dir-name> to <new-dir-name>)
Afterwards the entire project is recompiled.
Stack version
$ stack --version
Version 1.5.1 x86_64
Installed via stack upgrade
.