You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Re-run the above command to build the executable. Observe that files are rebuilt despite that the lib2 sublibrary is not a dependency of bug-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.
@kostmo, thanks for reporting and for taking the time to create a minimal example.
What you are experiencing is an example of an long-standing issue/feature request known as 'component-based builds'. The most recent open issue pulling that together is:
In short, Stack currently approaches building in terms of 'packages (with components)' rather than 'components (of packages)'.
I am going to close this issue - not because it is unimportant but because I am seeking to consolidate matters related to component-based builds under a single 'master' issue.
Minimal testcase is here: https://github.com/kostmo/stack-sublibrary-rebuild
I am using
stack
version2.15.5
.To reproduce the bug
src2/Lib2.hs
and savelib2
sublibrary is not a dependency ofbug-repro-exe
.Equivalent cabal test
src2/Lib2.hs
and save"Up to date"
is printed.Potentially related issues
stack build
to target sub-libraries #6042The text was updated successfully, but these errors were encountered: