Repository navigation
Conversation
Source package "phpr", format 3.0 (native), debhelper compat 13. Two binary packages, own namespace with PHP provides: - phpr-cli ships /usr/bin/phpr and registers it as the /usr/bin/php alternative at priority 85 (the 8.5 slot; php8.4-cli=84, php8.6-cli=86 still outrank it and coexist). Provides: php-cli, php8.5-cli, php-json, php8.5-json; Conflicts/Replaces: php8.5-cli. The phpapi-* ABI is deliberately NOT provided: phpr loads no binary extensions. - phpr-server ships /usr/bin/php-server (union build: cli-server + axum-server) and a hardened systemd service running as www-data, configured via the /etc/default/phpr-server conffile (host, port, docroot /var/www/html, workers). The service claims NO php-fpm (php-server speaks plain HTTP, not FastCGI): README.Debian documents the reverse-proxy pattern instead. Correct-or-absent is preserved end-to-end: no /etc/php/8.5 tree (the engine reads no php.ini), and the missing -v/-m/-i/-l/-w/--ini switches are documented as gaps in the phpr-cli README.Debian and the man page. Packaging hardening earned along the way: - rules pins RUSTC=/usr/bin/rustc and strips ~/.cargo/bin from PATH so cargo never resolves the rustup shim (one poisoned-cache incident: shim mixed rustc 1.99.1/1.98.1/1.71.0 in a single build). - RUSTONIG_STATIC_LIBONIG=1 pins the vendored static oniguruma so the binaries are identical regardless of the build host; zlib stays the SYSTEM library (byte-parity contract). - source tarball kept lean via debian/source/options tar-ignore (the harness/sessions/gaps trees are dev history, not build inputs). - shlibs.local maps libtidy.so.58 for hosts without libtidy58 in the dpkg database; runtime Depends are explicit (libgd3, libtidy58). - autopkgtest smoke suites for both packages (debian/tests/). - lintian --pedantic: clean, with two justified binary overrides (ureq/unsafe-libyaml Rust crates misdetected as embedded C libs; /var/www/html default docroot, established nginx/apache2 practice). Built and verified on Debian forky/sid with Debian's rustc/cargo 1.98.1 (the project's pinned toolchain).
Runs only on the debian-packaging branch (and on demand): ci.yml's
main-branch gate is untouched. The job builds in a debian:sid container
— the same distro the packages target and the one the packaging was
verified on — with these properties:
- deps come from debian/control via "apt-get build-dep" (single source
of truth; no duplicated toolchain list);
- a pin-guard step fails the build loudly if debian:sid's rustc drifts
away from the toolchain pinned in rust-toolchain.toml (1.98.1): a
compiler change must be deliberate, never smuggled in by a moving
container tag;
- lintian runs with --fail-on error (warnings displayed, not fatal);
- the autopkgtest smoke scripts (debian/tests/{cli,server}) run against
dpkg -i installed packages before upload;
- artifacts: phpr-cli/phpr-server debs + the native source set,
.changes and .buildinfo.
The stock debian:sid container ships no rustc/cargo; they arrive via apt-get build-dep (from debian/control). The environment report step ran before that and failed with exit 127 (rustc: not found).
The minimal debian:sid image ships no CA store: cargo's TLS to the crates.io registry failed (unable to update registry crates-io), and curl would have hit the same wall in the smoke test.
Toolchain policy: Debian's rustc/cargo when they match the pin in rust-toolchain.toml (unchanged, deterministic default), and the PINNED toolchain via rustup when they do not. debian/rules now accepts a caller-supplied CARGO/RUSTC pair via the environment (both must name the same toolchain; the PATH restriction keeps rustup's proxy shims out of the build either way). The CI resolve step picks the mode and hands the absolute paths to dpkg-buildpackage. Verified locally: make honors the env pair; in a debian:sid container apt's rustup installs the pinned 1.98.1 toolchain and rustup-which resolves real non-shim paths. Also: libclang-dev added to Build-Depends — onig_sys's vendored oniguruma build runs bindgen, which probes libclang at build time (present on dev boxes, absent in minimal containers; the CI run died on it).
update-alternatives --query prints 'Alternative: /usr/bin/phpr' — the bare-path line the old grep expected does not exist in its output, so the registration check could never pass (the CI smoke run caught it; the podman install verification had checked the equivalent facts with inline commands and never executed this script verbatim). Both debian/tests scripts now verified end-to-end in a debian:sid container against dpkg-installed packages.
…ed rustup toolchain - debian-packages.yml: build container debian:sid -> debian:trixie. trixie's rustc (1.85) can never satisfy the "rustc (>= 1.98)" Build-Depends, so the lane installs the build dependencies explicitly MINUS rustc/cargo and always installs the PINNED toolchain with rustup fetched with curl from the official https://sh.rustup.rs installer. dpkg-buildpackage runs with -d: dpkg cannot see the external toolchain, and every other depend was installed explicitly. - debian/source/lintian-overrides: override license-problem-php-license (raised as an ERROR by trixie's lintian on the deliberate PHP-3.01 choice; sid's lintian did not emit it), keeping the --fail-on error gate honest on every suite. - control/rules comments document the trixie toolchain contract. Validated end-to-end in a rootless podman debian:trixie container: build with the pinned rustc/cargo 1.98.1, lintian gate, dpkg -i, both autopkgtest-style smokes green; the packages then ran WordPress 7.1.5 on php-server --axum with all functional checks passing.
|
Thank you very much, Bernd — this is a remarkably careful piece of work, and it is a real pleasure to receive it from a Debian developer. I read the whole series. What I particularly appreciated:
Status on this side:
About the apt repository flow: the offer is very welcome and much appreciated. I will come back to you on the hosting choice before you invest time in a follow-up PR. Thanks again for the time and the care you put into this. (Written with the help of an AI assistant, Claude, on behalf of the maintainer.) |
…and validated, state recorded in NEXT_SESSION: the fast-forward of main is left to the user Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Hi! You are welcome!
https://bzed.github.io/dayz-server-operator/installation.html has a rendered documentation example and https://github.com/bzed/dayz-server-operator/blob/main/.github/workflows/ci.yml the code. Guess if you point claude to it you can get something similar. What the debian package is still missing is a way to setup multiple phpr servers, guess using systemd templates would be an option. But I decided that should be your decision and that should be a general way on how to handle these things that is similar over all distributions. For now a single server for testing should be enough I guess. Cheers, Bernd |
… published on GitHub Pages Follows the flow Bernd Zeimetz described on PR #10 (and uses in dayz-server-operator): a GPG key in the repository secrets, packages built and signed in CI, the repository published on GitHub Pages. - packaging/apt/build-apt-repo.sh: reprepro repository (suite stable, codename trixie, amd64) from the .deb files, signed with the only key in GNUPGHOME; only packages named in debian/control are accepted. - packaging/apt/snapshot-version.sh: <changelog version>+git<commit time, UTC>.<sha>, so every later build is an upgrade for apt. - debian-packages.yml: the lane also runs on main; new jobs build the repository, install both packages from it with apt in a clean trixie (Signed-By enforced), and on main publish it on Pages and install again from there. Off main, or until the archive key is set up, the repository is signed with a throwaway key and never leaves the run. The archive key signs only the head of main, and only when the secret matches the committed public key. New actions pinned by commit SHA. - packaging/apt/README.md: installation and the one-time maintainer setup (key, secret, Pages). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Thank you, Bernd — the pointer to your What is now on the upstream branch
That rehearsal path is green: lane run — packages What is not done yet, to be plain about it: nothing is published. The publishing jobs have never run; they need the archive key in the secrets, its public half committed, Pages switched to "GitHub Actions", and the fast-forward of On several Thanks again for taking the time to explain your approach. (Written with the help of an AI assistant, Claude, on behalf of the maintainer.) |
…r implemented on debian-packaging (e5cdc77, rehearsal green); state recorded in NEXT_SESSION and in the session minutes Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Landed.
GitHub does not mark replayed commits as merged, so I am closing the PR by hand — it is merged in substance. The lane now also runs on Thank you again, Bernd. (Written with the help of an AI assistant, Claude, on behalf of the maintainer.) |
…186-firma Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…k branch; what is left is the archive key and Pages Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
A correction to what I wrote above, after a decision of the maintainer: the repository will not follow
On (Written with the help of an AI assistant, Claude, on behalf of the maintainer.) |
What this adds
A native Debian source package
phpr(newphp-rust/debian/) producing two binary packages, plus a CI lane that builds, gates and publishes them.phpr-cli
/usr/bin/phpr, registered viaupdate-alternativesas/usr/bin/php(priority 85 — the 8.5 slot), so tooling that invokesphpkeeps working.Provides/Conflicts/Replaces:php8.5-cli; alsoProvides: php-json.README.Debian): nophp.iniis read,-v/-m/-i/-l/-w/--iniare not implemented, archivephp8.5-*extension modules have no effect on phpr.phpr-server
/usr/bin/php-server, aphp -Swork-alike web SAPI: sequential cli-server mode and--axummulti-worker mode (shared FIFO queue, one fresh VM per request).phpr-server.service, runs as www-data; host/port/docroot/workers configured in/etc/default/phpr-server).php8.5-fpmbehind nginx/Apache — front it with any reverse proxy over plain HTTP.Packaging details: debhelper compat 13,
Rules-Requires-Root: no, vendored-static onig (RUSTONIG_STATIC_LIBONIG=1) for reproducibility (system zlib stays a dynamic link for byte-parity),libclang-devfor bindgen, manpages, lintian overrides, and autopkgtest-style installed-package smoke tests indebian/tests/{cli,server}.CI lane (
debian-packages.yml)Deliberately separate from the unit-test gate: it only reacts to the
debian-packagingbranch and publishes the artifacts.debian:trixie(the suite the runtime depends target:libgd3,libtidy58).rustc (>= 1.98)Build-Depends, so the lane installs the Build-Depends explicitly minus rustc/cargo and installs the PINNED toolchain (rust-toolchain.toml, currently 1.98.1) via rustup fetched with curl from the official https://sh.rustup.rs installer — the compiler follows the pin, never the suite.dpkg-buildpackage -us -uc -d: dpkg cannot see the external toolchain and trixie's rustc (1.85) could never satisfy ">= 1.98" anyway; every other depend was installed explicitly (the contract is documented indebian/controlanddebian/rules).lintian --pedantic --fail-on error. The newdebian/source/lintian-overridesoverrideslicense-problem-php-license(trixie's lintian raises it as an error on the deliberate PHP-3.01 licensing, which sid's lintian did not emit), keeping the gate meaningful on every suite..debs in the container and runsdebian/tests/cli+debian/tests/server..deb,.dsc,.tar.xz,.changes,.buildinfoas workflow artifacts.Validation
debian-packageslane completed successfully on this branch (run #6, ~8 min).debian:trixiecontainer: cold build with the rustup-installed pinned toolchain, strict lintian (0E:tags), cleandpkg -i, both packaged smoke tests green.php-server --axumagainst MySQL: install through the engine (12 tables, admin user), front page, pretty permalinks, RSS2 feed, login POST (302 to wp-admin), RESTwp-json.main+ exactly the 7 packaging commits.Apt repository CI flow — an offer
We would also be happy to provide a full apt repository CI flow on top of this lane: an apt-consumable repository (package pool,
Packages/Sources/Contentsindexes, signedRelease/InRelease) published automatically from CI, so users can add onesources.listline andapt install phpr-cli.We usually target GitHub Pages for this — zero hosting cost, the whole flow stays inside Actions, and the repository can be served from the same Pages site — but we are equally happy to support other deployments: self-hosted nginx, S3/static hosting, or an aptly-based setup. Whatever fits this project's infrastructure preferences. Happy to bring that as a follow-up PR if this packaging is of interest.