Skip to content

draft: testing transition from abi_stable to stabby#21025

Draft
timsaucer wants to merge 1 commit intoapache:mainfrom
timsaucer:feat/transition-stabby
Draft

draft: testing transition from abi_stable to stabby#21025
timsaucer wants to merge 1 commit intoapache:mainfrom
timsaucer:feat/transition-stabby

Conversation

@timsaucer
Copy link
Member

Which issue does this PR close?

Rationale for this change

abi_stable appears unmaintained and has some stale dependencies that are marked as vulnerabilities.

What changes are included in this PR?

The following is a LLM generated changelog:

Replace abi_stable and async-ffi dependencies with stabby for ABI-stable FFI types, and custom #[repr(C)] replacements for async primitives and Option/Result wrappers.

Key changes:

  • Replace RVec/RString/RStr/RSlice with stabby equivalents
  • Replace RHashMap<K,V> with stabby::alloc::vec::Vec<(K,V)>
  • Add ffi_option.rs with FfiOption<T>/FfiResult<T,E> (#[repr(C,u8)] enums that work without IStable bounds on T)
  • Add ffi_future.rs replacing async-ffi with custom FfiFuture/FfiPoll/ FfiContext types
  • Simple enums use #[stabby::stabby] + #[repr(u8)] for compile-time ABI verification
  • Replace RootModule/export_root_module with #[no_mangle] + libloading
  • Update FFI examples to match new patterns
  • All 98 tests pass (81 unit + 17 integration)

Are these changes tested?

Tested against datafusion-python and existing unit tests.

Are there any user-facing changes?

This is an breaking API change in the FFI crate. Users should not need to migrate their code, but it does impact the ABI. Major versions are not currently guaranteed to be compatible until #17374 resolves.

Replace `abi_stable` and `async-ffi` dependencies with `stabby` for
ABI-stable FFI types, and custom `#[repr(C)]` replacements for async
primitives and Option/Result wrappers.

Key changes:
- Replace `RVec`/`RString`/`RStr`/`RSlice` with stabby equivalents
- Replace `RHashMap<K,V>` with `stabby::alloc::vec::Vec<(K,V)>`
- Add `ffi_option.rs` with `FfiOption<T>`/`FfiResult<T,E>` (#[repr(C,u8)]
  enums that work without IStable bounds on T)
- Add `ffi_future.rs` replacing async-ffi with custom FfiFuture/FfiPoll/
  FfiContext types
- Simple enums use `#[stabby::stabby]` + `#[repr(u8)]` for compile-time
  ABI verification
- Replace RootModule/export_root_module with #[no_mangle] + libloading
- Update FFI examples to match new patterns
- All 98 tests pass (81 unit + 17 integration)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the ffi Changes to the ffi crate label Mar 18, 2026
@timsaucer
Copy link
Member Author

@coderfender if you want it, this is a purely LLM generated PR that I had Claude Opus write last night. I did test it against datafusion-python. If this is helpful, please let me know. Otherwise I can delete this branch if you want to take a different approach.

There is a massive caveat here: I have NOT reviewed this code. I just wanted to give you a jumping off point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ffi Changes to the ffi crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove generational-arena from project

1 participant