Skip to content

Self-hosted incremental-build runner: writable state is shared between runs #5697

Open

Description

@anchapin

Follow-up to #5682 (review comment: #5682 (comment)).

The incremental-build job runs as root with read-write access to state that later runs reuse as-is:

  • the persistent source and build tree volume (ubuntu-2404, including .git)
  • the Conan home (conan-data-gha)
  • the runner's reused workspace (/__w)
  • the ccache store

Anything one run writes there carries into the next PR, push or dispatch run, and into the packages those runs upload. This does not depend on --privileged.

Closing it means not sharing writable state between PR runs, or rebuilding that state from a trusted run. Most of that is a runner-side decision for the admins.

Side note from the same comment: the actions/cache step on ~/.ccache restores nothing, because ccache 4 keeps its store in ~/.cache/ccache unless ~/.ccache already exists.

Activity

  1. anchapin commented on Nov 10, 2026

    @anchapin
    CollaboratorAuthor

    Proposed plan, to keep incremental-build speed without one PR run writing state the next one trusts:

    1. One trusted writer. Today incremental-build.yml runs only on pull_request, so every PR run writes the shared state the next PR reuses. Add a push: develop (or nightly) run that refreshes the Conan and ccache caches from merged, reviewed code. Only that run writes them.
    2. PR runs read only. PR runs mount the Conan home and the ccache store read-only. container.volumes accepts expressions, so the mount mode can switch on github.event_name.
    3. Throwaway build tree for PRs. PRs build in a fresh tree that is deleted after the run, instead of reusing the persistent ubuntu-2404 checkout (including its .git).

    Most of the speed should carry over: a PR usually changes a few files relative to develop, so nearly every compile should come from ccache and the dependencies from the Conan cache. The cost is a CMake configure and full link on every PR run (not measured yet).

    Order: the read-only mounts are only enforceable once job containers lose the host Docker socket (#5696) and stop running as root (#5698). Until then a job can work around them. So the sequence is #5696 → #5698 → this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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