Repository navigation
build: consolidate Cargo workspace and pin Rust toolchain - #109
Merged
Merged
Conversation
Move the ObjectStore provider example into the root Cargo workspace and remove its separate lockfile so both crates share one locked dependency graph. Pin Rust 1.95.0 in rust-toolchain.toml and make the release profile explicit while keeping panic unwinding for the FFI boundary. Select the C library package explicitly in CMake and packaging, and install the pinned toolchain with its cross targets in CI.
Use strip=debuginfo so Release builds keep the function symbols that the existing Valgrind suppressions match. Run CMake's configuration-time rustc probes from the source tree so out-of-tree builds select the repository toolchain and its LLVM tools, matching the Cargo working directory.
This was referenced Nov 21, 2026
When the merge-base baseline was measured with a different toolchain, rebuild that commit with the pull request's pinned toolchain and compare against that measured baseline instead of the stale artifact. Show CTest failures and Valgrind logs when the Release test step fails, and upload the same diagnostics for both Ubuntu matrix jobs.
A missing baseline artifact can be an upload race, not a toolchain mismatch. Compare rust-toolchain.toml with the merge base and keep the normal comparison path when it matches, including its existing skip-on-missing behavior. Rebuild the merge base only for a real pin transition.
Rust 1.95 inlines the Lance Blob v2 LazyLock closures into the generic FnOnce frame, so the existing *BLOB_V2_DESC* suppression no longer matches even without stripping. Match the two nested LazyLock frames, or Field::try_from under one LazyLock, only when called from FileReader::decode_schema. Keep the possible-only leak kind.
Match the observed mangled LazyLock sequence and the adjacent hashbrown RawTable clone plus Field::try_from sequence. Keep only the allocator wildcard and possible-only classification, so field-name clones and allocations inserted between the Once frames no longer match.
…rgo-workspace # Conflicts: # examples/external_provider/Cargo.lock
This was referenced Nov 22, 2026
Xuanwo
added a commit
that referenced
this pull request
Nov 25, 2026
* build: reuse one lancedb-c Cargo unit and one target directory The rust-lib edge passed the export wrapper and the SONAME through `cargo rustc --` arguments. Those arguments change the unit profile, so the external-provider build that pulls lancedb-c in as a dependency rebuilt it with a plain profile, and the rust-lib run behind check-install rebuilt it back. Select the wrapper through Cargo's target linker configuration instead, which every invocation that compiles lancedb-c presents identically, and hand the SONAME to the wrapper from the rust-lib command environment so it reaches the lancedb cdylib alone. The Cargo target directory moves into LANCEDB_CARGO_TARGET_DIR with the same default, so a build can point Cargo at the directory CI caches. * ci: repair Rust caching and install Rust from rust-toolchain.toml Point CMake at the repository-root target directory that the cache action restores, give each build matrix leg its own cache key, cache the AlmaLinux job, and start a new cache generation because the linker configuration is a Cargo fingerprint input the action's key cannot see. Install cbindgen from the pinned official release asset instead of compiling it on every cold run. Every rustup-based CI and packaging job now installs its toolchain from rust-toolchain.toml, so the pinned channel, profile and components come from one file. The AlmaLinux job keeps the distro toolchain to preserve the distro compatibility coverage from #109. * ci: install the verified cbindgen binary with install(1) /usr/local/bin belongs to root on the runner image, so the download is verified in the workspace and only the checked file is copied with privileges. * build: resolve the Cargo target directory before use LANCEDB_CARGO_TARGET_DIR could be typed as a relative path. CMake retyped an untyped -D value against its invocation directory, Cargo passed the string to --target-dir under the source directory, Ninja used it relative to the build directory and the install rules resolved it against the configure directory. All of them now use one absolute path resolved against the build directory. * build: keep the export wrapper on the final target only Selecting the export wrapper through Cargo's target linker configuration replaced a caller's configured linker for every unit and made the provider and rust-lib commands share one Cargo unit whose SONAME identity came from an environment variable the fingerprint ignores. Pass the wrapper and SONAME as `cargo rustc --` arguments for the lancedb target only: build.rs forwards the caller's configured linker through RUSTC_LINKER, the provider never uplifts a library, and the rust-lib command owns the artifact. The provider keeps the CMake-resolved LANCEDB_BUILD_VERSION so its build no longer reruns the lancedb-c build script for a changed environment. * ci: drop the cache epoch for the reverted linker input The build no longer selects a linker through Cargo's target configuration, so the restored target directories keep valid fingerprints and the cache keys do not need a new generation. * build: use CMake paths for the Cargo target directory on Windows CI passes ${{ github.workspace }}/target, which is a native Windows path such as D:\a\lancedb-c\lancedb-c/target. CMake wrote that value into cmake_install.cmake unchanged, where file(INSTALL ...) read the backslash as an escape and either rejected the path or resolved a different file. Normalize the resolved target directory to CMake slash form on Windows hosts. Other hosts keep their native characters, and the documented relative resolution, spaces and cross-compile behavior are unchanged. * ci: use the AlmaLinux container workspace for the Cargo target The AlmaLinux job runs in a container where github.workspace is the host path (/home/runner/work/...) while the checkout is mounted at /__w/.... CMake built into the host path while the Rust cache cleaned and saved the container path, so this job never restored its target artifacts. Use the step shell's GITHUB_WORKSPACE so CMake, Cargo and the cache name the same container path. The previous full-match cache entry would otherwise make the action skip saving the corrected target tree, so the job gets its own cache key.
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.
Why
The root crate and
examples/object_store_providerkept separate lockfiles and toolchain assumptions, so every SDK upgrade had to update two dependency graphs in lockstep. The release profile was also implicit, which left debug-info stripping and panic behavior up to Cargo defaults.What changes
Cargo.lockis now the only lockfile; the example lockfile is removed.rust-toolchain.tomlpinned to Rust1.95.0, matchingrust-versioninCargo.toml.[profile.release]explicit:opt-level = 3,strip = "debuginfo", andpanic = "unwind". Unwinding stays enabled for the FFI boundary. Function symbols stay available for the existing Valgrind suppressions while debug sections are removed.lancedb-candlancedb-object_store-provider) so workspace-wide commands keep building and packaging the intended crate. Both CMake builds still share the CMake target directory.x86_64-pc-windows-gnufor the cross job and each matrix target for packaging. The AlmaLinux job keeps its system Rust to preserve distro toolchain coverage.BLOB_V2_DESCframe. The new patterns keeppossible-only classification and the observed frames adjacent.The pinned LanceDB
v0.42.0-beta.21and Lancev15.0.0-beta.25revisions, C binding version0.0.0, default features, and the example's provider behavior are unchanged. Current main's #87 IPC/lock changes and #107 CI changes are integrated; the root lock keeps the directarrow-ipcedge, and the example has no separate lock.Validation
cargo metadata --locked,cargo fmt --check, andcargo check -p lancedb-c --lockedon the pinned1.95.0toolchain after merging currentmain(94e84c2).1.95.0, and the coverage build resolvesllvm-profdata/llvm-covfrom that toolchain rather than the caller's default. The static-library native probe also succeeds.-DBUILD_EXAMPLES=ON; the generated commands use the shared target directory and explicit packages..github/scripts/test_package.py: 22/22 fixture tests pass.1.95.0coverage reference at88168d1measured 3309/3601 = 91.89%, identical to build: consolidate Cargo workspace and pin Rust toolchain #109. The old1.100.0baseline for that commit measured 3219/3502 = 91.92%, so the apparent drop came from toolchain line mapping, not product code.Native release builds, Release Valgrind, CTest, packaging, and the cross-target jobs are left to hosted CI.
Closes #98