Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove 'default-members' in workspace, default to all crates #752

Merged
merged 9 commits into from
Mar 21, 2025
Merged
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ members = [
"test-utils",
"feature-tests",
]
# Only check / build main crates by default (check all with `--workspace`)
default-members = ["acceptance", "kernel"]
resolver = "2"

[workspace.package]
Expand Down
9 changes: 7 additions & 2 deletions ffi/src/engine_data.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
//! EngineData related ffi code

#[cfg(feature = "default-engine")]
use delta_kernel::arrow::array::{
ffi::{FFI_ArrowArray, FFI_ArrowSchema},
ArrayData, StructArray,
};
use delta_kernel::{DeltaResult, EngineData};
#[cfg(feature = "default-engine")]
use delta_kernel::DeltaResult;
use delta_kernel::EngineData;
use std::ffi::c_void;

use crate::{ExclusiveEngineData, ExternResult, IntoExternResult, SharedExternEngine};
use crate::ExclusiveEngineData;
#[cfg(feature = "default-engine")]
use crate::{ExternResult, IntoExternResult, SharedExternEngine};

use super::handle::Handle;

Expand Down
2 changes: 2 additions & 0 deletions ffi/src/engine_funcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ impl Drop for FileReadResultIterator {
///
/// The iterator must be valid (returned by [`read_parquet_file`]) and not yet freed by
/// [`free_read_result_iter`]. The visitor function pointer must be non-null.
///
/// [`free_engine_data`]: crate::free_engine_data
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ohh nm, i guess it creates the link in the docs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep!

#[no_mangle]
pub unsafe extern "C" fn read_result_next(
mut data: Handle<ExclusiveFileReadResultIterator>,
Expand Down
4 changes: 3 additions & 1 deletion ffi/src/expressions/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ impl KernelExpressionVisitorState {
///
/// When invoking [`scan::scan`], The engine provides a pointer to the (engine's native) predicate,
/// along with a visitor function that can be invoked to recursively visit the predicate. This
/// engine state must be valid until the call to `scan::scan` returns. Inside that method, the
/// engine state must be valid until the call to [`scan::scan`] returns. Inside that method, the
/// kernel allocates visitor state, which becomes the second argument to the predicate visitor
/// invocation along with the engine-provided predicate pointer. The visitor state is valid for the
/// lifetime of the predicate visitor invocation. Thanks to this double indirection, engine and
/// kernel each retain ownership of their respective objects, with no need to coordinate memory
/// lifetimes with the other.
///
/// [`scan::scan`]: crate::scan::scan
#[repr(C)]
pub struct EnginePredicate {
pub predicate: *mut c_void,
Expand Down
4 changes: 2 additions & 2 deletions ffi/src/expressions/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ type VisitUnaryFn = extern "C" fn(data: *mut c_void, sibling_list_id: usize, chi
/// WARNING: The visitor MUST NOT retain internal references to string slices or binary data passed
/// to visitor methods
/// TODO: Visit type information in struct field and null. This will likely involve using the schema
/// visitor. Note that struct literals are currently in flux, and may change significantly. Here is the relevant
/// issue: https://github.com/delta-io/delta-kernel-rs/issues/412
/// visitor. Note that struct literals are currently in flux, and may change significantly. Here is
/// the relevant issue: <https://github.com/delta-io/delta-kernel-rs/issues/412>
#[repr(C)]
pub struct EngineExpressionVisitor {
/// An opaque engine state pointer
Expand Down
8 changes: 4 additions & 4 deletions ffi/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ mod private {
/// Additionally, in keeping with the [`Send`] contract, multi-threaded external code must
/// enforce mutual exclusion -- no mutable handle should ever be passed to more than one kernel
/// API call at a time. If thread races are possible, the handle should be protected with a
/// mutex. Due to Rust [reference
/// rules](https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#the-rules-of-references),
/// this requirement applies even for API calls that appear to be read-only (because Rust code
/// always receives the handle as mutable).
/// mutex. Due to Rust [reference rules], this requirement applies even for API calls that
/// appear to be read-only (because Rust code always receives the handle as mutable).
///
/// NOTE: Because the underlying type is always [`Sync`], multi-threaded external code can
/// freely access shared (non-mutable) handles.
///
/// [reference rules]:
/// https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html#the-rules-of-references
/// cbindgen:transparent-typedef
#[repr(transparent)]
pub struct Handle<H: HandleDescriptor> {
Expand Down
11 changes: 8 additions & 3 deletions ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Iterator for EngineIterator {
///
/// Whoever instantiates the struct must ensure it does not outlive the data it points to. The
/// compiler cannot help us here, because raw pointers don't have lifetimes. A good rule of thumb is
/// to always use the [`kernel_string_slice`] macro to create string slices, and to avoid returning
/// to always use the `kernel_string_slice` macro to create string slices, and to avoid returning
/// a string slice from a code block or function (since the move risks over-extending its lifetime):
///
/// ```ignore
Expand Down Expand Up @@ -331,6 +331,8 @@ pub unsafe extern "C" fn free_row_indexes(slice: KernelRowIndexArray) {
/// an opaque struct that encapsulates data read by an engine. this handle can be passed back into
/// some kernel calls to operate on the data, or can be converted into the raw data as read by the
/// [`delta_kernel::Engine`] by calling [`get_raw_engine_data`]
///
/// [`get_raw_engine_data`]: crate::engine_data::get_raw_engine_data
#[handle_descriptor(target=dyn EngineData, mutable=true)]
pub struct ExclusiveEngineData;

Expand Down Expand Up @@ -677,8 +679,11 @@ pub struct StringSliceIterator;

/// # Safety
///
/// The iterator must be valid (returned by [kernel_scan_data_init]) and not yet freed by
/// [kernel_scan_data_free]. The visitor function pointer must be non-null.
/// The iterator must be valid (returned by [`kernel_scan_data_init`]) and not yet freed by
/// [`free_kernel_scan_data`]. The visitor function pointer must be non-null.
///
/// [`kernel_scan_data_init`]: crate::scan::kernel_scan_data_init
/// [`free_kernel_scan_data`]: crate::scan::free_kernel_scan_data
#[no_mangle]
pub unsafe extern "C" fn string_slice_next(
data: Handle<StringSliceIterator>,
Expand Down
6 changes: 5 additions & 1 deletion ffi/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ use super::handle::Handle;
pub struct SharedScan;

/// Drops a scan.
///
/// # Safety
/// Caller is responsible for passing a [valid][Handle#Validity] scan handle.
/// Caller is responsible for passing a valid scan handle.
#[no_mangle]
pub unsafe extern "C" fn free_scan(scan: Handle<SharedScan>) {
scan.drop_handle();
Expand Down Expand Up @@ -182,6 +183,9 @@ fn kernel_scan_data_init_impl(
///
/// The iterator must be valid (returned by [kernel_scan_data_init]) and not yet freed by
/// [`free_kernel_scan_data`]. The visitor function pointer must be non-null.
///
/// [`free_bool_slice`]: crate::free_bool_slice
/// [`free_engine_data`]: crate::free_engine_data
#[no_mangle]
pub unsafe extern "C" fn kernel_scan_data_next(
data: Handle<SharedScanDataIterator>,
Expand Down
Loading