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
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-19 09:44:50 -08:00
1 parent d792a6549b
commit 40f62c2b64
4 files changed
+132 -2

No files matched your search

+11 -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 --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 --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; \
PR=/usr/local/sbin/lsphp-pin-resolve.sh; \
V=$(cat /etc/cac-lsphp-build.version); \
/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}" \
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 " \"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; \
@@ -239,7 +248,7 @@ RUN set -e; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; \
RTV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}); \
CMV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}-common); \
if [ "$RTV" != "$V" ] || [ "$CMV" != "$V" ]; then \
if [ "$RTV" != "$V" ] || ! $PR ok "$CMV" "$V"; then \
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 " Rebuild with --no-cache so both stages resolve the same release." >&2; \