Compare commits

..
Author SHA1 Message Date
shadowdaoandClaude Sonnet 5.5 fe9d9fe181 fix(lsphp): post-install check asserts exact resolved pins incl. -ldap [skip ci]
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 09:46:06 -08:00
shadowdaoandClaude Sonnet 5.5 40f62c2b64 fix(lsphp): per-package pins so an inconsistent LiteSpeed 8.4 set still builds [skip ci]
Stage 2 pinned lsphp84, -common and -ldap to one version; LiteSpeed's repo
offers lsphp84 8.4.27-2 but lsphp84-common only 8.4.27-3 (run 5691 job 18704:
E: Version '8.4.27-2+noble' for 'lsphp84-common' was not found). New
scripts/lsphp-pin-resolve.sh resolves -common/-ldap to the exact version when
offered (unchanged for 82/83/85), else a same-PHP-version, same-distro,
>= revision; never a different PHP release. lsphp84 itself stays exact and the
post-install check requires same upstream + >=. Fixture test added to CI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 09:44:50 -08:00
jknappandClaude Sonnet 5.5 d792a6549b Merge pull request #43: re-pin LSAPI to 8.4 [skip ci]
[skip ci]

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 15:37:16 +00:00
shadowdaoandClaude Sonnet 5.5 ea219b4adf lsphp-src: re-pin LiteSpeed SAPI to php-litespeed-8.4.tgz (matches packaged -2 builds)
Run 5686 passed the ini gate but failed the LSAPI name-set gate: packaged lsphp82-85 carry LSAPI_ENABLE_ADMIN_OVERRIDE / 'LiteSpeed V8.4', absent from the 8.3 tgz. Gate kept. [skip ci]

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 07:37:13 -08:00
jknappandClaude Sonnet 5.5 95cced5144 Merge pull request #42: lsphp-src-build reproduce upload_progress default [skip ci]
[skip ci]

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
2026-11-19 14:56:03 +00:00
6 changed files with 143 additions and 4 deletions

No files matched your search

+5
View File
@@ -64,6 +64,8 @@ jobs:
scripts/create-vhost-litespeed.sh \ scripts/create-vhost-litespeed.sh \
scripts/install-lscache-wp.sh \ scripts/install-lscache-wp.sh \
scripts/lsphp-apt-upgrade.sh \ scripts/lsphp-apt-upgrade.sh \
scripts/lsphp-pin-resolve.sh \
scripts/tests/lsphp-pin-resolve.test.sh \
scripts/lsphp-src-build.sh \ scripts/lsphp-src-build.sh \
scripts/lsphp-src-overlay.sh \ scripts/lsphp-src-overlay.sh \
scripts/lsphp-abi-gate.sh \ scripts/lsphp-abi-gate.sh \
@@ -83,6 +85,9 @@ jobs:
.gitea/scripts/resolve-base-image.sh \ .gitea/scripts/resolve-base-image.sh \
.gitea/scripts/plan-legs.sh .gitea/scripts/plan-legs.sh
- name: lsphp pin-resolve fixture test
run: ./scripts/tests/lsphp-pin-resolve.test.sh
- name: lsphp repo-version lookup test - name: lsphp repo-version lookup test
run: ./scripts/tests/lsphp-repo-version.test.sh run: ./scripts/tests/lsphp-repo-version.test.sh
+12 -2
View File
@@ -220,12 +220,21 @@ COPY ./scripts/pkg-cache-repos.sh /usr/local/sbin/pkg-cache-repos.sh
COPY ./keys/pkg-cache/ /usr/local/share/pkg-cache/ COPY ./keys/pkg-cache/ /usr/local/share/pkg-cache/
COPY --from=ext-build /build-out/lsphp.version /etc/cac-lsphp-build.version COPY --from=ext-build /build-out/lsphp.version /etc/cac-lsphp-build.version
COPY ./scripts/lsphp-apt-upgrade.sh /usr/local/sbin/lsphp-apt-upgrade.sh COPY ./scripts/lsphp-apt-upgrade.sh /usr/local/sbin/lsphp-apt-upgrade.sh
COPY --chmod=0755 ./scripts/lsphp-pin-resolve.sh /usr/local/sbin/lsphp-pin-resolve.sh
## Per-package pins: lsphpNN is pinned to $V exactly; -common/-ldap to $V when the
## repo offers it, else to a same-PHP-version packaging revision >= $V (LiteSpeed
## published lsphp84 -2 with lsphp84-common -3 on 2026-11-19). See the script.
RUN set -e; \ RUN set -e; \
PR=/usr/local/sbin/lsphp-pin-resolve.sh; \
V=$(cat /etc/cac-lsphp-build.version); \ V=$(cat /etc/cac-lsphp-build.version); \
/usr/local/sbin/pkg-cache-repos.sh apt; \ /usr/local/sbin/pkg-cache-repos.sh apt; \
apt-get update --error-on=any; \
VC=$($PR resolve lsphp${PHPVER}-common "$V"); \
VL=$($PR resolve lsphp${PHPVER}-ldap "$V"); \
echo "lsphp pins: lsphp${PHPVER}=$V -common=$VC -ldap=$VL"; \
if ! /usr/local/sbin/lsphp-apt-upgrade.sh "${PHPVER}" \ if ! /usr/local/sbin/lsphp-apt-upgrade.sh "${PHPVER}" \
ca-certificates \ ca-certificates \
lsphp${PHPVER}="$V" lsphp${PHPVER}-common="$V" lsphp${PHPVER}-ldap="$V"; then \ lsphp${PHPVER}="$V" lsphp${PHPVER}-common="$VC" lsphp${PHPVER}-ldap="$VL"; then \
echo "FATAL: lsphp-apt-upgrade.sh failed (reason above). If apt said" >&2; \ echo "FATAL: lsphp-apt-upgrade.sh failed (reason above). If apt said" >&2; \
echo " \"Version '$V' ... was not found\" or refused a downgrade: $V is what" >&2; \ echo " \"Version '$V' ... was not found\" or refused a downgrade: $V is what" >&2; \
echo " cac_path_parity was compiled against, but the LiteSpeed repo (which" >&2; \ echo " cac_path_parity was compiled against, but the LiteSpeed repo (which" >&2; \
@@ -239,7 +248,8 @@ RUN set -e; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
RTV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}); \ RTV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}); \
CMV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}-common); \ CMV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}-common); \
if [ "$RTV" != "$V" ] || [ "$CMV" != "$V" ]; then \ LDV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}-ldap); \
if [ "$RTV" != "$V" ] || [ "$CMV" != "$VC" ] || [ "$LDV" != "$VL" ] || ! $PR ok "$CMV" "$V"; then \
echo "FATAL: cac_path_parity.so was compiled against lsphp${PHPVER} $V but this" >&2; \ echo "FATAL: cac_path_parity.so was compiled against lsphp${PHPVER} $V but this" >&2; \
echo " image would ship lsphp${PHPVER}=$RTV / -common=$CMV." >&2; \ echo " image would ship lsphp${PHPVER}=$RTV / -common=$CMV." >&2; \
echo " Rebuild with --no-cache so both stages resolve the same release." >&2; \ echo " Rebuild with --no-cache so both stages resolve the same release." >&2; \
+1 -1
View File
@@ -96,7 +96,7 @@ Each of the following fails the build:
| OpenPGP signature | `gpgv` rejects the `.asc` against `keys/php-src/php-keyring.asc`, or the signer's primary fingerprint is not listed for that branch in `keys/php-src/release-managers.txt`. | | OpenPGP signature | `gpgv` rejects the `.asc` against `keys/php-src/php-keyring.asc`, or the signer's primary fingerprint is not listed for that branch in `keys/php-src/release-managers.txt`. |
| Version sanity | The version is not X.Y.Z, is not in the PHPVER branch, or is not newer than the packaged version. | | Version sanity | The version is not X.Y.Z, is not in the PHPVER branch, or is not newer than the packaged version. |
| Configure | Replaying the packaged lsphp's own `Configure Command` fails. The usual cause is a `-dev` package missing from `DEVPKGS`. | | Configure | Replaying the packaged lsphp's own `Configure Command` fails. The usual cause is a `-dev` package missing from `DEVPKGS`. |
| LSAPI SAPI | `php-litespeed-8.3.tgz` does not match its pinned sha256, or the built lsphp's set of `LSAPI_*` names differs from the packaged binary's. | | LSAPI SAPI | `php-litespeed-8.4.tgz` (pinned 2026-11-19; was 8.3) does not match its pinned sha256, or the built lsphp's set of `LSAPI_*` names differs from the packaged binary's. |
| Compiled-in ini defaults | Any `php -n` ini default differs from the packaged binary. Directives that are new in the release are allowed and printed. | | Compiled-in ini defaults | Any `php -n` ini default differs from the packaged binary. Directives that are new in the release are allowed and printed. |
| ABI gate | A struct member's offset or size changed, or a non-`*_globals` struct changed size. See `scripts/lsphp-abi-gate.sh`. | | ABI gate | A struct member's offset or size changed, or a non-`*_globals` struct changed size. See `scripts/lsphp-abi-gate.sh`. |
| File replacement | A php-src ELF file owned by a package at the core version has no php.net counterpart. | | File replacement | A php-src ELF file owned by a package at the core version has no php.net counterpart. |
+9 -1
View File
@@ -9,5 +9,13 @@
# binary has the same LSAPI_* feature/env-name set as the packaged lsphp, so a # binary has the same LSAPI_* feature/env-name set as the packaged lsphp, so a
# LiteSpeed SAPI upgrade we have not pinned yet fails the build instead of # LiteSpeed SAPI upgrade we have not pinned yet fails the build instead of
# shipping an older SAPI. # shipping an older SAPI.
#
# RE-PINNED 2026-11-19 (emergency run 5686): LiteSpeed's lsphp 8.2-8.5 `-2+noble`
# packages (e.g. lsphp85 8.5.12-2) now carry LSAPI_ENABLE_ADMIN_OVERRIDE and the
# string "LiteSpeed V8.4" (the 8.3 tgz above this line had neither; the name-set gate
# caught it). php-litespeed-8.4.tgz (Last-Modified Tue, 17 Nov 2026 17:12:52 GMT)
# is the SAPI with that knob (hardening: admin overrides off by default, 64-bit safe
# writes). Measured against the packaged binaries before re-pinning. The previous
# pin was php-litespeed-8.3.tgz cd616b82cc853e5e3187fccd060228b9cd1a2009ce72d8da5950eef950ac29b1.
# <url> <sha256> # <url> <sha256>
https://www.litespeedtech.com/packages/lsapi/php-litespeed-8.3.tgz cd616b82cc853e5e3187fccd060228b9cd1a2009ce72d8da5950eef950ac29b1 https://www.litespeedtech.com/packages/lsapi/php-litespeed-8.4.tgz d88e90ef010e06e368da6919b700a589a9a4f478ebb7b2dc41f8d87b4e3f9b8f
+59
View File
@@ -0,0 +1,59 @@
#!/bin/bash
## lsphp-pin-resolve.sh — BUILD-TIME ONLY. Run (Dockerfile RUN is dash, so this is
## a bash executable) or source it:
## lsphp-pin-resolve.sh resolve PKG WANT # prints the version to pin PKG at
## lsphp-pin-resolve.sh ok INSTALLED WANT # exit 0 if INSTALLED is an acceptable pin
##
## Why: stage 2 of Dockerfile.lsphp pins lsphpNN, lsphpNN-common and
## lsphpNN-ldap to the ONE version ext-build compiled against. LiteSpeed's repo
## is occasionally published inconsistently (2026-11-19: lsphp84 8.4.27-2+noble
## but lsphp84-common 8.4.27-3+noble only), so a single shared pin makes apt say
## "Version '8.4.27-2+noble' for 'lsphp84-common' was not found".
##
## Rule (fail closed, nothing weakened):
## 1. WANT itself is offered for PKG -> WANT (the normal case; 82/83/85).
## 2. else the highest version that has the SAME upstream PHP version (the
## text before the first '-') and the same distro suffix (after '+') as
## WANT and is >= WANT (a packaging-revision bump; every lsphp package
## Depends on -common only as ">= WANT", so >= is always satisfiable).
## 3. else exit 1 — a different PHP release is never silently substituted.
## The caller still asserts lsphpNN (the binary the extension was built for)
## equals WANT exactly and -common has the same upstream version and is >= WANT.
##
## LSPHP_MADISON_CMD (default "apt-cache madison") is overridable for tests.
lsphp_resolve_pin() {
local pkg="$1" want="$2" cmd="${LSPHP_MADISON_CMD:-apt-cache madison}"
local out v best="" up="${want%%-*}" suf=""
[[ "$want" == *+* ]] && suf="+${want#*+}"
out=$($cmd "$pkg") || { echo "lsphp-pin-resolve: '$cmd $pkg' failed" >&2; return 1; }
while read -r v; do
[ -n "$v" ] || continue
if [ "$v" = "$want" ]; then printf '%s\n' "$want"; return 0; fi
[ "${v%%-*}" = "$up" ] || continue
[ "$suf" = "" ] || [[ "$v" == *"$suf" ]] || continue
dpkg --compare-versions "$v" ge "$want" || continue
if [ -z "$best" ] || dpkg --compare-versions "$v" gt "$best"; then best="$v"; fi
done < <(awk -F'|' '{gsub(/ /,"",$2); print $2}' <<<"$out")
if [ -z "$best" ]; then
echo "lsphp-pin-resolve: $pkg offers no version of PHP $up compatible with $want" >&2
return 1
fi
printf '%s\n' "$best"
}
## lsphp_pin_ok INSTALLED WANT — post-install assertion for the -common/-ldap
## packages: same upstream PHP version as WANT and not older than it.
lsphp_pin_ok() {
local inst="$1" want="$2"
[ "${inst%%-*}" = "${want%%-*}" ] && dpkg --compare-versions "$inst" ge "$want"
}
if [ "${BASH_SOURCE[0]}" = "$0" ]; then
set -u
case "${1:-}" in
resolve) lsphp_resolve_pin "${2:?pkg}" "${3:?want}" ;;
ok) lsphp_pin_ok "${2:?installed}" "${3:?want}" ;;
*) echo "usage: $0 resolve PKG WANT | ok INSTALLED WANT" >&2; exit 2 ;;
esac
fi
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env bash
## lsphp-pin-resolve.test.sh — fixture test for scripts/lsphp-pin-resolve.sh.
## Fake `apt-cache madison` outputs model (a) a consistent repo (82/83/85: the
## pin must stay EXACTLY the lsphp version), (b) the 2026-11-19 lsphp84 set
## (lsphp84 -2, -common -3 only), (c) cases that must FAIL closed.
set -euo pipefail
HERE=$(cd "$(dirname "$0")/.." && pwd)
R="$HERE/lsphp-pin-resolve.sh"
T=$(mktemp -d); trap 'rm -rf "$T"' EXIT
fail=0
ok() { echo "ok - $1"; }
bad() { echo "FAIL - $1"; fail=1; }
mk() { # file, then lines "pkg|version"
local f="$1"; shift
: >"$f"
for l in "$@"; do printf '%s | %s | http://rpms.litespeedtech.com/debian noble/main amd64 Packages\n' "${l%%|*}" "${l#*|}" >>"$f"; done
}
cat >"$T/apt-cache" <<'EOS'
#!/bin/sh
[ "$1" = madison ] || exit 2
grep -E "^ *$2 \|" "$FIX" || true
EOS
chmod +x "$T/apt-cache"
export LSPHP_MADISON_CMD="$T/apt-cache madison"
res() { FIX="$1" "$R" resolve "$2" "$3" 2>/dev/null; }
expect() { # name want fixture pkg ver
local got; got=$(res "$3" "$4" "$5") || got=FAIL
[ "$got" = "$2" ] && ok "$1" || bad "$1 (got '$got', want '$2')"
}
mk "$T/consistent" "lsphp85-common|8.5.12-2+noble" "lsphp85-ldap|8.5.12-2+noble"
expect "consistent repo: -common stays exact" "8.5.12-2+noble" "$T/consistent" lsphp85-common 8.5.12-2+noble
expect "consistent repo: -ldap stays exact" "8.5.12-2+noble" "$T/consistent" lsphp85-ldap 8.5.12-2+noble
mk "$T/incons" "lsphp84-common|8.4.27-3+noble" "lsphp84-ldap|8.4.27-2+noble"
expect "inconsistent: -common resolves to -3" "8.4.27-3+noble" "$T/incons" lsphp84-common 8.4.27-2+noble
expect "inconsistent: -ldap stays -2" "8.4.27-2+noble" "$T/incons" lsphp84-ldap 8.4.27-2+noble
mk "$T/two" "lsphp84-common|8.4.27-3+noble" "lsphp84-common|8.4.27-2+noble"
expect "exact version preferred over newer revision" "8.4.27-2+noble" "$T/two" lsphp84-common 8.4.27-2+noble
mk "$T/otherphp" "lsphp84-common|8.4.28-1+noble"
expect "different PHP version is never substituted" FAIL "$T/otherphp" lsphp84-common 8.4.27-2+noble
mk "$T/older" "lsphp84-common|8.4.27-1+noble"
expect "older revision is never substituted" FAIL "$T/older" lsphp84-common 8.4.27-2+noble
mk "$T/otherdist" "lsphp84-common|8.4.27-3+jammy"
expect "different distro suffix is never substituted" FAIL "$T/otherdist" lsphp84-common 8.4.27-2+noble
: >"$T/empty"
expect "package absent fails" FAIL "$T/empty" lsphp84-common 8.4.27-2+noble
okc() { "$R" ok "$1" "$2" 2>/dev/null; }
okc 8.4.27-3+noble 8.4.27-2+noble && ok "post-check accepts -3 for want -2" || bad "post-check accepts -3"
okc 8.4.27-2+noble 8.4.27-2+noble && ok "post-check accepts equal" || bad "post-check equal"
okc 8.4.28-1+noble 8.4.27-2+noble && bad "post-check must reject other PHP version" || ok "post-check rejects other PHP version"
okc 8.4.27-1+noble 8.4.27-2+noble && bad "post-check must reject older" || ok "post-check rejects older"
exit $fail