Skip to content

Do not build a cdylib for lance-arrow - #75

Open
alexey-milovidov wants to merge 1 commit into
mainfrom
lance-arrow-drop-cdylib
Open

Do not build a cdylib for lance-arrow#75
alexey-milovidov wants to merge 1 commit into
mainfrom
lance-arrow-drop-cdylib

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 The vendored lance-arrow crate declares crate-type = ["cdylib", "rlib"]. ClickHouse only consumes the rlib, but Cargo still links the shared library, and for a shared library rustc appends its default linker libraries (-lgcc_s, -lutil, ...). The ClickHouse sysroot does not carry those, so every build of the Lance adapter fails with:

ld.lld: error: unable to find library -lgcc_s
ld.lld: error: unable to find library -lutil
error: could not compile `lance-arrow` (lib)

This drops the unused cdylib crate type (and updates .cargo-checksum.json accordingly). With it, ninja _cargo-build__ch_rust_lance and the full clickhouse binary build.

Needed by ClickHouse/ClickHouse#110548
Related: #71

The vendored `lance-arrow` crate declares `crate-type = ["cdylib", "rlib"]`.
ClickHouse only consumes the `rlib`, but Cargo still links the shared library,
and for a shared library `rustc` appends its default linker libraries
(`-lgcc_s`, `-lutil`, ...). The ClickHouse sysroot does not carry those, so the
link fails with `ld.lld: error: unable to find library -lgcc_s`.

Drop the unused `cdylib` crate type.
alexey-milovidov added a commit to fastio/ClickHouse that referenced this pull request Aug 12, 2026
The Lance crates were never actually compiled in CI: every run stopped at
`Checkout Submodules`, because `contrib/rust_vendor` pointed at a commit that
only existed in a fork. With the submodule pointer fixed, three real build
failures surface.

1. `lance-encoding`, `lance-index` and friends generate Rust code from `.proto`
   files with `prost-build`, which needs a `protoc` binary and the well-known
   type definitions. Point `PROTOC` at the `protoc` ClickHouse builds from
   `contrib/google-protobuf` and `PROTOC_INCLUDE` at its `src` directory,
   instead of silently depending on a host installation. When cross-compiling,
   `protoc` comes from the nested native build, the same way `protobuf_generate`
   uses it. `ENABLE_LANCE` now requires Protobuf.

2. The vendored `lance-arrow` crate declares `crate-type = ["cdylib", "rlib"]`.
   Only the `rlib` is consumed, but Cargo still links the shared library, and
   for a shared library `rustc` appends default linker libraries (`-lgcc_s`,
   `-lutil`) that the ClickHouse sysroot does not carry. Fixed in `rust_vendor`
   (ClickHouse/rust_vendor#75) and picked up here via
   the submodule pointer.

3. Four crates newly vendored for Lance declare the license
   `Zlib OR MIT OR Apache-2.0`, an ordering `list-licenses.sh` did not know, so
   `StorageSystemLicenses.generated.cpp` could not be generated and CMake
   configuration failed.
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