Workspace builds might not rebuild correctly when dependecies are updated
After !126 (merged) was landed, we realized that incremental workspace builds might not do the right thing in certain scenarios. Consider the following scenario:
- Element B depends on Element A
- User opens a workspace for B
- User builds B, so its workspace now has all the
.o
files and the underlying build system (make
for instance) will not rebuild it on subsequent builds - Now, the dependency A is updated so BuildStream will rebuild A and schedule B for rebuild too the next time one tries to build B
- Since A doesn't has a workspace associated with it, all the updated files in A will have a timestamp from 1970 within the sanbbox
- BuildStream will try to rebuild B but since it already has all the
.o
files will have a much newer timestamp than the header files form A, build systems likemake
won't do a rebuild
So to summarize, if the dependencies of a workspaced element are updated, they might not get rebuilt properly since the timestamps of all non-workspaced files will be ancient.
If someone comes across this issue, the immediate short-term solution would be to reset the workspace when your dependencies are updated. But we will probably need a better solution for the medium to long term. Perhaps we need a manifest of some sort but I'm not sure at present.
Edited by Chandan Singh