From 5bd85a785fdfb7a61bea0e1b479caab27b474492 Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sun, 4 Oct 2026 01:03:49 +0200 Subject: [PATCH 1/2] Skip packing a PR build when edge already holds the version A PR can change a package's directory without bumping its version: an upstream hook, its tests, a README. bin/build then plans nothing, and the pack step failed on the empty build output, turning the required result check red (seen on #769). Make the same dry-run check publish.yml's rebuild job already makes, and skip packing and uploading when nothing was built. publish.yml finds no artifact for such a merge and records the package as already published. --- .github/workflows/build-pr.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 8825c829..5b33ec8d 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -211,11 +211,25 @@ jobs: # git's SIGPIPE (141) failed the step for any PR far enough behind # master to differ in more files; sed reads the whole stream. git status --short | sed -n '1,10p' + # A PR can change a package's directory without changing its version: + # an upstream hook, its tests, a README. edge already holds that + # version, so the planner builds nothing and there is nothing to pack. + # The same check publish.yml's rebuild job makes; without it the pack + # step failed on the empty output and the required result went red. - name: Build ${{ matrix.package }} (${{ matrix.arch }}, ships to ${{ matrix.channels }}) id: build env: CONTAINER_ENGINE: docker - run: bin/build --mirror edge --arch ${{ matrix.arch }} --package ${{ matrix.package }} + run: | + set -euo pipefail + plan=$(bin/build --dry-run --mirror edge --arch "${{ matrix.arch }}" --package "${{ matrix.package }}" 2>&1 | grep -E '^==> Plan complete' || true) + if [[ -n "$plan" && -z "$(sed -E 's/.*would build: *//' <<<"$plan" | tr -d '[:space:]')" ]]; then + echo "==> ${{ matrix.package }} (${{ matrix.arch }}): edge already holds this version, nothing to build" + echo "built=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + bin/build --mirror edge --arch "${{ matrix.arch }}" --package "${{ matrix.package }}" + echo "built=true" >> "$GITHUB_OUTPUT" # makepkg's check() leaves meson's per-test output in the build tree, # never on stdout, so a failing test shows only a summary line in this # job log. bin/build bind-mounts $SRC_DIR at /src, so those logs outlive @@ -243,12 +257,14 @@ jobs: # successful build uploads: the artifact's existence is what lets the # planner above and publish.yml skip rebuilding this exact tree. - name: Pack artifact + if: steps.build.outputs.built == 'true' id: pack run: | source helpers/artifact-helpers.sh pack_packages build-output/edge/${{ matrix.arch }} packages.tar tar -tvf packages.tar - name: Upload artifact + if: steps.build.outputs.built == 'true' uses: actions/upload-artifact@v4 with: name: ${{ matrix.package }}-${{ matrix.arch }}-${{ steps.tree.outputs.hash }} From f51d504a669e5ad15617ca4104d2d4b22f9853d7 Mon Sep 17 00:00:00 2001 From: Emir Beganovic Date: Sun, 4 Oct 2026 01:10:54 +0200 Subject: [PATCH 2/2] Flag a recipe change that will not ship without a version bump When edge already holds the version, a PKGBUILD whose recipe changed (comments and blank lines aside) builds nothing and publishes nothing. Arch bumps pkgrel only when the built package changes, which is the reviewer's call, so this is a warning annotation on the PKGBUILD and a job summary line, not a failure. Comment-only and hook-only changes stay silent. --- .github/workflows/build-pr.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 5b33ec8d..542d3d62 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -226,6 +226,18 @@ jobs: if [[ -n "$plan" && -z "$(sed -E 's/.*would build: *//' <<<"$plan" | tr -d '[:space:]')" ]]; then echo "==> ${{ matrix.package }} (${{ matrix.arch }}): edge already holds this version, nothing to build" echo "built=false" >> "$GITHUB_OUTPUT" + # Arch bumps pkgrel only when the built package changes, which is + # the reviewer's call. When the recipe itself changed (comments and + # blank lines aside), flag it on the PKGBUILD without failing: the + # change ships only once pkgver or pkgrel moves. HEAD is the base + # branch; the PR's package directories are overlaid on it. + recipe="pkgbuilds/${{ matrix.package }}/PKGBUILD" + recipe_lines() { grep -vE '^[[:space:]]*(#|$)' || true; } + if ! cmp -s <(git show "HEAD:$recipe" 2>/dev/null | recipe_lines) <(recipe_lines < "$recipe"); then + note="PKGBUILD changed, but edge already holds this version of ${{ matrix.package }}, so the change will not ship until pkgver or pkgrel changes. Bump pkgrel if it affects the built package." + echo "::warning file=$recipe,title=Change will not ship::$note" + echo "$note" >> "$GITHUB_STEP_SUMMARY" + fi exit 0 fi bin/build --mirror edge --arch "${{ matrix.arch }}" --package "${{ matrix.package }}"