Fix arch build #92

Manually merged
jabber.developer merged 1 commits from fix/arch-build into master 2026-02-17 16:35:08 +00:00

View File

@@ -1,9 +1,11 @@
FROM archlinux
FROM archlinux:latest
ENV TERM=xterm
ENV CC="ccache gcc"
RUN pacman -Syu --noconfirm
RUN pacman-key --refresh-keys
jabber.developer marked this conversation as resolved Outdated

Double pacman -Syyu with no logic between attempts — IMPROVEMENT

Two identical RUN pacman -Syyu back-to-back: the first swallows errors, the second retries blindly. If the root cause is stale keys or a broken mirror, a plain retry won't help — and you pay for an extra Docker layer caching the full package DB twice.

Better: single RUN with targeted recovery:

RUN pacman -Syu --noconfirm || (pacman-key --refresh-keys && pacman -Syu --noconfirm)

Double pacman -Syyu with no logic between attempts — IMPROVEMENT Two identical RUN pacman -Syyu back-to-back: the first swallows errors, the second retries blindly. If the root cause is stale keys or a broken mirror, a plain retry won't help — and you pay for an extra Docker layer caching the full package DB twice. Better: single RUN with targeted recovery: RUN pacman -Syu --noconfirm || (pacman-key --refresh-keys && pacman -Syu --noconfirm)

Looks like this solution incorrect, may be we should try

RUN pacman-key --init && pacman-key --populate archlinux
RUN pacman -Syu --noconfirm

instead of
RUN pacman -Syu --noconfirm || (pacman-key --refresh-keys && pacman -Syu --noconfirm)

or use previous approach

Looks like this solution incorrect, may be we should try RUN pacman-key --init && pacman-key --populate archlinux RUN pacman -Syu --noconfirm instead of RUN pacman -Syu --noconfirm || (pacman-key --refresh-keys && pacman -Syu --noconfirm) or use previous approach
RUN pacman -Syyu --noconfirm
# reflector is optional - if it fails due to network issues, continue with default mirrorlist
RUN pacman -S --needed --noconfirm reflector && \
(reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist || true)
jabber.developer marked this conversation as resolved Outdated

reflector argument order

--save expects a file path as its next argument. After the reorder, --save consumes --sort as the filename, breaking mirror selection silently (masked by || true).

Fix: keep --save together:
RUN pacman -S --needed --noconfirm reflector &&
(reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist || true)

reflector argument order --save expects a file path as its next argument. After the reorder, --save consumes --sort as the filename, breaking mirror selection silently (masked by || true). Fix: keep --save <path> together: RUN pacman -S --needed --noconfirm reflector && \ (reflector --latest 20 --protocol https --sort rate --save /etc/pacman.d/mirrorlist || true)

It was done to destroy previous cache. Reverted.

It was done to destroy previous cache. Reverted.