Do not build a cdylib for lance-arrow - #75
Open
alexey-milovidov wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🕵 The vendored
lance-arrowcrate declarescrate-type = ["cdylib", "rlib"]. ClickHouse only consumes therlib, but Cargo still links the shared library, and for a shared libraryrustcappends its default linker libraries (-lgcc_s,-lutil, ...). The ClickHouse sysroot does not carry those, so every build of the Lance adapter fails with:This drops the unused
cdylibcrate type (and updates.cargo-checksum.jsonaccordingly). With it,ninja _cargo-build__ch_rust_lanceand the fullclickhousebinary build.Needed by ClickHouse/ClickHouse#110548
Related: #71