From 72c9203f87bb415c6b09861497700e4f31e0b6ea Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 20 Nov 2026 11:33:51 +0000 Subject: [PATCH 1/5] ci: install libclang-dev for Extensions Tests bindgen builds The cr-sqlite extension jobs (CR SQLite C Tests, CR SQLite Rust Tests) and the Extensions Tests job build Rust bindings from the SQLite C headers with bindgen (bindgen = "0.68.1" in sqlite-rs-embedded/sqlite3_capi; and cargo xtask build-bundled). bindgen loads the runner's system libclang at build time to parse the headers. Without libclang-dev installed, on current GitHub runner images that libclang cannot parse the SQLite headers and bindgen falls back to emitting opaque placeholder structs instead of the real definitions. The generated `sqlite3_api_routines` ends up with a single `_address` field and the nested `sqlite3_index_info_sqlite3_index_constraint` types are missing, so the crr build fails with ~140 errors: error[E0432]: unresolved import `crate::bindings::sqlite3_index_info_sqlite3_index_constraint` error[E0609]: no field `bind_blob` on type `sqlite3_api_routines` note: available fields are: `_address` Install libclang-dev in these jobs so bindgen has a working libclang and parses the headers correctly, matching how the other bindgen-based workflows in this repo already provision it (rust.yml, nemesis.yml). This keeps the jobs on ubuntu-latest and is not tied to a specific, soon to be retired runner image. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/extensions-test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/extensions-test.yml b/.github/workflows/extensions-test.yml index a02c6ab316..60a145ea62 100644 --- a/.github/workflows/extensions-test.yml +++ b/.github/workflows/extensions-test.yml @@ -27,6 +27,8 @@ jobs: - uses: hecrj/setup-rust-action@v2 - name: Checkout repository uses: actions/checkout@v3 + - name: Install deps + run: sudo apt update && sudo apt install -y libclang-dev - name: build libsql run: | ./configure @@ -51,6 +53,8 @@ jobs: - uses: hecrj/setup-rust-action@v2 - name: Checkout repository uses: actions/checkout@v3 + - name: Install deps + run: sudo apt update && sudo apt install -y libclang-dev - name: build libsql run: | ./configure @@ -70,7 +74,7 @@ jobs: uses: actions/checkout@v3 - name: install libs run: | - sudo apt install libblas-dev liblapack-dev + sudo apt update && sudo apt install -y libclang-dev libblas-dev liblapack-dev - name: build libsql and ffi bindings run: | cargo xtask build-bundled From 1ca749c2cd2ca19637023e07516a2f77303cd250 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 20 Nov 2026 11:47:08 +0000 Subject: [PATCH 2/5] ci: pin libclang via LIBCLANG_PATH for Extensions Tests bindgen Installing libclang-dev alone was not enough on the GitHub ubuntu-latest runner: clang-sys still picked up a libclang that cannot parse the SQLite headers, so bindgen kept emitting opaque placeholder structs (sqlite3_api_routines with only an `_address` field, missing sqlite3_index_info_sqlite3_index_constraint types) and the crr build failed with ~140 errors. Install libclang-18-dev explicitly and point bindgen at it with LIBCLANG_PATH=/usr/lib/llvm-18/lib, so clang-sys uses a known-good libclang that parses the headers correctly. Verified in a clean ubuntu:24.04 container that libclang 16/17/18 generate the correct bindings (full sqlite3_api_routines, correct nested struct names). This pins the toolchain rather than the runner image, so it does not depend on a soon to be retired image. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/extensions-test.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/extensions-test.yml b/.github/workflows/extensions-test.yml index 60a145ea62..649f5a3113 100644 --- a/.github/workflows/extensions-test.yml +++ b/.github/workflows/extensions-test.yml @@ -22,13 +22,15 @@ jobs: run: working-directory: libsql-sqlite3 name: CR SQLite C Tests + env: + LIBCLANG_PATH: /usr/lib/llvm-18/lib steps: - uses: hecrj/setup-rust-action@v2 - name: Checkout repository uses: actions/checkout@v3 - name: Install deps - run: sudo apt update && sudo apt install -y libclang-dev + run: sudo apt update && sudo apt install -y libclang-18-dev - name: build libsql run: | ./configure @@ -48,13 +50,15 @@ jobs: run: working-directory: libsql-sqlite3 name: CR SQLite Rust Tests + env: + LIBCLANG_PATH: /usr/lib/llvm-18/lib steps: - uses: hecrj/setup-rust-action@v2 - name: Checkout repository uses: actions/checkout@v3 - name: Install deps - run: sudo apt update && sudo apt install -y libclang-dev + run: sudo apt update && sudo apt install -y libclang-18-dev - name: build libsql run: | ./configure @@ -67,6 +71,8 @@ jobs: extensions-tests: runs-on: ubuntu-latest name: Extensions Tests + env: + LIBCLANG_PATH: /usr/lib/llvm-18/lib steps: - uses: hecrj/setup-rust-action@v2 @@ -74,7 +80,7 @@ jobs: uses: actions/checkout@v3 - name: install libs run: | - sudo apt update && sudo apt install -y libclang-dev libblas-dev liblapack-dev + sudo apt update && sudo apt install -y libclang-18-dev libblas-dev liblapack-dev - name: build libsql and ffi bindings run: | cargo xtask build-bundled From 34d97e46817df4e43577c714071f00a08f2654ec Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 20 Nov 2026 11:53:02 +0000 Subject: [PATCH 3/5] ci: allow pre-3.5 cmake_minimum_required in Extensions Tests The Extensions Tests job's `cargo test --features=extensions` builds wabt-sys v0.6.1, whose bundled CMakeLists declares a pre-3.5 cmake_minimum_required. CMake 4.x on the runner refuses that and the build fails: CMake Error at CMakeLists.txt:17 (cmake_minimum_required) thread 'main' panicked ... build script failed, must exit now Set CMAKE_POLICY_VERSION_MINIMUM=3.5 for the job so CMake accepts the old minimum version from this third-party dependency. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/extensions-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/extensions-test.yml b/.github/workflows/extensions-test.yml index 649f5a3113..ce515cb6e9 100644 --- a/.github/workflows/extensions-test.yml +++ b/.github/workflows/extensions-test.yml @@ -73,6 +73,9 @@ jobs: name: Extensions Tests env: LIBCLANG_PATH: /usr/lib/llvm-18/lib + # wabt-sys v0.6.1 bundles a CMakeLists that declares a pre-3.5 + # cmake_minimum_required, which CMake 4.x refuses; allow it. + CMAKE_POLICY_VERSION_MINIMUM: "3.5" steps: - uses: hecrj/setup-rust-action@v2 From 1db03bbbfb7c8564e7ddc68021388beb583d2586 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 20 Nov 2026 12:08:23 +0000 Subject: [PATCH 4/5] ci: drop embedded LLVM bitcode from sql-experimental for Go cgo The golang-bindings job builds sql-experimental into a static library (libsql_experimental.a) and links it into go-libsql via cgo. Newer Go toolchains reject static libraries that contain an embedded LLVM bitcode section, so the test build fails: disallowed LTO section ".llvmbc" in #cgo LDFLAGS: .../libsql_experimental.a FAIL github.com/tursodatabase/go-libsql [build failed] Build sql-experimental with RUSTFLAGS="-C embed-bitcode=no" so rustc does not embed the .llvmbc section. The release profile does not enable LTO, so dropping embedded bitcode is safe and does not affect the native code. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/golang-bindings.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/golang-bindings.yml b/.github/workflows/golang-bindings.yml index d4924906c6..ad3223c21e 100644 --- a/.github/workflows/golang-bindings.yml +++ b/.github/workflows/golang-bindings.yml @@ -58,7 +58,13 @@ jobs: restore-keys: ${{ runner.os }}-cargo- - name: Build sql-experimental + # Disable embedded LLVM bitcode so the resulting static library has no + # .llvmbc section; newer Go toolchains reject it during cgo linking + # ("disallowed LTO section .llvmbc"). The release profile has no LTO, + # so dropping embedded bitcode is safe. run: cargo b -j16 --release -p sql-experimental + env: + RUSTFLAGS: "-C embed-bitcode=no" - name: go-libsql checkout uses: actions/checkout@v3 From 5766be7c047c99efa44f0e2fa8dfc427a5b02384 Mon Sep 17 00:00:00 2001 From: Nikita Sivukhin Date: Fri, 20 Nov 2026 12:18:05 +0000 Subject: [PATCH 5/5] ci: strip .llvmbc from sql-experimental instead of RUSTFLAGS The previous RUSTFLAGS="-C embed-bitcode=no" approach did not help: the repo's .cargo/config.toml sets build rustflags (--cfg tokio_unstable), and the RUSTFLAGS env var replaces rather than extends it, so the flag both risked dropping tokio_unstable and did not remove the embedded bitcode. The go-libsql cgo build still failed with: disallowed LTO section ".llvmbc" in #cgo LDFLAGS: .../libsql_experimental.a Instead, strip the .llvmbc/.llvmcmd sections from the built static library with objcopy before copying it into go-libsql. objcopy removes the sections from every archive member and the library still links cleanly (verified). This is independent of cargo config and the build cache, and the sections are only used for LTO, which the release build does not perform. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/golang-bindings.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/golang-bindings.yml b/.github/workflows/golang-bindings.yml index ad3223c21e..5fcfea0f0f 100644 --- a/.github/workflows/golang-bindings.yml +++ b/.github/workflows/golang-bindings.yml @@ -58,13 +58,18 @@ jobs: restore-keys: ${{ runner.os }}-cargo- - name: Build sql-experimental - # Disable embedded LLVM bitcode so the resulting static library has no - # .llvmbc section; newer Go toolchains reject it during cgo linking - # ("disallowed LTO section .llvmbc"). The release profile has no LTO, - # so dropping embedded bitcode is safe. run: cargo b -j16 --release -p sql-experimental - env: - RUSTFLAGS: "-C embed-bitcode=no" + + # Newer Go toolchains reject static libraries that carry an embedded LLVM + # bitcode section during cgo linking ("disallowed LTO section .llvmbc"). + # The section is only used for LTO (which the release build does not do), + # so strip it from the archive before handing it to go-libsql. + - name: Strip embedded LLVM bitcode from static library + run: | + set -eux + lib=target/release/libsql_experimental.a + objcopy --remove-section .llvmbc --remove-section .llvmcmd "$lib" + ranlib "$lib" - name: go-libsql checkout uses: actions/checkout@v3