Repository navigation
ci: Assemble the AppImage AppDir from Python (#962) - #2600
Conversation
|
Evidence for handoff:
Handed off to the coordinator (auto-merge on, queued). |
8294c75 to
4998318
Compare
|
Rebased onto Conflicts resolved (all mechanical):
Adapted to
Verified after the rebase (worktree at
Nothing else changed; the port's own logic is the author's. |
…script (#962) RED: build-aux/appimage/assemble_appdir.py does not exist yet, so ci/test_assemble_appdir.py cannot load it and the wiring cases fail too (12 tests, 9 errors, 3 failures -- the shell script is still there, build.py still runs it and ci.toml still excepts it). ci/test_assemble_appdir.py drives the port's decisions over a fake AppDir with stub executables first on PATH, pinning: the compatibility-library audit (a missing input, the wrong libavutil SONAME and a leftover vaMapBuffer2 all stop the build with status 2), the glibc-floor decision (getconf at or below 2.28 leaves glibc to the host, above it bundles it), the host-driver EXCLUDE set, the Qt plugin requirement (status 1), an unresolved dependency (fail closed) and a whole successful assembly.
Replaces build-aux/appimage/assemble-appdir.sh (306 lines of bash) with build-aux/appimage/assemble_appdir.py, preserving every branch, message and exit code: usage and compatibility-library audit failures exit 2, the Qt-plugin, gconv/PipeWire and loader failures exit 1, and the `::error::` diagnostics go to stderr exactly as before. The decisions are unchanged: - the compat libavutil must have SONAME `[libavutil.so.60]` and no undefined `vaMapBuffer2`; - GUI names/APP_ID/DATA_ROOT/MODULE_ROOT follow usr/bin/obs-studio-rust-gui; - SYSLIB comes from `gcc -print-multiarch`; - BUNDLE_GLIBC is the `getconf GNU_LIBC_VERSION` vs floor 2.28 comparison (issue #926), and the EXCLUDE regex gains the extra alternation when it is 0; - Qt plugins come from `qtpaths6 --query QT_INSTALL_PLUGINS`, with the fallback, the three required plugins and the libqgtk3 removal; - the ldd closure still fails closed on an unresolved dependency. The subprocess helpers that the shell ran stay invoked the same way (Python only through `uv run`): `hostlib/build.py` through `uv run --no-project`, `set_runpaths.py` through `uv run --no-project`, and `check-glibc-floor.py` through `uv run --script`. Also: - build.py's appdir step runs the new module through uv; - the GEN-005 exception for assemble-appdir.sh is gone from ci.toml; - ci/test_appimage_host_stack.py, ci/test_set_runpaths.py and ci/test_glibc_floor.py now read the ported module instead of the shell file, with the same assertions; - ci/test_appimage_build_script.py records the appdir step's new text; - ci/test_assemble_appdir.py drives the decisions over a fake AppDir. RED (eb80156): ci/test_assemble_appdir.py, 12 tests, 9 errors and 3 failures with the module absent. GREEN: the same 12 tests pass, and the four touched ci files pass.
4998318 to
aba0cfb
Compare
|
Worker rebase this tick supersedes the coordinator's mechanical rebase on The coordinator's rebase ( New head
Local evidence: 64 AppImage |
build-aux/appimage/assemble-appdir.sh(306 lines of bash) becomesbuild-aux/appimage/assemble_appdir.py. Every branch, message and exit code ispreserved: the usage/compatibility-library audit failures still exit 2, the
Qt-plugin, gconv/PipeWire and loader failures still exit 1, and every
::error::diagnostic still goes to stderr. No shell left; the subprocesshelpers the script ran are still invoked through
uv run(
uv run --no-projectforhostlib/build.pyandset_runpaths.py,uv run --scriptforcheck-glibc-floor.py).Refs #962.
RED
Commit eb80156 —
test(ci): drive the AppDir assembly from Python instead of the shell script (#962)ci/test_assemble_appdir.pydrives the port's decisions over a fake AppDir withstub executables (
readelf,gcc,qtpaths6,pkg-config,ldd,patchelf,dpkg-query,getconf,install) placed first onPATH. With the moduleabsent (relocated, so the failures are attributable to the missing port and not
to test bugs):
The three wiring tests failed too: the shell script was still present,
build.pystill ran it, andci.tomlstill carried the GEN-005 exception.GREEN
Commit 8294c75 —
ci: Assemble the AppImage AppDir from Python (#962)ci/test_assemble_appdir.py12 pass (compat-lib errors -> 2, glibc-floordecision, EXCLUDE membership, Qt-plugin requirement -> 1, fail-closed
not found, the full successful assembly, plus the three wiring tests).ci/test_set_runpaths.py6 pass - now assertsassemble_appdir.pybuilds theset_runpaths.pyargv throughuv run --no-project, with the loaderdirectory appended only when glibc is bundled.
ci/test_appimage_host_stack.py7 pass - the host-driver and glibc EXCLUDErules now come from the module.
ci/test_glibc_floor.py6 pass,ci/test_appimage_build_script.py11 pass.ruff check(the lane'sC901, RUF100over 344 files) andpyrighton the newmodule and its test are clean.
./lint's python lane passes; its two remainingfailures (
test_gate_dylint.py,test_local_gate_probe.py) are environmentalon this host - a stray empty
CARGO_TARGET_DIRand an older soldr broker - andpass with
CARGO_TARGET_DIRunset, unrelated to this diff.What maps to what
set -euo pipefail,trapmain()returning a status;Failure(status);sys.exitHERE=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)HERE = Path(__file__).resolve().parent[[ $# -eq 2 ]] || { usage; exit 2; }Failure(2)readelf -d ... | grep -q '\[libavutil.so.60\]'capture(["readelf", "-d", ...])+ membershipreadelf --dyn-syms --wide | grep UND ... vaMapBuffer2_UNDEFINED_VAMAPregex overreadelf --dyn-syms --wide-x usr/bin/obs-studio-rust-gui,ln -saliasesis_file()/is_symlink(),symlink_togcc -print-multiarchcapture(["gcc", "-print-multiarch"])->SYSLIBgetconf GNU_LIBC_VERSION,sort -V, floor 2.28(2, 28)(#926)EXCLUDE='...'/ extended whenBUNDLE_GLIBC=0HOST_EXCLUDE/GLIBC_EXCLUDEregexesqtpaths6 --query QT_INSTALL_PLUGINS, fallbacksfind_program+--query, three required plugins,libqgtk3removedprintf '[Paths]...' > usr/bin/qt.conf(appdir/"usr/bin/qt.conf").write_text(...)find ... -perm -u+x,head -c4177ELFOWNER_EXECUTE = 0o100,ELF_MAGIC = b"\x7fELF"dpkg-query -S/dpkg-query -Lcapture(["dpkg-query", ...])-> package -> filessha256sumof the loaderhashlib.sha256over the glibc treepatchelf --set-interpretercapture(["patchelf", "--set-interpreter", ...])uv run --no-project "$HERE/set_runpaths.py" ...set_runpaths_command()-> same argvcheck-appdir.sh,check-glibc-floor.pycapture([...])/uv run --script, fail on statusAlso in this PR
build.py'sappdirstep runsuv run --no-project build-aux/appimage/assemble_appdir.py AppDir "${AVUTIL_LIB}".build-aux/appimage/assemble-appdir.shis removedfrom
ci.toml.README.mdand the comments incheck-appdir.sh,test-appimage.shandset_runpaths.pyname the new file.