Description
When running compilation from a nested directory (e.g., /lib/my-lib) with output set to the root using --output ../../output, the cache-db saves file paths relative to the current working directory.
This causes the cache to be invalidated when compilation is subsequently run from the root directory or from a differently nested directory, resulting in a full rebuild.
To Reproduce
- Navigate to a subdirectory within your project
- Compile with the output directory set at a higher level than the current working directory
- Observe that file paths in cache-db.json are relative to the current working directory (e.g., ../../.spago/some-root-dep)
- Run compilation from a different directory and observe that the cache is invalidated
Expected behavior
File paths could be stored relative to the location of cache-db.json - the output folder - rather than relative to the working directory from which compilation was run. This would ensure cache consistency regardless of where compilation is invoked.
PureScript version
0.15.15
Reactions are currently unavailable
Description
When running compilation from a nested directory (e.g., /lib/my-lib) with output set to the root using --output ../../output, the cache-db saves file paths relative to the current working directory.
This causes the cache to be invalidated when compilation is subsequently run from the root directory or from a differently nested directory, resulting in a full rebuild.
To Reproduce
Expected behavior
File paths could be stored relative to the location of cache-db.json - the output folder - rather than relative to the working directory from which compilation was run. This would ensure cache consistency regardless of where compilation is invoked.
PureScript version
0.15.15