Skip to content

Commit 9924cc8

Browse files
Fix native CI: use leanc with explicit LibUUID paths
System clang++ compiles against glibc 2.39 headers which redirect strtoull to __isoc23_strtoull (C23), but leanc's bundled older glibc lacks that symbol. Switch back to leanc so compiled code matches the glibc leanc links against. Provide LibUUID paths explicitly since leanc's custom sysroot prevents cmake find_package from locating them.
1 parent adb7d55 commit 9924cc8

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ jobs:
2626
run: |
2727
sudo apt-get update
2828
sudo apt-get install -y cmake build-essential nlohmann-json3-dev \
29-
uuid-dev libssl-dev python3 python3-pip \
30-
clang libc++-dev libc++abi-dev
29+
uuid-dev libssl-dev python3 python3-pip
3130
3231
- name: Install Lean via elan
3332
run: |
@@ -39,14 +38,18 @@ jobs:
3938

4039
- name: Build C++ FFI library
4140
run: |
42-
# Use system clang++ with -stdlib=libc++ so the FFI library's C++ ABI
43-
# matches Lean's linker (which uses libc++, not libstdc++).
44-
# Using leanc directly as cmake compiler breaks find_package for
45-
# system libraries (LibUUID etc.) due to its custom sysroot.
41+
# Use leanc (Lean's clang wrapper) so compiled code uses leanc's
42+
# bundled glibc headers, matching the glibc leanc links against.
43+
# System clang++ uses system glibc 2.39 headers which redirect
44+
# strtoull→__isoc23_strtoull (C23), missing from leanc's older glibc.
45+
# STATIC_LIBRARY skips link tests that fail with leanc's sysroot.
46+
# LibUUID paths provided explicitly since leanc's sysroot hides them.
4647
cmake -S . -B build-cmake \
47-
-DCMAKE_C_COMPILER=clang \
48-
-DCMAKE_CXX_COMPILER=clang++ \
49-
-DCMAKE_CXX_FLAGS="-stdlib=libc++"
48+
-DCMAKE_C_COMPILER=leanc \
49+
-DCMAKE_CXX_COMPILER=leanc \
50+
-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY \
51+
-DLibUUID_INCLUDE_DIR=/usr/include \
52+
-DLibUUID_LIBRARY=/usr/lib/x86_64-linux-gnu/libuuid.a
5053
cmake --build build-cmake
5154
5255
- name: Build Lean kernel

0 commit comments

Comments
 (0)