From 1267bac6e5f097fcfd06709f1cbe9e6e9220de4c Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 22 Nov 2026 20:15:32 +0100 Subject: [PATCH 1/7] Add Debian packaging: phpr-cli (php8.5-cli drop-in) and phpr-server 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). --- php-rust/debian/.gitignore | 11 ++ php-rust/debian/changelog | 16 +++ php-rust/debian/control | 58 +++++++++ php-rust/debian/copyright | 69 +++++++++++ php-rust/debian/man/php-server.1 | 70 +++++++++++ php-rust/debian/man/phpr.1 | 110 ++++++++++++++++++ php-rust/debian/phpr-cli.README.Debian | 42 +++++++ php-rust/debian/phpr-cli.alternatives | 6 + php-rust/debian/phpr-cli.lintian-overrides | 13 +++ php-rust/debian/phpr-cli.manpages | 1 + php-rust/debian/phpr-server.README.Debian | 37 ++++++ php-rust/debian/phpr-server.default | 16 +++ php-rust/debian/phpr-server.dirs | 1 + php-rust/debian/phpr-server.lintian-overrides | 14 +++ php-rust/debian/phpr-server.manpages | 1 + .../debian/phpr-server.phpr-server.service | 21 ++++ php-rust/debian/rules | 81 +++++++++++++ php-rust/debian/shlibs.local | 7 ++ php-rust/debian/source/format | 1 + php-rust/debian/source/options | 13 +++ php-rust/debian/tests/cli | 38 ++++++ php-rust/debian/tests/control | 7 ++ php-rust/debian/tests/server | 42 +++++++ 23 files changed, 675 insertions(+) create mode 100644 php-rust/debian/.gitignore create mode 100644 php-rust/debian/changelog create mode 100644 php-rust/debian/control create mode 100644 php-rust/debian/copyright create mode 100644 php-rust/debian/man/php-server.1 create mode 100644 php-rust/debian/man/phpr.1 create mode 100644 php-rust/debian/phpr-cli.README.Debian create mode 100644 php-rust/debian/phpr-cli.alternatives create mode 100644 php-rust/debian/phpr-cli.lintian-overrides create mode 100644 php-rust/debian/phpr-cli.manpages create mode 100644 php-rust/debian/phpr-server.README.Debian create mode 100644 php-rust/debian/phpr-server.default create mode 100644 php-rust/debian/phpr-server.dirs create mode 100644 php-rust/debian/phpr-server.lintian-overrides create mode 100644 php-rust/debian/phpr-server.manpages create mode 100644 php-rust/debian/phpr-server.phpr-server.service create mode 100755 php-rust/debian/rules create mode 100644 php-rust/debian/shlibs.local create mode 100644 php-rust/debian/source/format create mode 100644 php-rust/debian/source/options create mode 100755 php-rust/debian/tests/cli create mode 100644 php-rust/debian/tests/control create mode 100755 php-rust/debian/tests/server diff --git a/php-rust/debian/.gitignore b/php-rust/debian/.gitignore new file mode 100644 index 00000000..283d2532 --- /dev/null +++ b/php-rust/debian/.gitignore @@ -0,0 +1,11 @@ +# Packaging build state (dh_* staging trees and generated bookkeeping): +# regenerable on every dpkg-buildpackage run, never committed. +/.debhelper/ +/debhelper-build-stamp +/files +/*.substvars +/*.debhelper.log +/*.debhelper +/phpr-cli/ +/phpr-server/ +/tmp/ diff --git a/php-rust/debian/changelog b/php-rust/debian/changelog new file mode 100644 index 00000000..0cde7ec6 --- /dev/null +++ b/php-rust/debian/changelog @@ -0,0 +1,16 @@ +phpr (0.1.0) unstable; urgency=medium + + * Initial Debian packaging of the php-rust workspace. + * phpr-cli: ships /usr/bin/phpr; provides the Debian virtual packages + php-cli and php8.5-cli (plus php-json); conflicts with and replaces + php8.5-cli; registers /usr/bin/php via update-alternatives at + priority 85. No php.ini handling (the engine reads none), no + -v/-m/-i/-l switches yet; documented in README.Debian. + * phpr-server: ships /usr/bin/php-server (union build, cli-server + + axum-server features) and a hardened systemd service running as + www-data, configured via /etc/default/phpr-server. Makes no + php-fpm claim (no FastCGI). + * Tests: installed-package smoke tests via autopkgtest (CLI + server). + * No debian/watch: upstream develops in git without release tarballs. + + -- Francesco Tinti Sun, 22 Nov 2026 12:00:00 +0100 diff --git a/php-rust/debian/control b/php-rust/debian/control new file mode 100644 index 00000000..3dbf62d6 --- /dev/null +++ b/php-rust/debian/control @@ -0,0 +1,58 @@ +Source: phpr +Section: php +Priority: optional +Maintainer: Francesco Tinti +Standards-Version: 4.7.4 +Build-Depends: debhelper-compat (= 13), + rustc (>= 1.98), + cargo (>= 1.98), + cmake, + pkgconf, + zlib1g-dev, + libxml2-dev, + libxslt1-dev, + libgd-dev, + libtidy-dev +Rules-Requires-Root: no +Homepage: https://github.com/francescotinti/php-rust +Vcs-Git: https://github.com/francescotinti/php-rust.git +Vcs-Browser: https://github.com/francescotinti/php-rust + +Package: phpr-cli +Architecture: any +Depends: libgd3, libtidy58, ${shlibs:Depends}, ${misc:Depends} +Provides: php-cli, php8.5-cli, php-json, php8.5-json +Conflicts: php8.5-cli +Replaces: php8.5-cli +Description: command-line interpreter for PHP scripts (Rust reimplementation) + phpr is a from-scratch reimplementation of PHP 8.5.7 in Rust (the + php-rust project). It runs unmodified PHP scripts with the same + observable behaviour as the reference interpreter, byte-for-byte for + everything that lands in PHP strings and output streams. + . + This package installs the /usr/bin/phpr interpreter and registers it + with update-alternatives as /usr/bin/php (priority 85, the 8.5 slot), + so tooling that invokes "php" keeps working. It can coexist with the + packaged php8.4-cli / php8.6-cli; it conflicts with php8.5-cli, whose + package name it also Provides. + . + Known gaps vs the reference CLI (deliberate, documented in + /usr/share/doc/phpr-cli/README.Debian): no php.ini is read, the + -v/-m/-i/-l/-w/--ini switches are not implemented, and php8.5-* + extension modules from the archive have no effect on phpr. + +Package: phpr-server +Architecture: any +Depends: libgd3, libtidy58, ${shlibs:Depends}, ${misc:Depends} +Description: standalone PHP web server (php -S work-alike) + php-server is the web SAPI of the php-rust project: a standalone HTTP + server (a work-alike of "php -S") that serves a document root and + executes PHP requests via the phpr engine, in two modes: the + sequential cli-server mode and an Axum-based multi-worker mode + (shared FIFO queue, one fresh VM per request). + . + This is NOT FastCGI: it does not speak the FPM protocol and therefore + does not replace php8.5-fpm behind nginx/Apache fastcgi_pass. Front + it with any reverse proxy over plain HTTP instead. The service runs + as www-data and is configured through /etc/default/phpr-server + (host, port, document root, worker count). diff --git a/php-rust/debian/copyright b/php-rust/debian/copyright new file mode 100644 index 00000000..93985143 --- /dev/null +++ b/php-rust/debian/copyright @@ -0,0 +1,69 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: php-rust +Upstream-Contact: Francesco Tinti +Source: https://github.com/francescotinti/php-rust + +Files: * +Copyright: 2026 Francesco Tinti +License: PHP-3.01 + +Files: debian/* +Copyright: 2026 Francesco Tinti +License: PHP-3.01 + +License: PHP-3.01 + -------------------------------------------------------------------- + The PHP License, version 3.01 + Copyright (c) 1999 - 2024 The PHP Group. All rights reserved. + -------------------------------------------------------------------- + . + Redistribution and use in source and binary forms, with or without + modification, is permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + . + 3. The name "PHP" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact group@php.net. + . + 4. Products derived from this software may not be called "PHP", nor + may "PHP" appear in their name, without prior written permission + from group@php.net. You may indicate that your software works in + conjunction with PHP by saying "Foo for PHP" instead of calling + it "PHP Foo" or "phpfoo" + . + 5. The PHP Group may publish revised and/or new versions of the + license from time to time. Each version will be given a + distinguishing version number. Once covered code has been + published under a particular version of the license, you may + always continue to use it under the terms of that version. You + may also choose to use such covered code under the terms of any + subsequent version of the license published by the PHP Group. No + one other than the PHP Group has the right to modify the terms + applicable to covered code created under this License. + . + 6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes PHP software, freely available from + ". + . + THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND + ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP + DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + -------------------------------------------------------------------- diff --git a/php-rust/debian/man/php-server.1 b/php-rust/debian/man/php-server.1 new file mode 100644 index 00000000..a0adf28b --- /dev/null +++ b/php-rust/debian/man/php-server.1 @@ -0,0 +1,70 @@ +.TH PHP-SERVER 1 "November 2026" "php-rust" "User Commands" +.SH NAME +php-server \- standalone PHP web server (php \-S work-alike) +.SH SYNOPSIS +.B php-server +.RI [ options ] +.RI [ ROUTER.php ] +.SH DESCRIPTION +.B php-server +is the web SAPI of the php-rust project: a standalone HTTP server that +serves a document root and executes PHP requests through the phpr +engine. It speaks plain HTTP \(em it is +.B not +a FastCGI backend and does not implement the FPM protocol, so it +cannot replace php*-fpm behind nginx/Apache +.BR fastcgi_pass . +Front it with any reverse proxy over HTTP instead. +.PP +Two modes are selected at startup: +.TP +.B cli-server (default) +Byte-faithful work-alike of the reference +.BR "php \-S" : +one thread, sequential request handling, honours a +.I ROUTER.php +router script. +.TP +.B \-\-axum +Axum front end with a pool of N OS worker threads sharing one FIFO +queue; each request runs on a fresh VM (no state leaks between +requests). Note: a router script is +.B not +honoured in this mode; single-process SIGTERM/SIGINT drains cleanly. +.SH OPTIONS +.TP +.BI \-\-host " HOST" +Listen address (default: 127.0.0.1). +.TP +.BI \-\-port " PORT" +Listen port (default: 8080). +.TP +.BI \-\-docroot " DIR" | " \-t DIR" +Document root; resolved to its canonical path and made the process +working directory (default: current directory). +.TP +.BI \-\-workers " N" +Worker count in \-\-axum mode; 0 means one worker per CPU (ignored by +the cli-server mode). +.TP +.B \-\-tier0 +Axum-only diagnostic baseline: static 200 response, no pool, no VM. +.TP +.B \-\-help +Usage summary. +.SH SYSTEMD +On Debian the +.B phpr\-server.service +unit runs this program in \-\-axum mode as the +.B www\-data +user, with settings taken from +.IR /etc/default/phpr\-server +(PHPR_HOST, PHPR_PORT, PHPR_DOCROOT, PHPR_WORKERS). Enabled by default +\(em see +.BR systemctl (1). +.SH SEE ALSO +The CLI interpreter: +.BR phpr (1). +.SH AUTHOR +php-rust by Francesco Tinti. This manual page was written for the +Debian project. diff --git a/php-rust/debian/man/phpr.1 b/php-rust/debian/man/phpr.1 new file mode 100644 index 00000000..b8ef75ba --- /dev/null +++ b/php-rust/debian/man/phpr.1 @@ -0,0 +1,110 @@ +.TH PHPR 1 "November 2026" "php-rust" "User Commands" +.SH NAME +phpr \- command-line interpreter for PHP scripts (Rust reimplementation) +.SH SYNOPSIS +.B phpr +.RB [ \-d +.IR key = value ]... +.RB [ \-n ] +.RB [ \-f ] +.IR script.php +.RI [ args ...] +.br +.B phpr \-r +.I code +.br +.B phpr \-S +.IR addr : port +.RB [ \-t +.IR docroot ] +.RI [ router.php ] +.SH DESCRIPTION +.B phpr +is the CLI SAPI of the php-rust project, a behaviour-compatible +reimplementation of PHP 8.5.7 written in Rust. It executes unmodified +PHP scripts with the same observable behaviour as the reference +interpreter, byte-for-byte for everything that lands in PHP strings +and output streams. Scripts read from stdin and +.B #! +shebang lines are supported, like the reference CLI. +.PP +On Debian, +.BR update-alternatives (1) +exposes +.B phpr +as +.RI /usr/bin/php +(priority 85), so tools invoking +.B php +keep working. Use +.B "update-alternatives --config php" +to select among installed interpreters (php8.4-cli, php8.6-cli, ...). +.SH OPTIONS +.TP +.BI \-d " key=value" +Sets the INI entry +.I key +to +.I value +for this process (no +.B = +means an empty value). Only entries the engine implements are +honoured. +.TP +.B \-n +Accepted for compatibility; the reference CLI skips php.ini with it. +.B phpr +never loads a php.ini at all \(em this flag is a no-op. +.TP +.BI \-f " script" +Interpret +.IR script . +.TP +.BI \-r " code" +Run +.I code +inline (implicit leading +.BR " +# libtidy58 installed) this is automatic. SHLIB_AUX_DIR (optional, +# environment-supplied) covers hosts that stage the runtime libraries +# outside the dpkg database: the SONAME -> package mapping itself is +# declared in debian/shlibs.local either way. +ifneq (,$(SHLIB_AUX_DIR)) +override_dh_shlibdeps: + dh_shlibdeps -l$(SHLIB_AUX_DIR) +endif diff --git a/php-rust/debian/shlibs.local b/php-rust/debian/shlibs.local new file mode 100644 index 00000000..5f44ab22 --- /dev/null +++ b/php-rust/debian/shlibs.local @@ -0,0 +1,7 @@ +# Local shlibs knowledge for dpkg-shlibdeps: phpr links the system +# libtidy (byte-parity FFI, like libgd/libxml2/libxslt/zlib). On build +# hosts where libtidy58 is not installed, dpkg-shlibdeps cannot map +# libtidy.so.58 to its package; the mapping is stable, so declare it +# locally. The runtime dependency is also stated explicitly in +# debian/control (libgd3, libtidy58). +libtidy 58 libtidy58 diff --git a/php-rust/debian/source/format b/php-rust/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/php-rust/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/php-rust/debian/source/options b/php-rust/debian/source/options new file mode 100644 index 00000000..5d4f1bd5 --- /dev/null +++ b/php-rust/debian/source/options @@ -0,0 +1,13 @@ +# Native tarball hygiene: the git tree carries per-session measurement +# harnesses (wp*-harness), session diaries, the vet catalogue and local +# tool configs that are development-history material, not needed to +# build or run phpr. tar-ignore patterns go straight to tar(1) --exclude +# (Files-Excluded in debian/copyright has no effect on 3.0 (native)). +tar-ignore = "wp*-harness*" +tar-ignore = "sessions*" +tar-ignore = "gaps*" +tar-ignore = ".claude*" +tar-ignore = ".cargo*" +tar-ignore = "._*" +tar-ignore = ".DS_Store" +tar-ignore = "phpr-target-bundle.sh" diff --git a/php-rust/debian/tests/cli b/php-rust/debian/tests/cli new file mode 100755 index 00000000..fa4a9fe6 --- /dev/null +++ b/php-rust/debian/tests/cli @@ -0,0 +1,38 @@ +#!/bin/sh +# Installed-package smoke test for phpr-cli: arithmetic, argv, the +# update-alternatives registration and a json round-trip (the package +# claims Provides: php-json). +set -e + +out=$(/usr/bin/phpr -r 'echo 6*7;') +if [ "$out" != "42" ]; then + echo "FAIL: arithmetic, got '$out'" >&2 + exit 1 +fi + +out=$(/usr/bin/phpr -r 'echo json_encode(json_decode("[1,\"two\"]"));') +if [ "$out" != '[1,"two"]' ]; then + echo "FAIL: json round-trip, got '$out'" >&2 + exit 1 +fi + +# The package must hold the /usr/bin/php alternative at priority 85. +if ! update-alternatives --query php 2>/dev/null | grep -q '^Value: /usr/bin/phpr$'; then + echo "note: /usr/bin/php not currently pointing at phpr (higher-priority PHP installed?)" >&2 +fi +if ! update-alternatives --query php 2>/dev/null | grep -q '^/usr/bin/phpr$'; then + echo "FAIL: phpr not registered as a php alternative" >&2 + exit 1 +fi + +# A script with argv passthrough, the common cron/CLI shape. +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT +printf ' "$tmp/args.php" +out=$(/usr/bin/phpr "$tmp/args.php" foo bar) +if [ "$out" != "foobar" ]; then + echo "FAIL: script argv, got '$out'" >&2 + exit 1 +fi + +echo "cli smoke OK: 42, json round-trip, alternatives, argv" diff --git a/php-rust/debian/tests/control b/php-rust/debian/tests/control new file mode 100644 index 00000000..d4068fb8 --- /dev/null +++ b/php-rust/debian/tests/control @@ -0,0 +1,7 @@ +Tests: cli +Restrictions: allow-stderr +Depends: @, phpr-cli + +Tests: server +Restrictions: allow-stderr +Depends: @, phpr-server, curl diff --git a/php-rust/debian/tests/server b/php-rust/debian/tests/server new file mode 100755 index 00000000..26a6b55d --- /dev/null +++ b/php-rust/debian/tests/server @@ -0,0 +1,42 @@ +#!/bin/sh +# Installed-package smoke test for phpr-server: run the packaged +# binary in --axum mode against a throwaway document root and fetch +# a rendered PHP page over HTTP. +set -e + +docroot=$(mktemp -d) +trap 'rm -rf "$docroot"; [ -n "${srv:-}" ] && kill "$srv" 2>/dev/null || true' EXIT +printf ' "$docroot/index.php" + +/usr/bin/php-server --axum --host 127.0.0.1 --port 18099 --docroot "$docroot" & +srv=$! + +# Wait for the listener (the server binds before logging readiness). +i=0 +while ! curl -sf -o /dev/null http://127.0.0.1:18099/ 2>/dev/null; do + i=$((i+1)) + if [ "$i" -gt 50 ]; then + echo "FAIL: server never came up" >&2 + exit 1 + fi + sleep 0.1 +done + +out=$(curl -sf http://127.0.0.1:18099/) +if [ "$out" != "hello 42" ]; then + echo "FAIL: rendered page, got '$out'" >&2 + exit 1 +fi + +# Static file from the docroot walk. +printf 'static' > "$docroot/data.txt" +out=$(curl -sf http://127.0.0.1:18099/data.txt) +if [ "$out" != "static" ]; then + echo "FAIL: static file, got '$out'" >&2 + exit 1 +fi + +kill "$srv" +wait "$srv" 2>/dev/null || true +srv= +echo "server smoke OK: php page + static file over HTTP" From 3e439e4ee4dea11c826fd43764348a195ab3201b Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 22 Nov 2026 20:20:10 +0100 Subject: [PATCH 2/7] Add CI lane: build the Debian packages and publish them as artifacts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/debian-packages.yml | 107 ++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/debian-packages.yml diff --git a/.github/workflows/debian-packages.yml b/.github/workflows/debian-packages.yml new file mode 100644 index 00000000..38ba9b04 --- /dev/null +++ b/.github/workflows/debian-packages.yml @@ -0,0 +1,107 @@ +# Debian packaging build lane. +# +# Builds the phpr Debian packages (php-rust/debian) on the same distro +# the packages target and publishes them as workflow artifacts: +# - phpr-cli_*_amd64.deb, phpr-server_*_amd64.deb +# - native source set (.dsc, .tar.xz) + .changes/.buildinfo +# +# This lane is deliberately SEPARATE from ci.yml (the build-and-test +# gate for main): it does not run unit tests (they live in ci.yml and +# in the local oracle gates) and it only reacts to the packaging branch. +# +# Toolchain stance (php-rust pins rustc/cargo 1.98.1, REGOLE §AGENTS): +# the job builds with Debian's packaged rustc/cargo — debian:sid ships +# 1.98.x today, exactly the pin. The pin-guard step FAILS LOUDLY when +# sid drifts to another compiler: a toolchain change must be a +# deliberate decision, never something a moving container tag smuggles +# into a build. If the guard fires, update the image reference and +# rust-toolchain.toml in one deliberate commit. +name: debian-packages + +on: + push: + branches: [debian-packaging] + workflow_dispatch: + +permissions: + contents: read + +# The workspace layout: the git repo ROOT contains php-rust/ (the cargo +# workspace + debian/). dpkg-buildpackage runs in php-rust/ and writes +# its artifacts (../) to the repo root. +defaults: + run: + working-directory: php-rust + +concurrency: + group: debian-packages-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-packages: + runs-on: ubuntu-latest + # Same distro family as the packaging target (this box's verification + # host: Debian forky/sid, rustc/cargo 1.98.1 = the project pin). + container: docker.io/library/debian:sid + timeout-minutes: 60 + steps: + - uses: actions/checkout@v5 + + - name: Report build environment + run: | + cat /etc/os-release | head -2 + dpkg --print-architecture + rustc --version + cargo --version + + # The single source of truth for build inputs is debian/control + # (all toolchain + FFI dev packages are declared there for clean + # chroots) — apt-get build-dep keeps this step in sync with it. + - name: Install build dependencies (from debian/control) + run: | + apt-get update -qq + apt-get install -y --no-install-recommends dpkg-dev curl + apt-get build-dep -y . + + # debian/rules pins RUSTC=/usr/bin/rustc (Debian's compiler) so + # cargo never resolves through any rustup shim; this guard asserts + # that compiler is the one the project pins. + - name: Toolchain pin guard (1.98.1) + run: | + pinned=$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml) + actual=$(rustc --version | awk '{print $2}') + echo "pinned: $pinned, debian sid ships: $actual" + if [ "$pinned" != "$actual" ]; then + echo "::error::debian:sid rustc ($actual) != pinned toolchain ($pinned). Pin the container image and update the pin in one deliberate commit." + exit 1 + fi + + - name: Build packages + run: | + dpkg-buildpackage -us -uc + + - name: Lintian (fail on errors; warnings reported) + run: | + apt-get install -y --no-install-recommends lintian + lintian --pedantic --fail-on error ../*.changes + + # Installed-package smoke: the same tests autopkgtest would run on + # a real testbed (debian/tests/{cli,server}), executed as root in + # this container. dpkg -i needs no dependency resolution here: the + # build-dep step already installed every runtime library. + - name: Smoke test (installed packages) + run: | + dpkg -i ../phpr-cli_*_amd64.deb ../phpr-server_*_amd64.deb + debian/tests/cli + debian/tests/server + + - name: Collect artifacts + run: | + ls -l .. + mkdir -p /tmp/out && cp ../*.deb ../*.dsc ../*.tar.xz ../*.changes ../*.buildinfo /tmp/out/ + + - uses: actions/upload-artifact@v4 + with: + name: phpr-debian-packages-amd64 + path: /tmp/out/* + if-no-files-found: error From 8883b5712e408a00edfb01eb170894eee4ea8a4a Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 22 Nov 2026 20:21:37 +0100 Subject: [PATCH 3/7] CI: install build deps before reporting the toolchain 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). --- .github/workflows/debian-packages.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/debian-packages.yml b/.github/workflows/debian-packages.yml index 38ba9b04..0a854f31 100644 --- a/.github/workflows/debian-packages.yml +++ b/.github/workflows/debian-packages.yml @@ -47,6 +47,14 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Install build dependencies (from debian/control) + # debian:sid ships no compiler: rustc/cargo arrive HERE, via the + # Build-Depends declared in debian/control. + run: | + apt-get update -qq + apt-get install -y --no-install-recommends dpkg-dev curl + apt-get build-dep -y . + - name: Report build environment run: | cat /etc/os-release | head -2 @@ -54,15 +62,6 @@ jobs: rustc --version cargo --version - # The single source of truth for build inputs is debian/control - # (all toolchain + FFI dev packages are declared there for clean - # chroots) — apt-get build-dep keeps this step in sync with it. - - name: Install build dependencies (from debian/control) - run: | - apt-get update -qq - apt-get install -y --no-install-recommends dpkg-dev curl - apt-get build-dep -y . - # debian/rules pins RUSTC=/usr/bin/rustc (Debian's compiler) so # cargo never resolves through any rustup shim; this guard asserts # that compiler is the one the project pins. From 1d5839f880cd8b0b5b6e79bb97e212a198defd4b Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 22 Nov 2026 20:23:12 +0100 Subject: [PATCH 4/7] CI: install ca-certificates in the build container 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. --- .github/workflows/debian-packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/debian-packages.yml b/.github/workflows/debian-packages.yml index 0a854f31..f673543e 100644 --- a/.github/workflows/debian-packages.yml +++ b/.github/workflows/debian-packages.yml @@ -9,7 +9,7 @@ # gate for main): it does not run unit tests (they live in ci.yml and # in the local oracle gates) and it only reacts to the packaging branch. # -# Toolchain stance (php-rust pins rustc/cargo 1.98.1, REGOLE §AGENTS): +# Toolchain stance (php-rust pins rustc/cargo 1.98.1): # the job builds with Debian's packaged rustc/cargo — debian:sid ships # 1.98.x today, exactly the pin. The pin-guard step FAILS LOUDLY when # sid drifts to another compiler: a toolchain change must be a @@ -52,7 +52,7 @@ jobs: # Build-Depends declared in debian/control. run: | apt-get update -qq - apt-get install -y --no-install-recommends dpkg-dev curl + apt-get install -y --no-install-recommends dpkg-dev curl ca-certificates apt-get build-dep -y . - name: Report build environment From 2b243fd86f5da3e95c03a6b67471f856cd31354e Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 22 Nov 2026 20:26:57 +0100 Subject: [PATCH 5/7] CI/build: rustup fallback for the toolchain pin; libclang build dep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- .github/workflows/debian-packages.yml | 46 ++++++++++++++++++--------- php-rust/debian/control | 3 +- php-rust/debian/rules | 27 +++++++++++----- 3 files changed, 52 insertions(+), 24 deletions(-) diff --git a/.github/workflows/debian-packages.yml b/.github/workflows/debian-packages.yml index f673543e..29cf0826 100644 --- a/.github/workflows/debian-packages.yml +++ b/.github/workflows/debian-packages.yml @@ -10,12 +10,16 @@ # in the local oracle gates) and it only reacts to the packaging branch. # # Toolchain stance (php-rust pins rustc/cargo 1.98.1): -# the job builds with Debian's packaged rustc/cargo — debian:sid ships -# 1.98.x today, exactly the pin. The pin-guard step FAILS LOUDLY when -# sid drifts to another compiler: a toolchain change must be a -# deliberate decision, never something a moving container tag smuggles -# into a build. If the guard fires, update the image reference and -# rust-toolchain.toml in one deliberate commit. +# - Debian's rustc/cargo when they MATCH the pin — fully deterministic, +# no rustup involved (debian:sid ships 1.98.x today); +# - when Debian's compiler is not the pinned one (either direction), +# install the PINNED toolchain with rustup and build with it. A +# compiler change is a deliberate decision expressed by the pin, not +# something a moving container tag smuggles in. +# The resolved absolute toolchain pair is handed to dpkg-buildpackage +# via CARGO/RUSTC (debian/rules honours both). debian/rules strips +# ~/.cargo/bin from the build PATH, so rustup's proxy shims stay inert +# even in rustup mode. name: debian-packages on: @@ -62,20 +66,32 @@ jobs: rustc --version cargo --version - # debian/rules pins RUSTC=/usr/bin/rustc (Debian's compiler) so - # cargo never resolves through any rustup shim; this guard asserts - # that compiler is the one the project pins. - - name: Toolchain pin guard (1.98.1) + # Resolves the build toolchain per the lane's policy and exposes + # the absolute paths via step outputs. + - name: Resolve toolchain (Debian's, or the pin via rustup) + id: toolchain run: | pinned=$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml) - actual=$(rustc --version | awk '{print $2}') - echo "pinned: $pinned, debian sid ships: $actual" - if [ "$pinned" != "$actual" ]; then - echo "::error::debian:sid rustc ($actual) != pinned toolchain ($pinned). Pin the container image and update the pin in one deliberate commit." - exit 1 + debian_rustc=$(rustc --version | awk '{print $2}') + echo "pinned: $pinned, debian sid ships: $debian_rustc" + if [ "$pinned" = "$debian_rustc" ]; then + echo "cargo=/usr/bin/cargo" >> "$GITHUB_OUTPUT" + echo "rustc=/usr/bin/rustc" >> "$GITHUB_OUTPUT" + else + echo "Debian rustc ($debian_rustc) != pin ($pinned): installing the pinned toolchain via rustup" + apt-get install -y --no-install-recommends rustup + rustup toolchain install "$pinned" --profile minimal + cargo_bin=$(rustup which --toolchain "$pinned" cargo) + rustc_bin=$(rustup which --toolchain "$pinned" rustc) + echo "cargo=$cargo_bin" >> "$GITHUB_OUTPUT" + echo "rustc=$rustc_bin" >> "$GITHUB_OUTPUT" fi + cat "$GITHUB_OUTPUT" | sed 's/^/resolved: /' - name: Build packages + env: + CARGO: ${{ steps.toolchain.outputs.cargo }} + RUSTC: ${{ steps.toolchain.outputs.rustc }} run: | dpkg-buildpackage -us -uc diff --git a/php-rust/debian/control b/php-rust/debian/control index 3dbf62d6..e62e88ea 100644 --- a/php-rust/debian/control +++ b/php-rust/debian/control @@ -12,7 +12,8 @@ Build-Depends: debhelper-compat (= 13), libxml2-dev, libxslt1-dev, libgd-dev, - libtidy-dev + libtidy-dev, + libclang-dev Rules-Requires-Root: no Homepage: https://github.com/francescotinti/php-rust Vcs-Git: https://github.com/francescotinti/php-rust.git diff --git a/php-rust/debian/rules b/php-rust/debian/rules index 40d7d552..1baee749 100755 --- a/php-rust/debian/rules +++ b/php-rust/debian/rules @@ -10,15 +10,26 @@ %: dh $@ -CARGO := /usr/bin/cargo +# Toolchain contract: by default the build uses Debian's own +# rustc/cargo — on the targeting suite these equal the version pinned +# in rust-toolchain.toml (the project pin), which keeps the build fully +# deterministic and out of rustup's reach. +# +# A caller MAY supply both CARGO and RUSTC (absolute paths of a complete +# toolchain pair, e.g. resolved via rustup) when Debian's compiler is +# not the pinned one — the CI lane does exactly that (see +# .github/workflows/debian-packages.yml): Debian's rustc when it matches +# the pin, the rustup-installed pinned toolchain otherwise. Both variables +# must name the SAME toolchain; only one is never honoured. +CARGO ?= /usr/bin/cargo +export RUSTC ?= /usr/bin/rustc -# Deterministic toolchain: Debian's rustc/cargo 1.98.1 — the same version -# this project pins in rust-toolchain.toml. RUSTC is exported so cargo -# never resolves rustc through the rustup shim in ~/.cargo/bin (which -# auto-installs toolchains and can mix compiler versions inside one -# build): PATH is restricted for the same reason (plain /usr/bin/tools), -# and build rustc resolves below the layered/modules working-core PATH. -export RUSTC := /usr/bin/rustc +# The rustup proxy shims live in ~/.cargo/bin and resolve by CWD +# toolchain file — the build must never reach them (broken-cache +# incident: one shim mixed three compiler versions in one build). +# Both paths above are absolute, so the shims are never needed; strip +# the directory from PATH to be sure, also under a rustup-provided +# toolchain. export PATH := /usr/bin:/bin:/usr/sbin:/sbin # Build artifacts NEVER inside the source tree (project rule: no run From 3f116ff9a9e8c84c284dee9f32fbe1bed26ba188 Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 22 Nov 2026 20:38:53 +0100 Subject: [PATCH 6/7] tests: fix the php-alternative assertion in the cli smoke MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- php-rust/debian/tests/cli | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/php-rust/debian/tests/cli b/php-rust/debian/tests/cli index fa4a9fe6..0e33d254 100755 --- a/php-rust/debian/tests/cli +++ b/php-rust/debian/tests/cli @@ -17,10 +17,12 @@ if [ "$out" != '[1,"two"]' ]; then fi # The package must hold the /usr/bin/php alternative at priority 85. +# (Non-fatal: if a higher-priority PHP is installed, /usr/bin/php can +# legitimately point elsewhere; the registration itself must exist.) if ! update-alternatives --query php 2>/dev/null | grep -q '^Value: /usr/bin/phpr$'; then echo "note: /usr/bin/php not currently pointing at phpr (higher-priority PHP installed?)" >&2 fi -if ! update-alternatives --query php 2>/dev/null | grep -q '^/usr/bin/phpr$'; then +if ! update-alternatives --query php 2>/dev/null | grep -q '^Alternative: /usr/bin/phpr$'; then echo "FAIL: phpr not registered as a php alternative" >&2 exit 1 fi From 7f4c4e684297797f9e7d94c39a8f1ffd7b304b01 Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Mon, 23 Nov 2026 17:30:19 +0100 Subject: [PATCH 7/7] CI/packaging: build the packages on Debian trixie with a curl-installed 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. --- .github/workflows/debian-packages.yml | 103 +++++++++++++---------- php-rust/debian/control | 9 ++ php-rust/debian/rules | 14 +-- php-rust/debian/source/lintian-overrides | 9 ++ 4 files changed, 83 insertions(+), 52 deletions(-) create mode 100644 php-rust/debian/source/lintian-overrides diff --git a/.github/workflows/debian-packages.yml b/.github/workflows/debian-packages.yml index 29cf0826..03acde6c 100644 --- a/.github/workflows/debian-packages.yml +++ b/.github/workflows/debian-packages.yml @@ -10,16 +10,19 @@ # in the local oracle gates) and it only reacts to the packaging branch. # # Toolchain stance (php-rust pins rustc/cargo 1.98.1): -# - Debian's rustc/cargo when they MATCH the pin — fully deterministic, -# no rustup involved (debian:sid ships 1.98.x today); -# - when Debian's compiler is not the pinned one (either direction), -# install the PINNED toolchain with rustup and build with it. A -# compiler change is a deliberate decision expressed by the pin, not -# something a moving container tag smuggles in. -# The resolved absolute toolchain pair is handed to dpkg-buildpackage -# via CARGO/RUSTC (debian/rules honours both). debian/rules strips -# ~/.cargo/bin from the build PATH, so rustup's proxy shims stay inert -# even in rustup mode. +# The lane builds on debian:trixie, whose rustc (1.85) can never +# satisfy the "rustc (>= 1.98)" Build-Depends. The PINNED toolchain +# therefore ALWAYS arrives via rustup — fetched with curl from the +# official https://sh.rustup.rs installer, never from the Debian +# archive — so the compiler follows the pin, not the suite. The +# resolved absolute toolchain pair is handed to dpkg-buildpackage +# via CARGO/RUSTC (debian/rules honours both). debian/rules strips +# ~/.cargo/bin from the build PATH, so rustup's proxy shims stay +# inert even in rustup mode. +# +# The workspace layout: the git repo ROOT contains php-rust/ (the cargo +# workspace + debian/). dpkg-buildpackage runs in php-rust/ and writes +# its artifacts (../) to the repo root. name: debian-packages on: @@ -30,9 +33,6 @@ on: permissions: contents: read -# The workspace layout: the git repo ROOT contains php-rust/ (the cargo -# workspace + debian/). dpkg-buildpackage runs in php-rust/ and writes -# its artifacts (../) to the repo root. defaults: run: working-directory: php-rust @@ -44,48 +44,54 @@ concurrency: jobs: build-packages: runs-on: ubuntu-latest - # Same distro family as the packaging target (this box's verification - # host: Debian forky/sid, rustc/cargo 1.98.1 = the project pin). - container: docker.io/library/debian:sid + # The packaging target distro. trixie's rustc is older than the + # pin (1.85 vs 1.98.1), so the compiler never comes from apt here: + # the pinned toolchain is rustup-installed in a later step. + container: docker.io/library/debian:trixie timeout-minutes: 60 steps: - uses: actions/checkout@v5 - - name: Install build dependencies (from debian/control) - # debian:sid ships no compiler: rustc/cargo arrive HERE, via the - # Build-Depends declared in debian/control. - run: | - apt-get update -qq - apt-get install -y --no-install-recommends dpkg-dev curl ca-certificates - apt-get build-dep -y . - - name: Report build environment run: | - cat /etc/os-release | head -2 + head -2 /etc/os-release dpkg --print-architecture - rustc --version - cargo --version - # Resolves the build toolchain per the lane's policy and exposes - # the absolute paths via step outputs. - - name: Resolve toolchain (Debian's, or the pin via rustup) + - name: Install build dependencies + # trixie cannot resolve "rustc (>= 1.98)" (debian/control), so + # apt-get build-dep is out: install the Build-Depends EXPLICITLY, + # MINUS rustc/cargo — the pinned toolchain arrives via rustup in + # the next step. libgd3/libtidy58 come along as runtime + # dependencies of the -dev packages, so the later `dpkg -i` + # smoke step needs no extra dependency resolution. lintian ships + # here too for the gate below. + run: | + apt-get update -qq + apt-get install -y --no-install-recommends \ + dpkg-dev curl ca-certificates \ + build-essential debhelper cmake pkgconf \ + zlib1g-dev libxml2-dev libxslt1-dev libgd-dev libtidy-dev \ + libclang-dev lintian + + # Installs the pinned toolchain per the lane's policy and exposes + # the absolute paths via step outputs. rustup itself comes from + # the official installer (curl), the toolchain from the pin in + # rust-toolchain.toml. + - name: Install the pinned toolchain (rustup via curl) id: toolchain run: | pinned=$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml) - debian_rustc=$(rustc --version | awk '{print $2}') - echo "pinned: $pinned, debian sid ships: $debian_rustc" - if [ "$pinned" = "$debian_rustc" ]; then - echo "cargo=/usr/bin/cargo" >> "$GITHUB_OUTPUT" - echo "rustc=/usr/bin/rustc" >> "$GITHUB_OUTPUT" - else - echo "Debian rustc ($debian_rustc) != pin ($pinned): installing the pinned toolchain via rustup" - apt-get install -y --no-install-recommends rustup - rustup toolchain install "$pinned" --profile minimal - cargo_bin=$(rustup which --toolchain "$pinned" cargo) - rustc_bin=$(rustup which --toolchain "$pinned" rustc) - echo "cargo=$cargo_bin" >> "$GITHUB_OUTPUT" - echo "rustc=$rustc_bin" >> "$GITHUB_OUTPUT" - fi + echo "pinned: $pinned" + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- -y --profile minimal --default-toolchain none + . "$HOME/.cargo/env" + rustup toolchain install "$pinned" --profile minimal + cargo_bin=$(rustup which --toolchain "$pinned" cargo) + rustc_bin=$(rustup which --toolchain "$pinned" rustc) + echo "cargo=$cargo_bin" >> "$GITHUB_OUTPUT" + echo "rustc=$rustc_bin" >> "$GITHUB_OUTPUT" + "$rustc_bin" --version + "$cargo_bin" --version cat "$GITHUB_OUTPUT" | sed 's/^/resolved: /' - name: Build packages @@ -93,11 +99,16 @@ jobs: CARGO: ${{ steps.toolchain.outputs.cargo }} RUSTC: ${{ steps.toolchain.outputs.rustc }} run: | - dpkg-buildpackage -us -uc + # -d (no check-builddeps): dpkg cannot see the rustup + # toolchain, and trixie's apt rustc could never satisfy + # ">= 1.98" anyway. Every other Build-Depend was installed + # explicitly in the earlier step; the lane was validated + # end-to-end on trixie (build, lintian gate, dpkg -i, both + # packaged smoke tests green). + dpkg-buildpackage -us -uc -d - name: Lintian (fail on errors; warnings reported) run: | - apt-get install -y --no-install-recommends lintian lintian --pedantic --fail-on error ../*.changes # Installed-package smoke: the same tests autopkgtest would run on diff --git a/php-rust/debian/control b/php-rust/debian/control index e62e88ea..eb31ff99 100644 --- a/php-rust/debian/control +++ b/php-rust/debian/control @@ -3,6 +3,15 @@ Section: php Priority: optional Maintainer: Francesco Tinti Standards-Version: 4.7.4 +# Toolchain note (trixie): the rustc/cargo Build-Depends below pin the +# compiler for suites that ship a matching rustc via apt (the +# verification host runs Debian forky/sid). Debian trixie ships +# rustc 1.85 and can never satisfy ">= 1.98": a trixie build (the CI +# lane in .github/workflows/debian-packages.yml) installs these +# Build-Depends explicitly MINUS rustc/cargo, installs the pinned +# toolchain with rustup (https://sh.rustup.rs, fetched with curl) and +# builds with `dpkg-buildpackage -d`, passing the absolute toolchain +# pair via CARGO/RUSTC (debian/rules honours both). Build-Depends: debhelper-compat (= 13), rustc (>= 1.98), cargo (>= 1.98), diff --git a/php-rust/debian/rules b/php-rust/debian/rules index 1baee749..5b71db39 100755 --- a/php-rust/debian/rules +++ b/php-rust/debian/rules @@ -11,15 +11,17 @@ dh $@ # Toolchain contract: by default the build uses Debian's own -# rustc/cargo — on the targeting suite these equal the version pinned -# in rust-toolchain.toml (the project pin), which keeps the build fully -# deterministic and out of rustup's reach. +# rustc/cargo WHEN they equal the version pinned in rust-toolchain.toml +# (the project pin). Debian trixie ships an older rustc (1.85 today) +# and can never satisfy the pin from apt, so trixie builds (the CI +# lane, .github/workflows/debian-packages.yml) never rely on Debian's +# compiler: the lane installs the PINNED toolchain with rustup +# (https://sh.rustup.rs) and passes the absolute pair below via +# CARGO/RUSTC. # # A caller MAY supply both CARGO and RUSTC (absolute paths of a complete # toolchain pair, e.g. resolved via rustup) when Debian's compiler is -# not the pinned one — the CI lane does exactly that (see -# .github/workflows/debian-packages.yml): Debian's rustc when it matches -# the pin, the rustup-installed pinned toolchain otherwise. Both variables +# not the pinned one. Both variables # must name the SAME toolchain; only one is never honoured. CARGO ?= /usr/bin/cargo export RUSTC ?= /usr/bin/rustc diff --git a/php-rust/debian/source/lintian-overrides b/php-rust/debian/source/lintian-overrides new file mode 100644 index 00000000..9fc5212a --- /dev/null +++ b/php-rust/debian/source/lintian-overrides @@ -0,0 +1,9 @@ +# lintian (from trixie on) raises license-problem-php-license as an +# ERROR for any PHP-licensed software that is not the PHP interpreter +# itself; sid's lintian did not emit it. The PHP License 3.01 is the +# deliberate, documented licensing decision of this project (AGENTS.md, +# "Licenza"; debian/copyright keeps the canonical text), so the tag is +# overridden at source level: the --fail-on error gate of the CI lane +# (.github/workflows/debian-packages.yml) stays meaningful on every +# suite without special-casing the build distro. +license-problem-php-license