Skip to content

libsql-ffi: keep the pcre2 header out of the cc source list - #2345

Open
jrparks wants to merge 3 commits into
tursodatabase:mainfrom
jrparks:up/ffi-pcre2-header
Open

jrparks wants to merge 3 commits into
tursodatabase:mainfrom
jrparks:up/ffi-pcre2-header

Conversation

@jrparks

@jrparks jrparks commented Dec 1, 2026

Copy link
Copy Markdown

The sqlean regexp pattern list in libsql-ffi/build.rs includes regexp/pcre2/pcre2_internal.h, and every path the globs match is handed to cc::Build::files(). A header is not a compile unit, so it is passed to the C compiler as a source file.

On a native build that is harmless. On an aarch64-unknown-linux-musl cross build that uses zig cc as the C compiler, the header ends up as an object file that ld.lld rejects (unknown file type), and the link fails. x86_64 is unaffected.

The change drops .h files from the collected sources before compiling (3 lines, libsql-ffi/build.rs). cargo check -p libsql-ffi --features sqlean-extension-regexp passes. The arm64 cross build that hit this links with the change.

The branch sits on top of the two CI commits from #2317 so the Extensions and Go checks can run; they drop out once #2317 merges.

ubuntu-latest moved to Ubuntu 26.04 between 2026-11-08 and 2026-11-11.
On 26.04 these jobs fail before reaching any test: CMake 4 rejects
wabt-sys 0.6.1 (cmake_minimum_required < 3.5) and the sqlite3_capi
bindings come out empty. The same jobs pass on 24.04, which every
green run so far used. Pinning restores CI for open PRs until the
toolchain issues are fixed properly.

Refs tursodatabase#2315
Go 1.27.4 refuses to link libsql_experimental.a: "disallowed LTO section
".llvmbc" in #cgo LDFLAGS". setup-go '>=1.21' picked 1.27.4 on the
first run of this PR; the last green run used 1.27.3. Pin until the
static library is built without embedded bitcode.

Refs tursodatabase#2315
The sqlean regexp pattern list included regexp/pcre2/pcre2_internal.h, and
every matched path was handed to cc::Build::files(). A header is not a compile
unit. On an aarch64-linux-musl cross build (zig cc as CC) the header ended up
as an object that ld.lld rejects with "unknown file type". Drop headers from
the list before compiling.

This branch has not been deployed

No deployments
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