Skip to content

Compile error for libsql-ffi feature sqlean-extension-regexp under macOS arm64 #2179

@jamesaoverton

Description

@jamesaoverton

Thanks to @sivukhin for bundling sqlean's regexp extension in PR #2160. It works for me under Linux, but under macOS arm64 I get a compiler error ld: archive member '9b5fb81abcc0eb79-pcre2_internal.o' not a mach-o file in '[...]libsql/target/debug/build/libsql-ffi-27754f27da3d637e/out/liblibsql.a'

My system: macOS 15.5, Apple M4 Pro processor, rustc 1.85.0 (4d91de4e4 2025-02-17).

Steps to reproduce:

git clone https://github.com/tursodatabase/libsql.git
cd libsql/libsql-ffi
cargo build # succeeds
cargo test # succeeds
cargo build --features sqlean-extension-regexp # succeeds
cargo test --features sqlean-extension-regexp # compiler error

Line 258 of libsql-ffi/build.rs says sqlean_patterns.push("regexp/pcre2/pcre2_internal.h");, which is the only sqlean_patterns line that includes an .h file.

sqlean_patterns.push("regexp/pcre2/pcre2_internal.h");

When I comment that line out compilation succeeds, but when I run the code, the regexp functions don't seem to be defined: I get runtime errors like SqliteFailure(1, "no such function: regexp_like").

This is not an area I know much about. Happy to provide more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions