ci: install archiso via private pacman config, not /etc/pacman.conf
Tests / tests (push) Successful in 4m8s
Tests / tests (push) Successful in 4m8s
Writing stock core/extra over the host /etc/pacman.conf raced with the tests workflow, which appends [cachyos]/[chaotic-aur] to the same file — runs 132 and 133 ran concurrently on the runner, so either job could corrupt the other's config mid-pacman. Use 'pacman --config $(mktemp)' with stock core/extra instead: same DNS-lookup reduction (only core/extra sync, no cachyos/chaotic), zero writes to shared state. Verified on the runner: exit 0, only core/extra synced, host /etc/pacman.conf mtime unchanged.
This commit is contained in:
@@ -41,14 +41,19 @@ jobs:
|
|||||||
- name: Install archiso and dependencies
|
- name: Install archiso and dependencies
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
# The host's /etc/pacman.conf is shared, mutable state: the tests
|
# Install with a *private* config instead of /etc/pacman.conf.
|
||||||
# workflow appends [cachyos] and [chaotic-aur] to it, so without this
|
# The host config is shared mutable state: the tests workflow
|
||||||
# reset the build would sync two repos the host never needs (it only
|
# rewrites it and jobs overlap on this runner (runs 132 and 133
|
||||||
# installs archiso/jq from extra — mkarchiso reads the *profile's*
|
# ran concurrently), so writing it here could corrupt a concurrent
|
||||||
# pacman.conf). Every extra repo is another DNS lookup, and the
|
# tests run. It also carries [cachyos] and [chaotic-aur] leftovers
|
||||||
# gateway intermittently drops UDP/53 (that is what failed run 131
|
# from tests.yaml, and syncing those two repos means extra DNS
|
||||||
# at this very step). Reset to stock core/extra.
|
# lookups against a gateway that intermittently drops UDP/53 —
|
||||||
cat > /etc/pacman.conf << 'STOCKCONF'
|
# that is what failed run 131 at this very step. The build only
|
||||||
|
# needs archiso/jq from extra; mkarchiso reads the *profile's*
|
||||||
|
# pacman.conf for everything that goes into the ISO.
|
||||||
|
BUILD_CONF=$(mktemp)
|
||||||
|
trap 'rm -f "$BUILD_CONF"' EXIT
|
||||||
|
cat > "$BUILD_CONF" << 'STOCKCONF'
|
||||||
[options]
|
[options]
|
||||||
DisableSandbox
|
DisableSandbox
|
||||||
HoldPkg = pacman glibc
|
HoldPkg = pacman glibc
|
||||||
@@ -64,9 +69,7 @@ jobs:
|
|||||||
[extra]
|
[extra]
|
||||||
Include = /etc/pacman.d/mirrorlist
|
Include = /etc/pacman.d/mirrorlist
|
||||||
STOCKCONF
|
STOCKCONF
|
||||||
sed -i 's/^ //' /etc/pacman.conf
|
sed -i 's/^ //' "$BUILD_CONF"
|
||||||
# Drop sync databases of the custom repos so they cannot linger
|
|
||||||
rm -f /var/lib/pacman/sync/cachyos* /var/lib/pacman/sync/chaotic*
|
|
||||||
|
|
||||||
# Warm the resolver cache for the mirrors we are about to query.
|
# Warm the resolver cache for the mirrors we are about to query.
|
||||||
# systemd-resolved serves later lookups from cache, so a gateway
|
# systemd-resolved serves later lookups from cache, so a gateway
|
||||||
@@ -86,7 +89,7 @@ jobs:
|
|||||||
# the whole job, so retry with backoff before giving up.
|
# the whole job, so retry with backoff before giving up.
|
||||||
synced=0
|
synced=0
|
||||||
for try in 1 2 3 4 5; do
|
for try in 1 2 3 4 5; do
|
||||||
if pacman -Syu --noconfirm --needed archiso jq; then
|
if pacman --config "$BUILD_CONF" -Syu --noconfirm --needed archiso jq; then
|
||||||
synced=1
|
synced=1
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user