Skip to content

ci: Run the check-appdir step from Python (#962) - #2596

Merged
zackees merged 2 commits into
masterfrom
infra/962-check-appdir-python
Oct 27, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/962-check-appdir-python

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Refs #962

GEN-005 burn-down: build-aux/appimage/check-appdir.sh (136 lines of shell) → build-aux/appimage/check_appdir.py. The shell script is deleted; assemble-appdir.sh and test-appimage.sh run the Python through uv run --no-project, and the ci.toml GEN-005 exception is removed.

RED 8fd4cbab3 (local evidence, no remote run needed for a focused CI/config change):
uv run python -m unittest ci/test_check_appdir.py → 22 tests, 18 errors — the module is loaded by path and setUp fails because build-aux/appimage/check_appdir.py does not exist. The wiring is pinned too: check-appdir.sh is still present, both callers still run the shell, and the ci.toml exception is still there.

GREEN 174113329:

  • build-aux/appimage/check_appdir.py — the port. Runs uv run --no-project build-aux/appimage/check_appdir.py <AppDir>.
  • build-aux/appimage/assemble-appdir.sh and build-aux/appimage/test-appimage.sh — both call sites now uv run --no-project …/check_appdir.py.
  • ci.toml — the GEN-005 exception for check-appdir.sh removed.
  • build-aux/appimage/README.md and plugins/obs-ffmpeg/cmake/dependencies.cmake name the Python file.

What the port keeps

Every check the shell made, failing closed on a missing file, with the same messages:

  • the top-level export NAME="$HERE..." lines of AppRun are expanded (HERE and PATH — the only names they use) and every path whose first component is under the AppDir must exist; a directory must be non-empty (GIO_MODULE_DIR excepted, and APPDIR="$HERE" carries no trailing path so the shell's case "$APPDIR"/* skipped it);
  • client.conf loads only bundled PipeWire modules (an ifexists one is a note, not an error) and only bundled SPA plugins; the three required modules and support/libspa-support.so must be present;
  • gconv-modules when the AppImage bundles glibc (the shell read GCONV_PATH from the export block, which never carries it, so an empty value globs from / — kept as-is), and the X11 and Wayland Qt plugins;
  • exactly one libsrt, at least 1.5.7 (read from .rodata without binutils, so a second match fails closed), and no bundled ELF file asks for a second libsrt soname.

Tests

ci/test_check_appdir.py builds a small AppDir (a synthetic AppRun, a client.conf, the PipeWire modules, SPA plugins, Qt plugins and one libsrt) and drives check() over it: a complete AppDir passes, and a missing or empty exported path, a missing client.conf, a missing required module or SPA plugin, a client.conf module that is not bundled, a missing Qt plugin, and a missing, duplicated, too-old, unreadable or second-referenced libsrt each fail with the shell's own message. The wiring is pinned too: the shell script is gone, both callers run the Python through uv, and no GEN-005 exception is left.

Local: uv run python -m unittest ci/test_check_appdir.py → 22 OK; ci.test_ci_toml 19 OK; ci.test_uv_run OK; ci.test_no_sys_path_edits OK; uvx ruff check build-aux/appimage/check_appdir.py ci/test_check_appdir.py clean.

Not run locally

./lint's test_local_gate_probe rust lane errors in this environment (the host's soldr is older than the repo pins), unrelated to this change — PR CI is the gate.

No user-visible change: CI tooling only, so no docs/features.md line.

zackees and others added 2 commits October 27, 2026 03:20
RED: ci/test_check_appdir.py drives build-aux/appimage/check_appdir.py, which does not exist yet — 18 errors, the module is loaded by path and setUp fails. The wiring is pinned too: check-appdir.sh is still present, assemble-appdir.sh and test-appimage.sh still call the shell script, and the ci.toml GEN-005 exception is still there.
GEN-005 burn-down: build-aux/appimage/check-appdir.sh (136 lines of shell) →
build-aux/appimage/check_appdir.py. The shell script is deleted; both callers
run the Python, and the ci.toml GEN-005 exception is removed.

GREEN keeps every check the shell made, failing closed on a missing file:

- the top-level `export NAME="$HERE..."` lines of AppRun are expanded (HERE and
  PATH, the only names they use) and every path whose first component is under
  the AppDir must exist, and a directory must be non-empty (GIO_MODULE_DIR
  excepted);
- client.conf loads only bundled PipeWire modules (an `ifexists` one is a note,
  not an error) and only bundled SPA plugins, and the three required modules
  plus support/libspa-support.so must be present;
- gconv-modules when the AppImage bundles glibc, and the X11 and Wayland Qt
  plugins;
- exactly one libsrt, at least 1.5.7 (read from .rodata without binutils), and
  no bundled ELF file asks for a second libsrt soname.

Local: `uv run python -m unittest ci/test_check_appdir.py` → 22 OK;
`ci.test_ci_toml` 19 OK; `ci.test_uv_run` and `ci.test_no_sys_path_edits` OK;
`uvx ruff check` on both files clean.
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator: rebased on origin/master (8494808; none of master's later commits touch these files), local RED/GREEN evidence in the description, auto-merge on. PR CI is the gate; the only local lane that did not run is the ./lint rust probe (test_local_gate_probe), which errors in this environment (host soldr older than the repo pins), unrelated to the change.

@zackees
zackees added this pull request to the merge queue Oct 27, 2026
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Blocking concern: the bundle scenario this PR rewires runs inside the stock test containers, which have no uv and no python3.

Evidence:

  • .github/workflows/appimage.yaml:344-354 runs docker run --rm --cap-add SYS_PTRACE … "${{ matrix.image }}" bash -c "build-aux/appimage/test-appimage.sh … $scenario" in almalinux:8, ubuntu:22.04, ubuntu:24.04, archlinux:latest (matrix at appimage.yaml:260-268). Only $PWD:/work is mounted; it never mounts uv.
  • astral-sh/setup-uv (appimage.yaml:294) runs on the runner, not in the container, and test-appimage.sh's package installs (apt-get/dnf/pacman, lines 220-251/838-849) install neither uv nor python3.
  • test-appimage.sh:402 (changed here) therefore becomes uv run --no-project "$HERE_DIR/check_appdir.py" → uv: command not found in all four images, failing the bundle scenario.

The bundle scenario is exercised by the daily release lane (release-rust.yaml:370 → appimage.yaml), which PR CI does not run — the checks on this PR show no AppImage job — so this would only surface after merge, on master/schedule. assemble-appdir.sh is fine: it runs in the manylinux build image, which has uv.

Either install uv (or python3) in those four image package lists, or keep check-appdir.sh in shell for the in-container caller (assemble-appdir.sh can still call the Python). Flagging rather than editing your branch; the merge queue entry is still live.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant