Skip to content

Build an Arch Linux package from the x64 .deb (ADR-0069, needs owner approval) - #110

Merged
James-Chapman merged 2 commits into
mainfrom
claude/arch-linux-package
Nov 27, 2026
Merged

James-Chapman merged 2 commits into
mainfrom
claude/arch-linux-package

Conversation

@James-Chapman

@James-Chapman James-Chapman commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Each release build now makes an Arch Linux x86_64 package (.pkg.tar.zst) next to the AppImage, .deb and .rpm. Arch Linux users can install it with sudo pacman -U, so the AppImage is only the last choice. ADR-0069 records the design. It is proposed and needs the owner's approval.

What changed

  • release.yml has a new arch-package job. It repackages the x64 .deb with makepkg in archlinux:base-devel, pinned to the same digest as check.yml's arch job. The job fails if:
    • the package's files differ from the .deb's, in contents or in type, mode, owner, group or link target;
    • pacman -U cannot install it;
    • a library that a program links comes from a package that depends does not list;
    • ldd cannot find a library.
  • tools/release.py arch-pkgbuild takes the one .deb in .local/release/arch/in and writes .local/release/arch/build/PKGBUILD from tools/arch/PKGBUILD.in, with the version and the .deb's name and SHA-256. Like append-notice, it takes no file arguments (Sonar S8707). The PKGBUILD's options turns off each makepkg option that changes files.
  • version and check-tag now refuse pre-releases that pacman would sort after the release, such as 0.1.0-7. alpha.1 and rc.2 still work.
  • checksums collects the package. SHA256SUMS, the signatures and the attestations cover it, and latest publishes it. checksums now needs arch-package, so an Arch job failure blocks the release, as a failure on any other platform does.
  • The release notes, the latest notes, the README, docs/release.md, docs/development.md and .github/AGENTS.md are updated. On Linux, they tell users to choose the .deb, .rpm or .pkg.tar.zst first, and the AppImage only when none of these fits.

Why it changed

Arch Linux users had only the AppImage. The AppImage bundles its own GTK and WebKitGTK, and these do not get Arch's security updates. A repackaged .deb uses the same programs as the other Linux packages and Arch's own system libraries. The considered options were to build from source on Arch, to publish an AUR PKGBUILD only, or to make no package. ADR-0069 explains why it chose the repackaged .deb instead.

Decisions for the owner to review in ADR-0069:

  • org.freedesktop.secrets is a hard dependency. The core cannot open a profile without a Secret Service.
  • The package is x86_64 only. Arch Linux ARM is a separate project with no official image.
  • Pre-release versions are narrowed, as described above.
  • The package has no pacman signature. SHA256SUMS and its signatures cover it.
  • The ADR is number 0069, because the claude/video-effects branch already uses 0068.

Tests

Checks that were run:

  • A Linux Mint VM ran the job's six steps from the workflow in the pinned image, last at d605b1c. It used the latest 0.3.0 .deb, checked against its SHA256SUMS. All steps passed. All 27 entries of the .deb are owned by root. pacman -U also installed the file under its published -unsigned name.
  • Negative controls at d605b1c: the files check failed when package() changed the .desktop file's mode to 0666 or its owner to 1:1. The library check failed when libsoup3 was removed from depends.
  • python -m unittest tests.tools.test_release tests.tools.test_workflows with PERSEPHONE_WORKFLOW_TESTS=required: 62 tests pass.
  • The full tests/tools run: 146 of 150 tests pass. The 4 errors are test_matrix_capabilities loopback tests that fail on the Windows host with WinError 10048 (3 to 8 of them per run). This change does not touch that code.
  • actionlint: the only finding is queue: max, which was already in the workflow.

Not run:

  • The arch-package job on GitHub Actions. It runs only in release.yml, on pushes to main, on tags and on manual runs.
  • A start of the app on Arch with a display.
  • The Rust and frontend checks. This change has no Rust or frontend code.

Updated

None

New

  • tests/tools/test_workflows.py: test_the_arch_package_uses_the_checked_arch_image checks that the arch-package image is pinned by digest and equals check.yml's arch image.
  • tests/tools/test_workflows.py: test_the_arch_package_job_uses_the_folders_of_arch_pkgbuild checks that the job downloads into the folder that arch-pkgbuild reads and runs makepkg in the folder that it writes.
  • tests/tools/test_release.py, ArchVersionTests:
    • how versions map to Arch versions;
    • refusal of versions that pacman sorts wrongly;
    • version and check-tag exit with code 2 and change no files.
  • tests/tools/test_release.py, ArchPkgbuildTests:
    • the PKGBUILD has its values and no placeholders;
    • wrong .deb names are refused;
    • an input folder with no .deb or two .deb files is refused;
    • a .deb that is not a regular file is refused;
    • a template with a missing placeholder is refused.

🤖 Generated with Claude Code

Arch Linux users had only the AppImage, which should be the last choice.
A new arch-package release job repackages the x64 .deb as a
.pkg.tar.zst in the pinned archlinux:base-devel image that check.yml
uses. The package holds the .deb's files unchanged, and the job fails
if they differ, if pacman cannot install it, or if a linked library
comes from a package that depends does not list.

tools/release.py arch-pkgbuild writes the PKGBUILD from
tools/arch/PKGBUILD.in with the .deb's name and SHA-256. version and
check-tag now refuse pre-releases that pacman would sort after the
release, such as 0.1.0-7.

checksums collects the package, so SHA256SUMS, the signatures and the
attestations cover it, and latest publishes it. The release notes, the
README and docs/release.md name the AppImage as the last choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9b40853-c882-40d8-aff0-b8d0614a177c
Commits

Reviewing files that changed from the base of the PR and between b45a06a and d605b1c.

Files selected for processing: 11

  • .github/AGENTS.md
  • .github/workflows/release.yml
  • README.md
  • docs/adr/0069-build-an-arch-linux-package-from-the-deb.md
  • docs/adr/index.md
  • docs/development.md
  • docs/release.md
  • tests/tools/test_release.py
  • tests/tools/test_workflows.py
  • tools/arch/PKGBUILD.in
  • tools/release.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@James-Chapman James-Chapman left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: No blocking defects. Merge once the owner approves the decisions in ADR-0069. The most serious finding is a [P4]: the file-identity check compares contents but not modes or ownership.

Scope: all 11 files at 7d74b22 (base b45a06a, merge-base b45a06a), +610/-16. Languages: GitHub Actions YAML, Bash, Python, PKGBUILD, Markdown.

What was checked: the pacman vercmp ordering of the mapped pre-release versions against SemVer. Pre-releases made of one word and dot-separated numbers sort the same in both, and the refused forms would sort wrongly. Also checked: that checksums, SHA256SUMS, the signatures, the attestation and release/latest pick up the .pkg.tar.zst; the SUFFIX/WORK env use; the image pin test; and the .deb name, SHA-256 and placeholder guards in arch_pkgbuild.

Owner decision: because checksums now needs arch-package, Arch's rolling repositories on release day can block every platform's release. Examples are a mirror outage, an outdated archlinux-keyring in the pinned image, or a library moving to another package. The ADR accepts this on purpose. Flagging it so the approval covers it.

Verification: read-only, static review. There were no [P1]/[P2] findings, so each finding was self-checked against the code. Tests and the workflow were not run.

3 inline comments: 1 × [P4], 2 × [P5].

Comment thread .github/workflows/release.yml Resolved
Comment thread tools/arch/PKGBUILD.in Resolved
Comment thread docs/release.md Resolved
Comment thread tools/release.py Fixed
Comment thread tools/release.py Fixed

@benandez benandez left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Request changes. The only blocker is a SonarCloud failure that this PR introduces. The job itself works: I reproduced it.

Head: 7d74b22, mergeable on main b45a06a. Check jobs that ran (ubuntu-latest, windows) and Coverage pass. SonarCloud Code Analysis fails with 2 new high-severity alerts. It passed on #103 and #105.

Blocking

  • tools/release.py:415 and :422: SonarCloud reports "path traversal via CLI arguments" in arch_pkgbuild(). --deb and --output are used without any limit on where they point. The real risk is low, because the release job supplies both paths and has no secrets. The repo already has a fix for this pattern: _inside_local in tools/matrix_restart.py resolves the path and checks is_relative_to(ROOT/.local). Please apply the same check to both arguments (the workflow already uses .local/release/arch) and move the test files under root/.local.

Non-blocking (P3)

  • The check that the package holds the .deb's files compares contents and symlinks, but not file modes, so a lost executable bit on a non-program file would pass. The docs' "byte for byte" claim holds for contents only.
  • The docs give the file name as persephone-<version>-1-x86_64.pkg.tar.zst. For a pre-release it is the pkgver, without the hyphen (0.1.0alpha.1), and main and dry-run builds add -unsigned.
  • pacman -Syu on the pinned image means an Arch mirror or keyring failure blocks both tag releases and latest. check.yml's arch job already has the same risk, and ADR-0069 accepts it.

Reproduced

  • Ran the six run steps of arch-package from release.yml in the pinned archlinux:base-devel image, using the latest 0.3.0 .deb checked against SHA256SUMS. All steps passed: the package's files equal the .deb's, it installs, and every NEEDED library comes from a package in depends. The renamed -unsigned file also installs in a clean container.
  • vercmp agrees with Semantic Versioning ordering for alpha < beta < rc < release, rc.9 < rc.10, RC < alpha (ASCII order) and alpha.1 < alpha.1.2. It also shows 0.1.07 > 0.1.0, which justifies refusing 0.1.0-7.
  • gnome-keyring, kwallet and keepassxc all provide org.freedesktop.secrets.
  • tests.tools.test_release and tests.tools.test_workflows: 60 pass. 15 were skipped because PyYAML isn't installed here, so the new pin-equality test was skipped.

Axes

  • Keyed state: the artifact name is unique and no cache is involved.
  • Guards: collect gets an arch-x64 pattern. SHA256SUMS and the attestation cover all of dist, and release and latest upload dist/*.
  • Pre-existing state: a re-run gets a fresh container. An existing output directory is overwritten, and the copy step skips when source and target are the same file.
  • Our check vs the real consumer: checked against vercmp and real makepkg.
  • Loosened predicates: none. Versions are narrowed, and the existing tag v0.0.1 still passes.
  • Sibling branches: both tag and -unsigned .deb names match. arm64 is left out deliberately and documented.
  • Hostile input: the .deb comes from our own artifact, and its name is checked against a regex before it goes into the PKGBUILD.
  • Other actors, captured once, replaced path, security fix: not applicable.

Not checked: the job on GitHub Actions, and starting the app on Arch with a display.

Review of the arch-package job:
- The files check now also compares each file's type, mode, owner, group
  and link target, not only its contents. A mode or owner change in
  package() fails the job.
- options sets each makepkg option that changes files (!zipman, !purge,
  docs, emptydirs, libtool, staticlibs as well as !strip and !debug), so
  makepkg.conf cannot change the .deb's files.
- docs/release.md no longer shows the release version in the Arch file
  name: a pre-release's pkgver has no hyphen, and latest files end in
  -unsigned.

Sonar S8707 (path injection through command-line arguments):
- arch-pkgbuild takes no file arguments, as append-notice does. It reads
  the one .deb in .local/release/arch/in and writes
  .local/release/arch/build, the folders the job already used. It
  refuses no .deb or two .debs.
- A workflow test keeps the job's folders equal to the command's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@James-Chapman

Copy link
Copy Markdown
Contributor Author

All four points are covered in d605b1c. Sonar S8707: rather than _inside_local, arch-pkgbuild now takes no path arguments, as append-notice has done since db7f3d7. It reads the one .deb in .local/release/arch/in and writes .local/release/arch/build, and the tests use root / release.ARCH_INPUT. The files check now compares type, mode, owner, group and link target; on the VM, a mode of 0666 or an owner of 1:1 fails it. The docs now say sudo pacman -U <file> and explain the pkgver and the -unsigned ending. The pacman -Syu risk is unchanged and is in ADR-0069 for the owner to approve.

🤖 Addressed by Claude Code

@sonarqubecloud

Copy link
Copy Markdown

@James-Chapman
James-Chapman merged commit 7c5d87d into main Nov 27, 2026
13 checks passed
@James-Chapman
James-Chapman deleted the claude/arch-linux-package branch November 27, 2026 00:11
James-Chapman added a commit to OMG-Software/code-change-review-skill that referenced this pull request Nov 27, 2026
#10)

* Review the gates a change must pass and the history of what it touches

A review of OMG-Software/Persephone#110 said "no blocking defects"
while SonarCloud failed the quality gate on pythonsecurity:S8707: a new
release.py subcommand took file paths as CLI arguments. The same file's
history (db7f3d7) had already removed file arguments from append-notice
for that rule. The review had run before SonarCloud reported, never read
the PR's checks, and would have ranked the low real risk below blocking.

- SKILL.md step 1: read gh pr checks and the open code-scanning alerts
  at the pinned head; a running check is not a pass.
- SKILL.md step 3: learn the analysers the project keeps green, and read
  the recent git log of each touched file for rules applied to siblings.
- reporting.md: a change that fails a gate the project enforces is at
  least [P2], with the real risk stated apart; the verdict is never
  "Ready to merge" while a gating check fails.
- review-angles.md: CLI arguments and environment of CI or agent tools
  count as input for path traversal; follow rules from sibling commits.
- evals: sibling-rule-paths case, expecting a [P2].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Review feedback: both alert refs, API history, conditional verdicts

- SKILL.md step 1: read code-scanning alerts for the PR head and merge
  refs, paginated; tie each to the reviewed revision through its
  commit_sha, and re-pin if headRefOid moved while reading them.
- SKILL.md step 3: read file history through the commits API when the
  reviewed head is not local; apply a sibling's rule only where its
  reason covers the new code.
- reporting.md: Ready to merge only once every gating check has passed;
  while one runs, the verdict names it and is conditional on it.
- review-angles.md: the sibling-rule check names when a rule does not
  carry over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Review feedback: gate facts reach the verifier; narrower path input

- verification.md: a gate finding rests on the rule firing and the gate
  being enforced, not on reachability. New load-bearing fact, a
  false-positive row and a line in the verifier brief, so a verifier
  can't drop a gate finding as "trusted input" and reopen the PR 110 miss.
- reporting.md: define an enforced gate (a required check, or a quality
  gate the docs or recent history show is kept passing); word gate
  claims as the gate failing.
- review-angles.md: CI and agent tool arguments count as path input
  only when they can carry less-trusted data or an enforced analyser
  flags them.
- SKILL.md: on a 403 or 404 from code scanning, read the analyser's
  check-run annotations or its own API; otherwise list alerts as
  unreadable, never as zero.
- evals: cli-output-trusted, a clean case with no analyser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants