Repository navigation
build: restrict shared-library exports to the public header - #162
Merged
Merged
Conversation
This was referenced Nov 22, 2026
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.
Summary
Restrict the shared library's export surface to the functions declared in
include/lancedb.h..deffrom the header'sextern "C"declarations inbuild.rs. No fixed symbol count and no handwritten platform symbols.-C linker=cmake/export-linker.{sh,cmd}tocargo rustc. Plaincargo buildremains the normal path for static, rlib, path-dependency and external-provider development, but does not apply the shared export boundary. This is the compatibility tradeoff.liblancedblink, forwarding caller flags, SONAME/@rpath arguments, response files and-Xlinker/comma paths. On MSVC, the wrapper generates the paired.exp/.dll.libat link time, then installs the import library.--export-targettotest_install.py. The configured Cargo linker is resolved throughRUSTC_LINKERwithout overriding an explicitLANCEDB_REAL_LINKER. Linux ELF, Darwin Mach-O and native MSVC (including clang-cl) use the verifier; Windows GNU keeps its normalliblancedb.dll.ainstalled consumers withoutdumpbin.check_exports.py.check-installandpackage.py verifyuse the same check.Refs #99.
Verification
101d608:/DEFalone reproduced the dependency export, while the paired.exp/.dll.libexported only the public function; a real consumer linked with the import library and ran on both architectures.publish_release=false, run 45062344184, on224b99c. Package inputs are unchanged at final head7114151(only CMake and install-test wiring changed). Linux x64, Linux arm64 and Apple Silicon passed with exact exports, SONAME/install name and real consumers; Windows x64 and arm64 were still running at handoff.--export-target windows; Windows GNU selects neither; Linux selects the ELF wrapper and--export-target linux. Cargo target-linker forwarding preserves space-containing paths and explicitLANCEDB_REAL_LINKERprecedence; wrapper changes re-link. Package/release fixtures pass (36 and 32 tests).45066477229on final head was starting at handoff; the previous Windows x64 native job on224b99cpassed.Branch base: main
16d6217; actual main observedaa27943; integration tree with actual main iseb469df(no conflicts).