Skip to content

ci: a failed apt.llvm.org download makes the Clang installer report success having installed nothing #681

Description

@Yaraslaut

Found while working #672 (PR for #679/#672/#675). Filed, not folded: #672's narrow fix is about a download that fails loudly in the wrong place; this one fails silently in the right place, which needs a different fix.

The finding

Ten steps across two workflows install Clang this way:

wget -qO- https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.CLANG_VERSION }}

nine in .github/workflows/ci.yml (lines 281, 467, 630, 849, 1589, 1855, 2210, 2277 and the new bank-sanitizers job, which copies the same line) and one in .github/workflows/mutation.yml:79.

wget -qO- does not write an error document to stdout. On an HTTP 5xx it exits 8 having written zero bytes. bash then reads an empty script, does nothing, and exits 0. GitHub runs run: under bash -e without pipefail, so the pipeline's status is bash's, not wget's.

The step therefore reports success having installed no compiler.

Verification status: reproduced locally, against a server that returns 503

Not observed in CI. The 503 is synthetic — a local http.server returning 503 Service Unavailable with a short HTML body — but the apt.llvm.org / Launchpad outages #672 records are exactly this condition, and three of them happened in one day.

=== wget -qO- <200> | bash -s -- 22 ===
llvm.sh ran
exit=0
=== wget -qO- <503> | bash -s -- 22   (the outage case) ===
exit=0
=== wget -qO- <503> alone, exit code and stdout bytes ===
wget exit=8
0

The second block is the defect: the same exit code as the first, and no output at all.

Measured on 95aa5686, GNU wget 1.25.0, bash 5.3, Arch Linux. Not verified: the exact wget version on ubuntu-24.04 runners, and whether it differs here (wget's "write the error document" behaviour is --content-on-error, off by default, and has been for a long time — but I did not check the runner's build).

What it costs

Less than a red leg, because the failure is deferred rather than hidden outright: every one of these jobs then configures with an explicit -DCMAKE_CXX_COMPILER=clang++-22, which fails when the compiler is not there. So the leg does go red — at the Configure step, saying the compiler is missing, several steps after the step that was supposed to install it and reported success.

That is #672's complaint in its purest form: the check list, and the log, both name the wrong thing. It is worse than the sccache case in one respect — there, the failing step at least was the installer.

What would resolve it

Any one of:

All three are local to the step and need no CI-wide decision. Ten copies, so whichever is chosen is a ten-line change plus one comment.

What would change the verdict

Close as invalid if wget on the runner image does exit non-zero in a way bash -e propagates, or if it writes the error document so that bash fails on it — either would need checking on ubuntu-24.04 rather than here. Close as wontfix if the deferred Configure failure is judged legible enough.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ciSubsystem: cibugSomething isn't workingtriage: validWell-framed; implement as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions