apache / apache/buildstream

Opening a workspace with a cached build

Open
#311 75 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
140
Forks
45
Avg merge
1d 3h
Merged PRs (30d)
6

Description

[See original issue on GitLab](https://gitlab.com/BuildStream/buildstream/-/issues/311)
In GitLab by [[Gitlab user @knownexus]](https://gitlab.com/knownexus) on Mar 21, 2018, 14:04

depends on #21

We need a way for a workspace to use a cached build instead of building a fresh one from sources.
E.G.

One could, for instance, desire to hack on WebKit and create a workspace using the last known build of the correct cache key, so after modifying some file, only part of the webkit build would have to run.

## Current Idea

### Override workspace if cached build found

At the point of opening a new workspace, check for an appropriate cached build tree created by that element and stage that in place of the elements sources.

If no cache found, continue as normal

Add the flag `--no-cache`: This will bypass the cache and create a workspace as normal

We should have some STATUS messages along the way informing the user what is being used.

#### Workspace special sauce

> When opening workspaces, the Source API has an opportunity to enhance things.
>
> This is mostly because we want to be sure that say, for a git source, the upstream origin is set to the real upstream, and not set to the local artifact cache from whence it was staged.

> For right now, it would be best that you implement the feature while bypassing init_workspace() completely, as a first step

> After that, we have to come up with a plan to address it, depending on how complex that plan is; we may merge the initial implementation "without the special init_workspace() sauce" and punt that part as an enhancement

> Or, we may block the patch on first fixing that so that it works nicely off the bat

Contributor guide

Open the contributing guide

Research direction

Start at the workspace-opening flow and read the Source API and init_workspace() discussion in the issue. Trace how a workspace currently selects sources and cached build trees, including the proposed --no-cache and STATUS behavior. Done means an appropriate cached build can seed a workspace, --no-cache preserves fresh creation, and source handling remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.