From 80518a107823f35653861e218f2b0d97db978315 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 25 Nov 2026 08:35:52 +0100 Subject: [PATCH 1/2] docs: the README names the Quest 2's branch hollywood/7.2 --- .github/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/README.md b/.github/README.md index f90fac442352..d339c0658620 100644 --- a/.github/README.md +++ b/.github/README.md @@ -14,6 +14,7 @@ tag by commit and file hashes. | `common/7.2` | fixes any headset on Valve's tree can meet, and this repository's CI (`.github/`) | | `sm8250/7.2` | the Snapdragon XR2's (SM8250) blocks | | `phoenix/7.2` | the PICO 4 ([overpressure/phoenix](https://github.com/overpressure/phoenix)): its drivers, device tree, `arch/arm64/configs/pico4.config` and driver tests; the default branch | +| `hollywood/7.2` | the Meta Quest 2 ([overpressure/hollywood](https://github.com/overpressure/hollywood)): its drivers, device tree and configuration, on `sm8250/7.2`; it joins [`.github/layers`](layers) and is built once overpressure/hollywood has its `kernel/build-tree.sh` | [`.github/layers`](layers) lists each branch and the branch it takes its changes from. A headset's branch is named after its repository, `overpressure/`, whose `kernel/build-tree.sh` builds it; the PICO 4's layers are From 88f0b7d40c8cb226cde0b8efeee9f72d6704a994 Mon Sep 17 00:00:00 2001 From: Xenolphthalein <21215869+Xenolphthalein@users.noreply.github.com> Date: Wed, 25 Nov 2026 08:42:36 +0100 Subject: [PATCH 2/2] ci: hollywood/7.2 joins the layers: one Build judges all of a branch's layer pull requests, and a headset's branch without kernel/build-tree.sh yet builds nothing and passes --- .github/README.md | 15 ++++++++------- .github/layers | 1 + .github/scripts/headsets.sh | 11 ++++++++++- .github/scripts/layers.sh | 33 ++++++++++++++++++++++----------- .github/workflows/build.yml | 20 +++++++++++++------- 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/.github/README.md b/.github/README.md index d339c0658620..fefd7dbcb6cc 100644 --- a/.github/README.md +++ b/.github/README.md @@ -14,7 +14,7 @@ tag by commit and file hashes. | `common/7.2` | fixes any headset on Valve's tree can meet, and this repository's CI (`.github/`) | | `sm8250/7.2` | the Snapdragon XR2's (SM8250) blocks | | `phoenix/7.2` | the PICO 4 ([overpressure/phoenix](https://github.com/overpressure/phoenix)): its drivers, device tree, `arch/arm64/configs/pico4.config` and driver tests; the default branch | -| `hollywood/7.2` | the Meta Quest 2 ([overpressure/hollywood](https://github.com/overpressure/hollywood)): its drivers, device tree and configuration, on `sm8250/7.2`; it joins [`.github/layers`](layers) and is built once overpressure/hollywood has its `kernel/build-tree.sh` | +| `hollywood/7.2` | the Meta Quest 2 ([overpressure/hollywood](https://github.com/overpressure/hollywood)): its drivers, device tree and configuration, on `sm8250/7.2`; built once overpressure/hollywood has its `kernel/build-tree.sh`, until then its pushes and pull requests build nothing and pass | [`.github/layers`](layers) lists each branch and the branch it takes its changes from. A headset's branch is named after its repository, `overpressure/`, whose `kernel/build-tree.sh` builds it; the PICO 4's layers are @@ -29,7 +29,7 @@ by such pull requests with a passing `ci` check, `valve/7.2` only move forward, | Workflow | When | What | | --- | --- | --- | | [Valve](workflows/valve.yml) | Mondays 05:23 UTC, and by hand | moves `valve/7.2` forward to Valve's newest commit ([scripts/valve.sh](scripts/valve.sh)) and starts Layers for it; a rewritten Valve branch fails the run. A schedule runs only from the default branch's copy | -| [Layers](workflows/layers.yml) | a push to a layer, and by hand | opens a pull request from the branch into every layer built on it that lacks its commits, unless one is open, and starts its Build ([scripts/layers.sh](scripts/layers.sh)) | +| [Layers](workflows/layers.yml) | a push to a layer, and by hand | opens a pull request from the branch into every layer built on it that lacks its commits, unless one is open, and starts one Build for them ([scripts/layers.sh](scripts/layers.sh)) | | [Build](workflows/build.yml) | pull requests, pushes to a headset's branch, tags, and the Layers workflow's runs for its pull requests | builds each headset's kernel; for a pull request into a layer without a headset, every headset's branch built on it with the pull request merged in; lints the scripts and workflows; releases tags. Its `ci` job is the required check | Each week, after the Valve workflow: review and merge its pull request into `common/7.2`, then the pull requests that @@ -64,11 +64,12 @@ tag, its own release checklist verifies it on the hardware (phoenix's ## The layers' pull requests Layers opens its pull requests with the workflow's own token, and a pull request opened with it starts no workflow. -So Layers starts each one's Build itself: a run on the pull request's base branch with `head` set to the branch -that moves up (`valve/7.2` among them, whose tree has no workflows). It builds every headset's branch on that base -with `head` merged in, and sets the status `ci` on `head`'s commit, the check the pull request waits for. Its own -gate job is named `verdict for `: that run belongs to the base's commit, which another pull request may have -as its head. +So Layers starts their Build itself: one run with `head` set to the branch that moves up, on that branch, or on its +one layer for `valve/7.2`, whose tree has no workflows. It builds every headset's branch built on it with `head` +merged in, and sets the status `ci` on `head`'s commit, the check its pull requests wait for. All of a branch's +pull requests (`sm8250/7.2` into `phoenix/7.2` and into `hollywood/7.2`) have that commit as their head and share +its status, so one run judges them all; a run per pull request would let the quickest one's verdict stand for the +others. Its own gate job is named `verdict for `, so that the run's own check never stands for the status. Each content is built once. A check of a change is keyed by the kernel's sources (the tree without `.github/`, so a change to the CI alone builds nothing new), so the layers' pull requests find the build of the pull request that diff --git a/.github/layers b/.github/layers index 32ab719c0332..ddf774968961 100644 --- a/.github/layers +++ b/.github/layers @@ -5,3 +5,4 @@ valve/7.2 common/7.2 common/7.2 sm8250/7.2 sm8250/7.2 phoenix/7.2 +sm8250/7.2 hollywood/7.2 diff --git a/.github/scripts/headsets.sh b/.github/scripts/headsets.sh index f937c2447b68..c957a5df59d9 100755 --- a/.github/scripts/headsets.sh +++ b/.github/scripts/headsets.sh @@ -5,7 +5,8 @@ # headsets.sh [--self] REF # # REF is a branch or tag of this repository. When its first part names a headset (a repository -# / with kernel/build-tree.sh), that headset is built from the run's own commit. +# / with kernel/build-tree.sh), that headset is built from the run's own commit; a +# headset's branch whose repository has no kernel/build-tree.sh yet builds nothing (an empty list). # Otherwise REF is a layer: every headset's branch built on it (.github/layers, followed upward) is # built with the run's commit merged in. --self refuses a layer: a push builds only a headset's own # branch or tag. Prints a JSON list of {device, branch, merge, recipe}, recipe being the commit of the @@ -34,6 +35,14 @@ if [ -n "$sha" ]; then entry "${ref%%/*}" "$ref" false "$sha" | jq -cs . exit 0 fi +# A headset's branch (no layer takes its changes from it) whose repository has no kernel/build-tree.sh +# yet: nothing to build, which is no failure; build.yml's gate passes an empty list. +if ! grep -v '^#' "$layers" | awk '{print $1}' | grep -qxF "$ref" \ + && gh api "repos/$owner/${ref%%/*}" --silent 2>/dev/null; then + echo "$ref: $owner/${ref%%/*} has no kernel/build-tree.sh yet: nothing to build" >&2 + echo '[]' + exit 0 +fi if $self; then echo "$ref is a layer without a headset: a push to it builds nothing (build.yml's push branches leave it out)" >&2 exit 1 diff --git a/.github/scripts/layers.sh b/.github/scripts/layers.sh index becded546c68..5e3417bb2c90 100755 --- a/.github/scripts/layers.sh +++ b/.github/scripts/layers.sh @@ -6,9 +6,12 @@ # # For every layer that takes its changes from FROM (.github/layers) and lacks some of FROM's commits, # a pull request from FROM into it, unless one is open. A pull request opened with the workflow's own -# token (GH_TOKEN) starts no workflow, so this starts its Build: a run on the layer with head=FROM, which -# builds every headset whose branch is the layer or built on it with FROM merged in and sets the status ci -# on FROM's commit (.github/workflows/build.yml). It is merged with a merge commit, and its merge moves the +# token (GH_TOKEN) starts no workflow, so this starts their Build: one run with head=FROM, which builds +# every headset whose branch is built on FROM with FROM merged in and sets the status ci on FROM's commit +# (.github/workflows/build.yml). All of FROM's pull requests have that commit as their head and share its +# status, so one run judges them all: a run per pull request would let the quickest one's verdict stand for +# the others. It runs on FROM itself, except for valve/7.2, whose tree has no workflows: that one runs on its +# layer (it has one, common/7.2). Each pull request is merged with a merge commit, and its merge moves the # change on. An open pull request's Build starts again: FROM may have moved. GitHub also gives such a pull # request a run of its own that waits for a maintainer's approval (its author, the workflow's bot, counts as a # first-time contributor); that run would only build what the started one builds, so it is deleted. @@ -31,18 +34,18 @@ drop_waiting() { done } -grep -v '^#' "$layers" | while read -r source into; do +pending=() # the layers with a pull request from FROM, which its Build judges +while read -r source into; do [ "$source" = "$from" ] || continue ahead=$(gh api "repos/$repo/compare/$into...$from" --jq .ahead_by) if [ "$ahead" = 0 ]; then say "$into has every commit of $from." continue fi + pending+=("$into") open=$(gh pr list --repo "$repo" --head "$from" --base "$into" --state open --json number --jq '.[0].number // empty') if [ -n "$open" ]; then - gh workflow run build.yml --repo "$repo" --ref "$into" -f head="$from" - say "$from into $into: #$open is open ($ahead commits); its Build started." - drop_waiting "$from" + say "$from into $into: #$open is open ($ahead commits)." continue fi head=$(gh api "repos/$repo/branches/$from" --jq .commit.sha) @@ -66,7 +69,15 @@ grep -v '^#' "$layers" | while read -r source into; do echo "A conflict is resolved here. Nothing is released until a headset's tag." } > "$body" gh pr create --repo "$repo" --head "$from" --base "$into" --title "$title" --body-file "$body" >/dev/null - gh workflow run build.yml --repo "$repo" --ref "$into" -f head="$from" - say "$from into $into: pull request opened ($ahead commits), its Build started." - drop_waiting "$from" -done + say "$from into $into: pull request opened ($ahead commits)." +done < <(grep -v '^#' "$layers") + +[ ${#pending[@]} -gt 0 ] || exit 0 +# One Build for all of FROM's pull requests (see the top): on FROM, or on valve/7.2's one layer. +ref=$from +if [ "$from" = valve/7.2 ]; then + ref=${pending[0]} +fi +gh workflow run build.yml --repo "$repo" --ref "$ref" -f head="$from" +say "$from into ${pending[*]}: their Build started, on $ref." +drop_waiting "$from" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e016cc397a4..48e34a67c06a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,10 +6,12 @@ # - a pull request into a headset's branch builds its merge; # - a pull request into a layer without a headset (common/, sm8250/) builds every headset's branch built # on that layer (.github/layers) with the pull request's merge merged in, in the runner, not pushed; -# - a layer's pull request, which the Layers workflow opens with the workflow's own token (one that starts -# no workflow), is built by a run the Layers workflow starts on the pull request's base branch with -# `head` (the branch that moves up, valve/7.2 among them, whose tree has no workflows): every headset's -# branch on that base is built with `head` merged in, and the run sets the status `ci` on `head`'s commit; +# - a layer's pull requests, which the Layers workflow opens with the workflow's own token (one that starts +# no workflow), are built by one run the Layers workflow starts with `head` (the branch that moves up), on +# that branch itself, or on its one layer for valve/7.2, whose tree has no workflows: every headset's +# branch built on it is built with `head` merged in, and the run sets the status `ci` on `head`'s commit, +# the head of each of those pull requests, once for all of them; +# - a headset's branch whose repository has no kernel/build-tree.sh yet builds nothing, and passes; # - a push to a headset's branch builds it; a tag (/-) is released with the kernel the # push build of its commit made, and builds only when that commit has no successful push build. # @@ -41,7 +43,7 @@ on: workflow_dispatch: inputs: head: - description: "a layer pull request's head (a branch): built merged into each headset branch on this base" + description: "the head of a layer's pull requests (a branch): built merged into each headset branch on this ref" required: false type: string @@ -118,6 +120,8 @@ jobs: kernel: needs: plan + # Nothing to build: a headset's branch whose repository has no kernel/build-tree.sh yet. + if: needs.plan.outputs.headsets != '[]' name: kernel ${{ matrix.headset.device }} (${{ matrix.build }}) runs-on: ubuntu-24.04 timeout-minutes: 180 @@ -439,10 +443,12 @@ jobs: env: NEEDS: ${{ toJSON(needs) }} RELEASE: ${{ github.ref_type == 'tag' && 'success' || 'skipped' }} + # The kernel job is skipped only when there is nothing to build (see it): then that passes. + KERNEL: ${{ needs.plan.outputs.headsets == '[]' && 'skipped' || 'success' }} run: | echo "$NEEDS" | jq -r 'to_entries[] | "\(.key): \(.value.result)"' - if echo "$NEEDS" | jq -e --arg release "$RELEASE" \ - 'all(to_entries[]; .value.result == (if .key == "release" then $release else "success" end))' > /dev/null; then + if echo "$NEEDS" | jq -e --arg release "$RELEASE" --arg kernel "$KERNEL" \ + 'all(to_entries[]; .value.result == (if .key == "release" then $release elif .key == "kernel" then $kernel else "success" end))' > /dev/null; then echo "state=success" >> "$GITHUB_OUTPUT" else echo "state=failure" >> "$GITHUB_OUTPUT"