[FIX] the second half of two of my own hooks

libevent: mv: cannot stat '<pkgdir>/usr/share/doc': No such file or directory
  pam:      rm: cannot remove '.../Linux-PAM/*.pdf': No such file or directory

Both are hooks I wrote in this session, and both stopped a build in exactly the
way this port has documented eight times: the documentation build was disabled
and its install was left in place. Turning EVENT__DOXYGEN off does not stop
package() moving usr/share/doc into the libevent-doc split; -Ddocs=disabled does
not stop pam deleting PDFs it no longer produces.

fakeroot was the first one I made myself. This makes three, so the rule is worth
stating instead of rediscovering: after disabling documentation anywhere, search
package() for share/doc, man, and the split arrays before believing the hook is
finished.

pam's rm becomes tolerant rather than deleted -- on a machine with the DocBook
stack the PDFs are real, and the comment above the line says why they must go:
they are not reproducible.

--- FR ---

  libevent: mv: cannot stat '<pkgdir>/usr/share/doc': No such file or directory
  pam:      rm: cannot remove '.../Linux-PAM/*.pdf': No such file or directory

Deux hooks que j'ai écrits dans cette session, et deux arrêts de construction de
la façon exacte que ce portage a documentée huit fois : la construction de la
documentation désactivée, son installation laissée en place. Éteindre
EVENT__DOXYGEN n'empêche pas package() de déplacer usr/share/doc vers le
sous-paquet libevent-doc ; -Ddocs=disabled n'empêche pas pam de supprimer des PDF
qu'il ne produit plus.

fakeroot fut le premier de ma main. Cela en fait trois : la règle mérite d'être
énoncée plutôt que redécouverte — après avoir désactivé une documentation,
chercher dans package() share/doc, man, et les tableaux de sous-paquets avant de
croire le hook terminé.

Le rm de pam devient tolérant plutôt que supprimé : sur une machine dotée de la
pile DocBook les PDF existent, et le commentaire au-dessus dit pourquoi ils
doivent partir — ils ne sont pas reproductibles.

Assisted-by: Claude Opus 5
This commit is contained in:
Mathieu Benoit 2026-08-23 19:09:10 -04:00
parent f26a6a7115
commit a8eef0e460
3 changed files with 72 additions and 0 deletions

View file

@ -18,3 +18,32 @@ io.open("PKGBUILD", "w", encoding="utf-8").write(s)
ZZPY
grep -q "EVENT__DOXYGEN=OFF" PKGBUILD || { echo "libevent: doxygen not disabled" >&2; exit 1; }
echo "libevent: Doxygen reference disabled"
# --- and the docs split, which I left behind ----------------------------------
#
# mv: cannot stat '<pkgdir>/usr/share/doc': No such file or directory
#
# Turning EVENT__DOXYGEN off above stopped the documentation being BUILT and left
# package() moving it into the libevent-doc split:
#
# mv {"$pkgdir",doc}/usr/share/doc
#
# NINTH time in this port, and the second time I have made it myself rather than
# inherited it: fakeroot was the other. Removing a documentation build without
# removing its install is apparently the easiest mistake available here, so it is
# worth stating the rule plainly -- after disabling documentation anywhere,
# search package() for share/doc, man, and the split arrays before believing the
# hook is finished.
python3 - <<'ZZPY'
import io, re
lines = io.open("PKGBUILD", encoding="utf-8").read().split("\n")
hit = [i for i, l in enumerate(lines) if re.search(r"share/doc", l) and l.lstrip().startswith("mv ")]
assert len(hit) == 1, "libevent: expected one share/doc move, got %d" % len(hit)
i = hit[0]
ind = re.match(r"^[ \t]*", lines[i]).group(0)
lines[i] = ind + ': # doxygen is off above, so usr/share/doc is never created.'
io.open("PKGBUILD", "w", encoding="utf-8").write("\n".join(lines))
ZZPY
grep -qE "^[[:space:]]*mv .*share/doc" PKGBUILD && {
echo "libevent: the docs move survived" >&2; exit 1; }
echo "libevent: docs split removed (nothing builds them now)"

View file

@ -22,3 +22,31 @@ io.open("PKGBUILD", "w", encoding="utf-8").write("\n".join(lines))
ZZPY
grep -q -- "-Ddocs=disabled" PKGBUILD || { echo "pam: docs not disabled" >&2; exit 1; }
echo "pam: DocBook documentation disabled"
# --- and the PDFs it no longer produces ---------------------------------------
#
# rm: cannot remove '<pkgdir>/usr/share/doc/Linux-PAM/*.pdf': No such file
#
# The line above it says why it exists:
#
# # remove unreproducible pdf files
#
# pam builds PDFs whose bytes differ between runs, so the PKGBUILD deletes them
# to keep the package reproducible. With -Ddocs=disabled they are never built,
# and a cleanup step that finds nothing to clean is fatal under set -e.
#
# The rm becomes tolerant rather than being deleted: on a machine that does have
# the DocBook stack, the PDFs WILL be there and they still have to go.
python3 - <<'ZZPY'
import io, re
lines = io.open("PKGBUILD", encoding="utf-8").read().split("\n")
hit = [i for i, l in enumerate(lines) if re.search(r"\*\.pdf", l) and l.lstrip().startswith("rm ")]
assert len(hit) == 1, "pam: expected one pdf removal, got %d" % len(hit)
i = hit[0]
ind = re.match(r"^[ \t]*", lines[i]).group(0)
lines[i] = ind + "rm -f " + lines[i].lstrip()[3:].lstrip()
io.open("PKGBUILD", "w", encoding="utf-8").write("\n".join(lines))
ZZPY
grep -qE "^[[:space:]]*rm -f .*\*\.pdf" PKGBUILD || {
echo "pam: the pdf removal was not made tolerant" >&2; exit 1; }
echo "pam: PDF cleanup tolerates their absence"

View file

@ -287,6 +287,21 @@ STAGE1_PACKAGES=(
# comes with it, as jinja's only dependency.
python-markupsafe
python-jinja
# Three more the chroot asked for by name, each a build tool:
#
# python-pkgconfig brotli: ERROR Missing dependencies: pkgconfig
# -- the python MODULE, not pkg-config the program,
# which has been there since the lib64 fix.
# cython libseccomp: ERROR Backend subprocess exited when
# trying to invoke get_requires_for_build_wheel
# -- its python bindings are Cython.
# autoconf-archive tpm2-tss: configure.ac:139: error: undefined or
# overquoted macro: AC_MSG_WARN
# -- an AX_* macro is missing, so autoconf misreads the
# line and blames one it does know.
python-pkgconfig
cython
autoconf-archive
# libaio: a real closure gap. lvm2 stops on
#
# device/bcache.c:30:10: fatal error: libaio.h: No such file or directory