queue-build: add socket timeouts and parallel per-distfile source prefetch #5

Merged
william-admin merged 5 commits from william-work/offline-build-verify into main 2026-11-06 16:07:28 -08:00 AGit
Member

Upstream src/fetch.py uses urllib without socket timeouts and fetches all 245
bootstrap-stage1 distfiles sequentially on a single thread, stalling when
git.savannah.gnu.org tarpits TCP connections. Pre-fetch distfiles in parallel
with a 20s timeout (preferring non-Savannah mirrors in package.toml) and still
run src/fetch.py afterward with a 30s default timeout to verify every sha256.

Upstream src/fetch.py uses urllib without socket timeouts and fetches all 245 bootstrap-stage1 distfiles sequentially on a single thread, stalling when git.savannah.gnu.org tarpits TCP connections. Pre-fetch distfiles in parallel with a 20s timeout (preferring non-Savannah mirrors in package.toml) and still run src/fetch.py afterward with a 30s default timeout to verify every sha256.
Source-verification package builds could still reach remote registries if
`--pull=never` was omitted, allowed network access inside unannotated `RUN`
steps, and ran `fetch.py` mid-build. Under `podman build --format=oci`, Buildah
also strips `SHELL` from `core-profile`'s OCI config, so `pallet-clang` and
`user-*` builds dropped `-l`, skipped `/etc/profile`'s `mold` linker flags, and
diverged from upstream binaries.

Scope `registries-offline.conf` and `--network=none --no-hostname
--identity-label=false` to `podman-build.sh` with `--no-cache` enabled by
default, while keeping post-verification `@sha256:` pulls open for `reuse.py`
and `build-bitbaker.sh`. Replace the inline Containerfile patching,
`cf-mkdir-fix.py`, `podman-build-stage0.sh`, and `gate-batch.py` with
`cf-adapt.py` (propagating `SHELL` across stage aliases and `stagex/*` base
chains), subpackage-aware `podman-target.py` and `recipe.py`, ELF section
verification in `gate.py`, fixed `SUB`/`TRUST` paths in the manifest and
signature verifiers, and all 43 pins in `trust/pins.txt`.
- Scope reuse.py and build-bitbaker.sh to the current hostname by default
  (UNVERIFIED-THIS-HOST until gate.py records socket.gethostname() in hosts),
  preventing cross-host verified.json entries from pulling container images
  before this host builds and verifies them from source.
- Materialize SHELL instructions directly on RUN steps in cf-adapt.py because
  Buildah 1.43.2 ignores SHELL under --format=oci even within the same stage.
- Group sibling subpackages (e.g. core-llvm, core-clang-rt-devel,
  core-llvm-libgcc) adjacently in podman-target.py --closure and point host
  TMPDIR to $WAK_WORK/tmp so large builds avoid /tmp inode limits.
- Track cumulative lower-layer entries in gate.py for multi-COPY pallet layers.
Upstream src/fetch.py uses urllib without socket timeouts and fetches all 245
bootstrap-stage1 distfiles sequentially on a single thread, stalling when
git.savannah.gnu.org tarpits TCP connections. Pre-fetch distfiles in parallel
with a 20s timeout (preferring non-Savannah mirrors in package.toml) and still
run src/fetch.py afterward with a 30s default timeout to verify every sha256.
Add check_offline_registries.py and invoke it from cf-adapt.py prior to every
build so that:
- All host registries from podman info and /etc/containers/registries.conf*
  are written with blocked = true and verified via podman info under
  CONTAINERS_REGISTRIES_CONF.
- Every FROM and COPY --from= in the target Containerfile is checked to ensure
  it references only scratch, fetch, an in-file stage alias, or an already
  built localhost/stagex/<dep>:latest image in $WAK_STORE.
58 of the 125 historical entries in trust/verified.json are not part of
Containerfile-bitbaker or its transitive build closure. Scope reuse.py --sweep
to podman-target.py --closure --bitbaker (74 packages) by default so new
builders do not need to re-verify unused historical packages (pass --all to
inspect all ledgered entries).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
wak/stagex-wak!5
No description provided.