Closed
Description
Minimal testcase is here: https://github.com/kostmo/stack-sublibrary-rebuild
I am using stack
version 2.15.5
.
To reproduce the bug
- Build the executable:
stack build bug-repro:exe:bug-repro-exe
- Then repeat to ensure all targets are up-to-date.
- Insert a newline into
src2/Lib2.hs
and save - Re-run the above command to build the executable. Observe that files are rebuilt despite that the
lib2
sublibrary is not a dependency ofbug-repro-exe
.
Equivalent cabal test
- Build the executable:
cabal build bug-repro:exe:bug-repro-exe
- Then repeat to ensure all targets are up-to-date.
- Insert a newline into
src2/Lib2.hs
and save - Re-run the above command to build the executable. Observe nothing is rebuilt; only
"Up to date"
is printed.