[BuildStream] Workspaces from CAS



There's been significant discussion about how to handle workspaces going
forward [0]. One of the directions that has emerged is staging
workspaces from the CAS. This would also be beneficial in the longer
term for supporting remote builds. The basic sketch for workspace builds
would change to:

* import all sources from workspace into CAS (optimized with inode-based
index file)
* stage dependencies from CAS: if last-build is set then check dep cache
keys
  - if keys are changed then diff the staged dependency tree with the
dependency tree from the previous workspace build. Set old timestamps
for unmodified files. Apply diffs to modified files and stage those.
* run integration commands
* stage sources from CAS: if last-build is set then check source cache keys
  - if keys are changed then mtime-aware diff current and cached. apply
that diff on top of the old buildtree, and then stage that
* run configure and build commands
* regardless of whether the build is successful:
  - store staged dependencies (whole sysroot) in CAS incl. timestamps
  - store buildtree in CAS incl. timestamps (always, overriding
buildtree user config)
  - store new artifact cache key in workspace yaml file and set
last-build field

* ideas for tests:
  - build workspace:
    * check local CAS for all files before build
    * check CAS buildtree for object files and that these are not
present in the workspace


 I think it makes sense to focus on supporting this for local builds
first. There are still some open questions around performance and how
best to handle file attributes in CAS: it's been suggested that the CAS
directory proto might be extended to support that but that this would be
an upstream divergence. The other obvious solution to that in the
short-term would be to commit an inode-like index file to the local CAS
which holds that information. I'd like input from the list on this
please since it will comprise non-trivial changes.

best regards,
Darius

[0] https://gitlab.com/BuildStream/buildstream/issues/985





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]