Skip to content

Commit

Permalink
added handler for windows text behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mightyshazam committed Feb 20, 2024
1 parent 6c747a9 commit 2e6b20b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
# Needs to be 16.0.0 until https://github.com/dotnet/ClangSharp/pull/506 released
run: |
dotnet tool install --global --version 16.0.0 ClangSharpPInvokeGenerator
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
ClangSharpPInvokeGenerator @src/DeltaLake/Bridge/GenerateInterop.rsp
npx doctoc README.md
git config --global core.safecrlf false
git diff --exit-code
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- [Rebuilding Rust extension and interop layer](#rebuilding-rust-extension-and-interop-layer)
- [Regenerating API docs](#regenerating-api-docs)

To regen core interop from header, install
[ClangSharpPInvokeGenerator](https://github.com/dotnet/ClangSharp#generating-bindings) 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.

```bash
dotnet tool install --global ClangSharpPInvokeGenerator
```

### Regenerating API docs

Install [docfx](https://dotnet.github.io/docfx/), then run:

docfx src/DeltaLake.ApiDoc/docfx.json
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
```bash
dotnet tool install --global ClangSharpPInvokeGenerator
```

```bash
ClangSharpPInvokeGenerator @src/DeltaLake/Bridge/GenerateInterop.rsp
```

OSX

```bash
ClangSharpPInvokeGenerator -I /opt/homebrew/Cellar/llvm/17.0.6/lib/clang/17/include -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include @src/DeltaLake/Bridge/GenerateInterop.rsp
```

flatc version `23.5.26` [doesn't properly generate verifiers](https://github.com/google/flatbuffers/issues/7899). Until this is fixed, use an earlier version or build directly from master because the change was merged.
This package is a C# wrapper around [delta-rs](https://github.com/delta-io/delta-rs/tree/rust-v0.17.0).
15 changes: 13 additions & 2 deletions tests/DeltaLake.Tests/Table/LoadTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.InteropServices;
using DeltaLake.Runtime;
using DeltaLake.Table;

Expand Down Expand Up @@ -130,15 +131,25 @@ await Assert.ThrowsAsync<DeltaLakeException>(async () =>
[Fact]
public async Task Table_Load_Invalid_Path_Test()
{
await Assert.ThrowsAsync<DeltaLakeException>(async () =>
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
await Assert.ThrowsAsync<DeltaLakeException>(TestBodyAsync);
}
else
{

await Assert.ThrowsAsync<SEHException>(TestBodyAsync);
}

static async Task TestBodyAsync()
{
using var runtime = new DeltaRuntime(RuntimeOptions.Default);
using var table = await DeltaTable.LoadAsync(runtime, "file://invalid.uri", new TableOptions
{
Version = 50,
},
CancellationToken.None);
});
}
}

[Theory]
Expand Down

0 comments on commit 2e6b20b

Please sign in to comment.