Skip to content

Recc inside BuildStream #1751

@ghost

Description

BuildStream is a tool to execute full "package" builds, including awkward parts like configure scripts, stripping, integration commands, in a repeatable way using a sandbox. It can distribute these builds to build farm workers via the REAPI, at a granularity of one element => one worker. This means, that a large element like WebKit is only compiled on a single worker which can be slow.

Recc is a tool to distribute individual C/C++ compile tasks across build farm workers. At present, it cannot be used inside a BuildStream sandbox because it has no way to access the REAPI endpoint, but ... could we allow a controlled opening in the sandbox to enable Recc to be used inside element builds?

The ideal scenario would be a large element building as follows:

  1. bst build runs the element configure-commands on a single worker, with recc replacing cc etc.
  2. bst build runs the element build-commands:
    a. For each C/C++ compile operation, recc hashes the inputs for the given compile operation to produce a cache key, and checks the remote cache via configured REAPI endpoint
    b. If needed, compile is invoked on a remote worker. Then, the object file is downloaded from the cache.
  3. Link operations run on the main worker and still probably take ages to complete.
  4. Profit!

This is not guaranteed to be faster than building on a single node, a lot depends on the infrastructure being used and the element being built. I think it would be worth exploring as part of a larger project to try and reduce build times of large BuildStream projects like gnome-build-meta.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions