diff --git a/patches/pkgbuild/python-packaging.sh b/patches/pkgbuild/python-packaging.sh index 46f271c..7639dd7 100755 --- a/patches/pkgbuild/python-packaging.sh +++ b/patches/pkgbuild/python-packaging.sh @@ -3,3 +3,30 @@ # edit, are shared -- see lib-python-bootstrap.sh. set -euo pipefail source "$(dirname "$0")/lib-python-bootstrap.sh" + +# The license install assumes the NON-bootstrap layout, unconditionally. +# +# install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" \ +# $srcdir/$_name-$pkgver/LICENSE* +# +# sits outside the `if (( _bootstrap == 0 ))`, but with _bootstrap=1 the source +# array is a set of git clones and there is no packaging-26.3 directory at all: +# +# install: cannot stat '.../src/packaging-26.3/LICENSE*' +# +# The clone is at $srcdir/python-packaging, and it carries LICENSE, +# LICENSE.APACHE and LICENSE.BSD. The other five PKGBUILDs handle this by +# naming a bootstrap-specific path in their else branch; this one just misses +# it, so the fix follows their shape rather than inventing one. +python3 - <<'ZZPY' +import io, re +lines = io.open("PKGBUILD", encoding="utf-8").read().split("\n") +hit = [i for i, l in enumerate(lines) if "LICENSE*" in l and "$_name-$pkgver" in l] +assert len(hit) == 1, "python-packaging: expected one license install, got %d" % len(hit) +lines[hit[0]] = lines[hit[0]].replace("$srcdir/$_name-$pkgver/LICENSE*", + "$srcdir/$pkgname/LICENSE*") +io.open("PKGBUILD", "w", encoding="utf-8").write("\n".join(lines)) +ZZPY +grep -q 'srcdir/\$pkgname/LICENSE\*' PKGBUILD || { + echo "python-packaging: the license path was not redirected" >&2; exit 1; } +echo "python-packaging: license taken from the bootstrap clone" diff --git a/scripts/packages.sh b/scripts/packages.sh index adc2a97..87d0206 100644 --- a/scripts/packages.sh +++ b/scripts/packages.sh @@ -243,6 +243,12 @@ STAGE1_PACKAGES=( # and python-tqdm installs one. On the host these came from apt; in the # chroot they have to be packages. Ordered by their own dependencies: # flit-core bootstraps itself, then the two libraries build needs. + # Of these seven, only python-flit-core builds on the host. The other six + # compute their install paths from the running python, so the host bakes + # Debian's dist-packages into them -- three failed on a `rm` that found + # nothing, and three succeeded and shipped 180 unreachable module paths. + # They are built by stage 2 instead; a stage-1 run is expected to report + # them as failed, exactly like libxslt. python-flit-core python-packaging python-pyproject-hooks diff --git a/scripts/test-chroot.sh b/scripts/test-chroot.sh index b5647f5..ca2bc88 100755 --- a/scripts/test-chroot.sh +++ b/scripts/test-chroot.sh @@ -117,8 +117,27 @@ for f in "$REPO"/*.pkg.tar.*; do [ "$c" -gt 0 ] && { bad "$(basename "$f"): $c multiarch paths"; n=$((n + 1)); } c=$(grep -c '^usr/lib64/' <<< "$_l") [ "$c" -gt 0 ] && { bad "$(basename "$f"): $c paths under usr/lib64"; n=$((n + 1)); } + # dist-packages: Debian's name for site-packages. + # + # Added after three packages were built, declared OK, and shipped + # usr/lib/python3/dist-packages -- python-build, python-wheel and + # python-pyproject-hooks. Our python looks in + # /usr/lib/python3.14/site-packages, so every module in them was + # unreachable. This check said the repository was clean the whole time, + # because it was only ever asked about C library directories. + # + # What makes it worth a permanent check rather than a one-time fix: the + # three packages that FAILED in the same batch failed on `rm` not finding a + # path, which is what saved them from shipping the same way. Nothing about + # the three that succeeded looked wrong. + c=$(grep -c 'dist-packages/' <<< "$_l") + [ "$c" -gt 0 ] && { bad "$(basename "$f"): $c paths under dist-packages"; n=$((n + 1)); } + # usr/local: python's posix_local scheme, and anything else that took the + # host's idea of where a local install goes. + c=$(grep -c '^usr/local/' <<< "$_l") + [ "$c" -gt 0 ] && { bad "$(basename "$f"): $c paths under usr/local"; n=$((n + 1)); } done -[ "$n" -eq 0 ] && good "every library is under usr/lib -- no multiarch, no lib64" +[ "$n" -eq 0 ] && good "no multiarch, no lib64, no dist-packages, no usr/local" note "3. SONAME -- what binaries ask for versus what the repository ships" # Two passes over the packages: collect the soname each shared library