Skip to content

Dockerfiles/oc-dev: fix flaky LLVM install (IPv4 + reset trust anchor… - #618

Closed
albert-mueller wants to merge 1 commit into
acidanthera:masterfrom
albert-mueller:fix-oc-dev-dockerfile-llvm-retry
Closed

Dockerfiles/oc-dev: fix flaky LLVM install (IPv4 + reset trust anchor…#618
albert-mueller wants to merge 1 commit into
acidanthera:masterfrom
albert-mueller:fix-oc-dev-dockerfile-llvm-retry

Conversation

@albert-mueller

Copy link
Copy Markdown
Contributor

Dockerfiles/oc-dev: fix flaky LLVM install (IPv4 + reset trust anchor on retry)
The llvm.sh retry loop could fail permanently instead of recovering:

  1. apt.llvm.org resolves to both an A and an AAAA record. On runners/
    BuildKit sandboxes without working IPv6 egress, wget can pick the
    AAAA record and fail with "Network is unreachable" instead of
    falling back to IPv4.
  2. If a wget call inside llvm.sh is interrupted by that failure while
    writing /etc/apt/trusted.gpg.d/apt.llvm.org.asc, it leaves behind an
    empty/corrupt key file. llvm.sh only (re)downloads the key when that
    file is absent, so every subsequent retry in the loop reuses the
    broken key and apt-get update fails with NO_PUBKEY, even once the
    network recovers.

Fix: prefer IPv4 for wget via /etc/wgetrc, and remove the trust anchor
and any partially-added apt.llvm.org sources list entry at the start of
every retry iteration, so a bad attempt cannot poison the ones after it.

CI log of the original failure: image 'Linux CLANGDWARF' job, docker
compose build-duet, all 5 llvm.sh attempts failing (2x unreachable
IPv6, 3x NO_PUBKEY from a stale key file left by a previous attempt).

This should fix this error:
Annotations.txt

… on retry)

The llvm.sh retry loop could fail permanently instead of recovering:

1. apt.llvm.org resolves to both an A and an AAAA record. On runners/
   BuildKit sandboxes without working IPv6 egress, wget can pick the
   AAAA record and fail with "Network is unreachable" instead of
   falling back to IPv4.
2. If a wget call inside llvm.sh is interrupted by that failure while
   writing /etc/apt/trusted.gpg.d/apt.llvm.org.asc, it leaves behind an
   empty/corrupt key file. llvm.sh only (re)downloads the key when that
   file is absent, so every subsequent retry in the loop reuses the
   broken key and apt-get update fails with NO_PUBKEY, even once the
   network recovers.

Fix: prefer IPv4 for wget via /etc/wgetrc, and remove the trust anchor
and any partially-added apt.llvm.org sources list entry at the start of
every retry iteration, so a bad attempt cannot poison the ones after it.

CI log of the original failure: image 'Linux CLANGDWARF' job, docker
compose build-duet, all 5 llvm.sh attempts failing (2x unreachable
IPv6, 3x NO_PUBKEY from a stale key file left by a previous attempt).
@vit9696

vit9696 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

This is garbage, because e.g. /etc/wgetrc may not exist before your command.

Please stop pushing weird stuff here, this is not wanted.

@vit9696 vit9696 closed this Aug 23, 2026
@albert-mueller
albert-mueller deleted the fix-oc-dev-dockerfile-llvm-retry branch August 23, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants