Skip to content

ci: fix bump-bootstrap toolchain install (clang alternatives clash)#1483

Open
mbouaziz wants to merge 1 commit into
mainfrom
fix-bump-toolchain-alternatives
Open

ci: fix bump-bootstrap toolchain install (clang alternatives clash)#1483
mbouaziz wants to merge 1 commit into
mainfrom
fix-bump-toolchain-alternatives

Conversation

@mbouaziz

Copy link
Copy Markdown
Contributor

The first dry_run of the bump-bootstrap workflow (run) got through checkout and the token preflight, then failed installing the toolchain:

update-alternatives: error: alternative clang++ can't be slave of clang:
it is a master alternative

Cause

The GitHub ubuntu-24.04 runner image preinstalls clang with update-alternatives entries where clang++ (and the other LLVM tools) are master alternatives. bin/apt-install.sh skiplang-build-deps installs clang as a master with clang++, llc, opt, … as slaves — and update-alternatives refuses to demote an existing master to a slave, so it aborts.

The Docker image builds never hit this: they run the same script from a clean base image with no preexisting alternatives. It's specific to running apt-install.sh on a bare runner, which only this workflow does.

Fix

Before the install, --remove-all the nine alternative names the script manages, so the setup starts clean. Guarded with || true, so it's a no-op where they're absent.

actionlint clean; the removed-name list matches apt-install.sh's master + slaves exactly. The token preflight and the fast-forward push logic already validated on the failed run (steps 1–3 were green); this unblocks the toolchain step so a re-dispatched dry_run can exercise the full build.

— Mehdi (with Claude Opus 4.8, xhigh effort)

🤖 Generated with Claude Code

…ain install

The first dry_run of bump-bootstrap failed at the toolchain step:

  update-alternatives: error: alternative clang++ can't be slave of clang:
  it is a master alternative

The GitHub ubuntu-24.04 runner image preinstalls clang with update-alternatives
entries where clang++ (and the other LLVM tools) are master alternatives, which
collides with the master(clang)+slave(clang++, llc, ...) layout apt-install.sh
installs. The Docker image builds never hit this because they run the same
script from a clean base image.

Remove the managed alternative names before running apt-install.sh so the
install starts from a clean slate. Runner-only; nothing else runs the script on
a prepopulated host.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant