Skip to content

Fix RI.DEL failures from stale BfTree native binaries#1933

Open
tiagonapoli wants to merge 1 commit into
mainfrom
tiagonapoli/fix-ri-del-invalid-args
Open

Fix RI.DEL failures from stale BfTree native binaries#1933
tiagonapoli wants to merge 1 commit into
mainfrom
tiagonapoli/fix-ri-del-invalid-args

Conversation

@tiagonapoli

@tiagonapoli tiagonapoli commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Problem

Garnet.test.rangeindex fails with RI.DEL: invalid arguments when the committed BfTree native binaries are out of sync with the Rust FFI: bftree_delete now returns an int status, and a binary built from older source returns garbage that the C# side rejects.

Fix

  • Refreshed the committed win-x64 and linux-x64 binaries to match the current FFI (pinned toolchain 1.94.0).
  • csproj stages the committed host-RID binary to the output root (for framework-dependent hosts like BfTreeInterop.test, fixing DllNotFoundException) in addition to runtimes/<rid>/native/ (for GarnetServer/Garnet.test.rangeindex). No Rust toolchain is used to build/run/test; regenerating a binary is a manual cargo build --release + copy into runtimes/<rid>/native/.
  • ci.yml: dropped the Rust install/build steps.

Verify

Garnet.slnx builds with no Rust; BfTreeInterop.test (46) and rangeindex Del (11) pass.

Copilot AI review requested due to automatic review settings July 14, 2026 22:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses CI failures in range index tests caused by a stale committed BfTree native binary by ensuring the Rust cdylib is built and staged during normal .NET builds, and by adding CI caching to keep the additional Rust build work fast.

Changes:

  • Updates BfTreeInterop.csproj to build the Rust cdylib earlier in the build pipeline and stage the freshly built native binary so it is preferred at runtime.
  • Updates CI to cache Rust/Cargo state and the crate target/ directory, and removes the workflow’s explicit per-test cargo build step (shifting responsibility to the project build).

Reviewed changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated 5 comments.

File Description
libs/native/bftree-garnet/BfTreeInterop.csproj Builds/stages the Rust cdylib earlier so consumers load the fresh native binary rather than a stale prebuilt.
.github/workflows/ci.yml Adds Rust build caching to Garnet-building jobs and removes the explicit cargo build step in the test matrix.

Comment thread libs/native/bftree-garnet/BfTreeInterop.csproj Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
@tiagonapoli tiagonapoli changed the title Fix stale BfTree native binary causing RI.DEL failures; build Rust fresh in CI Fix stale BfTree native binary causing RI.DEL failures; keep binaries committed (no Rust in CI) Jul 15, 2026
@tiagonapoli tiagonapoli changed the title Fix stale BfTree native binary causing RI.DEL failures; keep binaries committed (no Rust in CI) Fix RI.DEL failures from stale BfTree native binaries Jul 15, 2026
@tiagonapoli tiagonapoli force-pushed the tiagonapoli/fix-ri-del-invalid-args branch 2 times, most recently from 5d289ad to bb60533 Compare July 15, 2026 06:30
The committed BfTree native binaries were out of sync with the Rust FFI
(bftree_delete now returns an int status), so RangeIndex tests failed with
'RI.DEL: invalid arguments'. Refresh the committed win-x64 and linux-x64
binaries to match the current FFI.

Also make Debug builds work without a Rust toolchain: framework-dependent test
hosts (e.g. BfTreeInterop.test) probe only the output root, but the prebuilt
binary was only staged under runtimes/<rid>/native. Add a csproj fallback that
copies the committed runtimes/<rid>/native binary to the output root when the
fresh cargo build output is absent, so P/Invoke resolves with no Rust installed.
'Freshly built cargo binary wins' still holds when Rust is present.

CI no longer builds the cdylib; it consumes the committed binaries. The release
pipeline builds the native binaries fresh from Rust source for both linux-x64
and win-x64, overwriting the committed binaries on disk before packaging so
releases never ship a committed binary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: dde24203-c2d7-4f05-a4cd-9f3c9b6b7330
@tiagonapoli tiagonapoli force-pushed the tiagonapoli/fix-ri-del-invalid-args branch from bb60533 to 714c0d4 Compare July 15, 2026 06:32
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.

2 participants