Skip to content

Fix cross builds after cc bump - #10278

Merged
mergify[bot] merged 1 commit into
unstablefrom
fix-cross-leveldb
Oct 10, 2026
Merged

mergify[bot] merged 1 commit into
unstablefrom
fix-cross-leveldb

Conversation

@antondlr

@antondlr antondlr commented Oct 9, 2026

Copy link
Copy Markdown
Member

Issue Addressed

#10229 set CXX = "clang++" in .cargo/config.toml to work around LevelDB's -Wthread-safety probe. The cross images only ship GCC, so all cross builds (docker, release, binary-builder) on unstable now fail in leveldb-sys:

  • x86_64: failed to find tool "clang++"
  • aarch64: the image's CXX_aarch64_unknown_linux_gnu takes precedence, so GCC is used and hits the original -Wthread-safety error

Proposed Changes

  • In Cross.toml, use g++ inside cross containers.
  • Apply the LevelDB workaround through a small CMake wrapper (scripts/cross/cmake-wrapper.sh) that pre-seeds HAVE_CLANG_THREAD_SAFETY=OFF.

Additional Info

Tested on a fork: lighthouse and lcli maxperf builds pass for x86_64 and aarch64.

🤖 Generated with Claude Code

#10229 set CXX=clang++ in .cargo/config.toml to work around LevelDB's
-Wthread-safety probe, but the cross images only ship GCC: x86_64 can't
find clang++ and aarch64 uses its target-specific GCC and hits the
original bug. Use GCC in cross and pre-seed the probe via a CMake wrapper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antondlr
antondlr marked this pull request as ready for review October 9, 2026 09:30
@jxs

jxs commented Oct 9, 2026

Copy link
Copy Markdown
Member

with the windows support decommissioned do we still need crossbuilds?
cc @michaelsproul

@michaelsproul

Copy link
Copy Markdown
Member

Hmm I guess we have all the docs about cross-compiling. Someone might be relying on that workflow: https://lighthouse-book.sigmaprime.io/installation_cross_compiling.html

@michaelsproul

Copy link
Copy Markdown
Member

why does LevelDB probing break GCC? surely it's a probe so it should just see the flag isn't supported

@michaelsproul

Copy link
Copy Markdown
Member

ohhh, cc suppresses all warnings, which causes the probe to succeed

@michaelsproul

Copy link
Copy Markdown
Member

I'm fine with this workaround for now, and we can assess whether we want to delete cross builds later.

@mergify

mergify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Queued — the merge queue status continues in this comment ↓.

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. infra-ci labels Oct 10, 2026
@mergify

mergify Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Merge Queue Status

This pull request spent 32 minutes 15 seconds in the queue, including 30 minutes 24 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Oct 10, 2026
@mergify
mergify Bot merged commit f31adce into unstable Oct 10, 2026
41 checks passed
@mergify mergify Bot removed the queued label Oct 10, 2026
mergify Bot pushed a commit that referenced this pull request Oct 11, 2026
## Issue Addressed

Release builds on the self-hosted runners are unreliable (v8.3.0-rc.0 and v8.2.3 each needed 3 attempts), and the docker workflow on `unstable` fails most runs on runner state issues (e.g. rustup `Invalid cross-device link` in `/opt/rust`).

Stacked on #10278.

## Proposed Changes

- Drop self-hosted runners. Release builds (`release.yml` and tag builds in `docker.yml`) use a paid GitHub-hosted larger runner named by the `RELEASE_RUNNER` repository variable; everything else, and forks, uses free GitHub-hosted runners.
- Build `unstable` docker images with the `release` profile; tags keep `maxperf`.
- Build macOS releases on `macos-15-xlarge` (M2 Pro, 14 GB): 18 min vs 54 min on the free 7 GB runner, which swaps during the `maxperf` link.
- Bump runners and cross Docker images to Ubuntu 24.04.
- Bump actions to their Node 24 releases; pin `docker/*` actions by SHA and `cross` to 0.2.5.

## Additional Info

Needs an org admin to set up, before merging:
(this is taken care of, thanks @shousper 🙏)

- Billing: a payment method and an Actions budget above $0 (larger runners and `macos-15-xlarge` are billed on public repos; ~$4 per release).
- A Linux x64 larger runner, 8 vCPU / 32 GB, max concurrency 8, in a runner group that allows `sigp/lighthouse` with "Allow public repositories" enabled.
- The `RELEASE_RUNNER` repository variable set to that runner's name.

`macos-15-xlarge` is a standard label and needs no setup beyond billing.

Measured on free 4 vCPU / 16 GB runners:

| Build | Peak memory | Time |
|---|---|---|
| `maxperf` lighthouse (aarch64) | 15.9 GB + 3 GB swap | 32 min |
| `release` lighthouse (aarch64) | 10.7 GB | 15 min |

`maxperf` doesn't fit reliably in 16 GB, hence the 32 GB runner for releases and the `release` profile for `unstable`. A full tag run (release, docker, docker-reproducible) passed on a fork.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
mergify Bot pushed a commit that referenced this pull request Oct 13, 2026
## Issue Addressed

CI builds Linux binaries with `cross`, which pulls third-party build images (`ghcr.io/cross-rs`), needs QEMU for arm64 docker images, and broke on the recent `cc` bump (#10278).

Stacked on the runner PR (#10282).

## Proposed Changes

- Build each architecture natively on a runner of that architecture, inside a pinned `rust:1.99.0-bookworm` image (`scripts/ci/build-linux.sh`).
- Use it in `release.yml` and `docker.yml`; no `cross` or QEMU left in CI.
- Add a `RELEASE_RUNNER_ARM64` repository variable for the arm64 release runner (falls back to free `ubuntu-24.04-arm`).
- Keep the `make build-*` cross targets for local use and `binary-builder`.

## Additional Info

Concerns:

- **glibc floor goes up from 2.18 to 2.34.** Release tarballs will no longer run on Ubuntu 20.04, Debian 11 or RHEL 8 (Ubuntu 22.04, Debian 12 and RHEL 9 are fine).
- **Rust is pinned** by the image (1.99.0) instead of `rustup update stable`; bumping is a one-line change in the script.
- **Needs an arm64 release runner.** `maxperf` runs out of memory on the free 16 GB arm runner; releases need an 8-core / 32 GB arm64 larger runner.
- **Trust:** drops the `cross-rs` images, adds the Docker Hub official `rust` image (already used by `Dockerfile.reproducible`).

Tested on a fork with free runners ([run](https://github.com/antondlr/lighthouse/actions/runs/37913766680)): `lighthouse` x86_64/aarch64 and `lcli` aarch64 (`release`), and `lighthouse` x86_64 (`maxperf`, release features) all build natively, and the docker images run.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infra-ci ready-for-merge This PR is ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants