Skip to content

[New Package] TypeDBDriverClib_jll v3.8.1#13229

Open
FrankUrbach wants to merge 7 commits intoJuliaPackaging:masterfrom
FrankUrbach:add-TypeDBDriverClib_jll
Open

[New Package] TypeDBDriverClib_jll v3.8.1#13229
FrankUrbach wants to merge 7 commits intoJuliaPackaging:masterfrom
FrankUrbach:add-TypeDBDriverClib_jll

Conversation

@FrankUrbach
Copy link

@FrankUrbach FrankUrbach commented Mar 1, 2026

New JLL package: TypeDBDriverClib_jll

What

Adds a BinaryBuilder recipe for libtypedb_driver_clib, the C FFI layer of the
TypeDB Driver (TypeDB 3.x).

The library is implemented in Rust (c/ crate in the typedb-driver workspace)
and exposes a C-compatible API for use by language bindings.

Source

Platforms

  • x86_64-linux-gnu
  • aarch64-linux-gnu
  • x86_64-apple-darwin
  • aarch64-apple-darwin
  • x86_64-w64-mingw32

Build

Uses compilers = [:c, :rust] and dont_dlopen = true. Builds the
typedb_driver_clib crate via cargo build -p typedb_driver_clib from the
workspace root. On Windows, Rust omits the lib prefix; the
LibraryProduct accepts both libtypedb_driver_clib and typedb_driver_clib.

v1 CI failure (fixed)

The first CI run failed because of three mistakes in the recipe:

  • Directory was named T/TypeDBDriverClib_jll/ instead of T/TypeDBDriverClib/
  • name included the _jll suffix (BinaryBuilder appends it automatically)
  • Used ${CARGO_BUILD_TARGET} instead of the correct ${rust_target}

Consumer

Intended for use by
TypeDBClient_2.jl,
a Julia FFI client for TypeDB 3.x.

c/Cargo.toml in typedb-driver does not declare crate-type = ["cdylib"],
so plain `cargo build` only produces an rlib.  Using `cargo rustc -- --crate-type=cdylib`
forces output of a proper C-ABI shared library (.dylib/.so/.dll).
@FrankUrbach
Copy link
Author

Pushed a fix for the CI failures.

Root cause: c/Cargo.toml in typedb/typedb-driver at tag 3.8.1 does not declare crate-type = ["cdylib"] under [lib]. The TypeDB project uses Bazel (rust_shared_library rule) as its actual build system for the C FFI library; the Cargo manifest is incomplete for shared-library builds.

Fix: Changed the build command from

cargo build --release -p typedb_driver_clib

to

cargo rustc --release -p typedb_driver_clib -- --crate-type=cdylib

This passes the crate type explicitly at compile time so cargo produces libtypedb_driver_clib.{dylib,so,dll} instead of a Rust static library (rlib).

--crate-type must be passed as a cargo-level flag, not after -- (which
would pass it to rustc directly). Also add --lib to explicitly select
the library compilation unit, matching the known-working iceberg_rust_ffi
pattern.
cargo rustc --crate-type flag requires cargo >=1.64 which may not be
available in the sandbox. Use sed to patch c/Cargo.toml directly, then
plain cargo build --release. This avoids any cargo version dependency.
Root cause: typedb-protocol (git dep of typedb-driver) has a build.rs
that calls tonic_build::compile_protos(), which invokes `protoc` to
generate Rust gRPC stubs from .proto files. Without protoc in PATH
the build fails immediately.

Also set PROTOC env var explicitly for prost-build to find it.
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