Skip to content

Fix CI which had been broken due to various runner version upgrades - #73

Merged
peterboncz merged 6 commits into
devfrom
ci/ubuntu-26-llvm
Nov 27, 2026
Merged

peterboncz merged 6 commits into
devfrom
ci/ubuntu-26-llvm

Conversation

@peterboncz

@peterboncz peterboncz commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fix CI on the new runner images (Ubuntu 26.04, VS 2026, macOS 26)

Three GitHub runner images changed; each broke part of the matrix. Fixed at the root, no image pinning.

  • Ubuntu 26.04: apt.llvm.org has no LLVM < 21 for it. install-llvm now prefers the image's preinstalled clang and only uses apt.llvm.org when a repo exists. ubuntu-latest jobs use clang 20.
  • Windows / VS 2026: MSVC 14.52's STL requires clang ≥ 22. The action now uses the clang bundled with Visual Studio (via vswhere), so it always matches the STL.
  • macOS 26.4+: the ASan runtime of compiler-rt < 22 deadlocks before main() (The AddressSanitizer flag hangs a simple program. llvm/llvm-project#200447, fixed in LLVM 22.1.3). Reproduced locally; clang 22 runs fine. The action bumps to LLVM 22 on Darwin ≥ 25. Sanitizers stay on.
  • Clang 22 fallout: GoogleTest 1.15.2 → 1.18.0 (-Wcharacter-conversion); TypedStats<std::string> built last_seen_val from a null pointer (UB), now value-initialised. Supersedes Fix -Wnonnull build failure in TypedStats: value-initialize last_seen_val #70.
  • Test discovery: gtest_discover_tests now uses DISCOVERY_MODE PRE_TEST (600 s) so the build step never runs test binaries.
  • base_seed 14 → 15.

peterboncz and others added 6 commits November 27, 2026 15:09
…lvm.org)

GitHub migrated the ubuntu-latest label from 24.04 to 26.04 between
2026-10-19 and 2026-11-19 (actions/runner-images#14748). apt.llvm.org
serves only LLVM 21+ for 26.04, so the install-llvm action's default
(18.1.4) now fails at apt-get on every ubuntu-latest job that uses it:
benchmark, examples, FSST and Rust.

install-llvm (Linux):
- use the preinstalled clang-N when the requested major is on the image
  (GitHub images ship several majors; 26.04 has 20/21/22)
- otherwise add apt.llvm.org only if it actually has a repo for this
  codename and major (checked via the dists Release file)
- otherwise fall back to the lowest preinstalled major >= requested,
  with a ::notice, so a matrix mixing ubuntu-latest and macOS keeps
  one default
- read the codename from /etc/os-release when lsb_release is absent

Pin version "20" on the three Linux-only ubuntu-latest jobs: it is the
lowest clang on the 26.04 image and already the version the Windows
path uses, so it is a known-good toolchain for this code base. The
clang-tidy job stays on ubuntu-24.04 with LLVM 18, and the format check
is unaffected (it runs clang-format 14 inside Docker).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…2 STL needs clang >= 22)

windows-latest now carries Visual Studio 2026 18.12 (MSVC 14.52), whose
STL refuses any clang older than 22:

  yvals_core.h:923: error STL1000: Unexpected compiler version,
  expected Clang 22 or newer.

The install-llvm action bumped the Windows toolchain to a fixed 20.1.7
from Chocolatey, which VS 2022 accepted. Chasing the STL's floor with a
hard-coded number breaks again on every VS update, so instead locate the
LLVM that the installed Visual Studio ships (vswhere, VC\Tools\Llvm\x64)
and put it first on PATH: that clang is compatible with that STL by
construction and needs no download. Chocolatey stays as a fallback for
images without the VS clang component, with the floor raised to 22.1.8.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
gtest_discover_tests defaults to POST_BUILD mode: right after linking
each test executable, Ninja runs it with --gtest_list_tests to
enumerate the cases, under DISCOVERY_TIMEOUT. On the macos-26 Debug
shared job the sanitized (ASan+UBSan, -O0) binaries now take longer
than 60/120 s just to start, so the *build* step failed on three
suites with

  GoogleTestAddTests.cmake: Error running test executable.
    Timeout: '60'  Result: Process terminated due to timeout

even though the link itself had succeeded.

Switch all five suites to DISCOVERY_MODE PRE_TEST so enumeration
happens when ctest starts, where it belongs, and raise the limit to
600 s. The build step no longer executes test binaries at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…e main)

The macos-26 Debug shared job never gets past enumerating tests: even
`dataset_tests --gtest_list_tests` runs for 10 minutes without output.
Nothing in FastLanes runs that early. It is the AddressSanitizer
runtime itself: on macOS 26 (Darwin 25) compiler-rt < 22 deadlocks in
AsanInitInternal because shadow-memory setup iterates the dyld shared
cache with a block, and _Block_copy mallocs into the allocator that is
not initialised yet (llvm/llvm-project#200447; Apple lists it as a
known issue for Xcode <= 26.3). Reproduced locally on macOS 26.5 with
Homebrew clang 21: `int main(){}` built with -fsanitize=address hangs,
the same binary with -fsanitize=undefined runs in under a second.

fls_enable_sanitizers() now drops -fsanitize=address on APPLE when
CMAKE_SYSTEM_VERSION >= 25 and the compiler is AppleClang or Clang
older than 22, and keeps UBSan. Linux keeps full ASan coverage, and
the exemption switches itself off once the macOS toolchain is 22+.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…eep ASan

Reverts the ASan exemption (1f7f3a4) and fixes the cause instead.

Why the macos-26 job broke, with nothing in FastLanes having changed:
the macos-26 runner image moved from macOS 26.3 to 26.4 around
2026-05-20 (26.6.1 today). macOS 26.4 reimplemented
dyld_shared_cache_iterate_text using a block. compiler-rt < 22 walks
the shared cache from AsanInitInternal -> InitializeShadowMemory ->
get_dyld_hdr while holding a non-recursive spin lock; the block's
_Block_copy mallocs, ASan's malloc zone sees ASan as uninitialised and
re-enters AsanInitFromRtl, which spins forever on the held lock. This
is before main(), so even --gtest_list_tests never prints
(llvm/llvm-project#200447). Fixed upstream by llvm/llvm-project#182943
(use _dyld_get_dyld_header), first shipped in LLVM 22.1.3.

Measured locally on macOS 26.5.1 with `int main(){}` + -fsanitize=address:
  Homebrew clang 18.1.8  hang (killed after 20 s)   <- what CI uses
  Homebrew clang 21.1.2  hang
  Homebrew clang 22.1.8  0 s
  Apple clang, CLT 26.4.1  0 s
libclang_rt.asan_osx_dynamic.dylib from 18 imports only
_dyld_shared_cache_iterate_text; the one from 22 also imports
__dyld_get_dyld_header.

Changes:
- install-llvm: on Darwin >= 25 (macOS 26+) bump a requested LLVM < 22
  to 22, like the Windows branch does for the MSVC STL. macOS 15 jobs
  keep LLVM 18.
- enable_sanitizer.cmake: no exemption. On an affected local toolchain
  emit a WARNING that says why the tests will hang and what to install.
- GoogleTest 1.15.2 -> 1.18.0: 1.15.2's char8_t/char16_t printers trip
  clang >= 21's -Wcharacter-conversion under -Werror; 1.18.0 fixed it.
- stats.cpp: TypedStats<std::string> initialised last_seen_val from a
  null pointer (last_seen_val(0)); clang 22 rejects it with -Wnonnull
  and it is UB. Value-initialise instead. Same fix as PR #70.

Verified locally with clang 22, Debug, shared, ASan+UBSan: all suites
build under -Werror; dataset_tests lists 137 cases in 3.8 s (was >600 s);
unit_test: 97 passed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@peterboncz peterboncz changed the title ci: use preinstalled clang on ubuntu-latest (Ubuntu 26.04 has no LLVM 18 repo) Fix CI which had been broken due to various runner version upgrades Nov 27, 2026
@peterboncz

Copy link
Copy Markdown
Contributor Author

no real FastLanes changes, just adjustments for CI runner changes in GH

@peterboncz
peterboncz merged commit 9162863 into dev Nov 27, 2026
67 checks passed
yuxin370 added a commit to yuxin370/FastLanes that referenced this pull request Nov 29, 2026
yuxin370 pushed a commit to yuxin370/FastLanes that referenced this pull request Nov 29, 2026
yuxin370 pushed a commit to yuxin370/FastLanes that referenced this pull request Nov 29, 2026
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