- Rebuilding Rust extension and interop layer
- Rebuilding Kernel FFI and interop layer
- Regenerating API docs
The devcontainer comes preloaded with all of the requisite dependencies.
It includes a Makefile to generate bindings.
Use make generate-bindings to generate everything.
Use make generate-bridge-bindings for the bridge code.
Use make generate-kernel-bindings for the kernel code
To regen core interop from header, install ClangSharpPInvokeGenerator like:
dotnet tool install --global ClangSharpPInvokeGenerator
Then, run:
ClangSharpPInvokeGenerator @src/DeltaLake/Bridge/GenerateInterop.rsp
The Rust DLL is built automatically when the project is built.
dotnet tool install --global ClangSharpPInvokeGeneratordelta-kernel-rs is linked as a git submodule in this repo.
We first build the Kernel DLL and FFI header, and use the header to generate the C# Interop classes.
All 3 of these things are tightly coupled and must happen sequentially when you git clone this repo:
- The git submodule must be initiated
- The
dlland.hmust be built - The
.hheader is used to generate the interop.csclasses
Note that the
.dll/.so/...files are continuously generated via thecsproj- but the.hand the.csfiles are git committed, and must be generated by a maintainer using the steps below, whenever we bump the FFI version indelta-kernel-rs.version.txt.
$GIT_ROOT = git rev-parse --show-toplevel
cd "$GIT_ROOT"
# Initiate submodule at release tag
#
git submodule update --init
$DELTA_KERNEL_RS_TAG = Get-Content $GIT_ROOT\src\DeltaLake\Kernel\delta-kernel-rs.version.txt
git -C $GIT_ROOT\src\DeltaLake\Kernel\delta-kernel-rs checkout $DELTA_KERNEL_RS_TAG
# Build the FFI with cloud storage features
#
$FFI_PROJ_PATH = "$GIT_ROOT/src/DeltaLake/Kernel/delta-kernel-rs/ffi"
cargo build --manifest-path $FFI_PROJ_PATH/Cargo.toml --no-default-features --features "default-engine-rustls"
# Copy the built header from cargo into C# Interop project
#
$HEADER_FILE = "delta_kernel_ffi.h"
$GENERATED_FFI_HEADER = "${GIT_ROOT}/src/DeltaLake/Kernel/delta-kernel-rs/target/ffi-headers/${HEADER_FILE}"
$CSHARP_FRIENDLY_FFI_HEADER = "$GIT_ROOT/src/DeltaLake/Kernel/include/${HEADER_FILE}"
Copy-Item -Path $GENERATED_FFI_HEADER -Destination $CSHARP_FRIENDLY_FFI_HEADER -Force
ClangSharpPInvokeGenerator -D DEFINE_DEFAULT_ENGINE_BASE=1 @src/DeltaLake/Kernel/GenerateInterop.rsp
Alternatively, if you have an environment that is not particularly cooperative, you can use the included
docker container and run
```bash
docker run --mount type=bind,src=.,dst=/app clangsharp -D DEFINE_DEFAULT_ENGINE_RUSTLS=1 @src/DeltaLake/Kernel/GenerateInterop.rspGet-ChildItem "$GIT_ROOT/src/DeltaLake/Kernel/Interop" -Filter Interop.cs -Recurse | ForEach-Object {
### Regenerating API docs
Install [docfx](https://dotnet.github.io/docfx/), then run:
docfx src/DeltaLake.ApiDoc/docfx.json