From 8526de8748abb8458fa9f936fcb4c36e15d7a2d7 Mon Sep 17 00:00:00 2001 From: Tyler Cloutier Date: Sun, 1 Mar 2026 22:20:58 -0500 Subject: [PATCH] Update NativeAOT-LLVM infrastructure to current ABI and add CI smoketest The experimental NativeAOT-LLVM build path (EXPERIMENTAL_WASM_AOT=1) was missing several host function imports added in ABI versions 10.0-10.4, and the compiler package reference was hardcoded to Windows x64 only. Changes to SpacetimeDB.Runtime.targets: - Add missing spacetime_10.0 imports: datastore_update_bsatn, identity - Add all spacetime_10.1 imports: bytes_source_remaining_length - Add all spacetime_10.2 imports: get_jwt - Add all spacetime_10.3 imports: procedure_start_mut_tx, procedure_commit_mut_tx, procedure_abort_mut_tx, procedure_http_request - Add all spacetime_10.4 imports: datastore_index_scan_point_bsatn, datastore_delete_by_index_scan_point_bsatn - Replace hardcoded runtime.win-x64 package reference with runtime.$(NETCoreSdkPortableRuntimeIdentifier) so the AOT compiler package resolves correctly on both Windows x64 and Linux x64 - Use explicit version strings instead of $(SpacetimeNamespace) variable Changes to ci.yml: - Add AOT build smoketest in csharp-testsuite job to verify the NativeAOT-LLVM build path works on Linux x64 See #4514 for full context on the C# AOT situation. --- .github/workflows/ci.yml | 6 ++ .../Runtime/build/SpacetimeDB.Runtime.targets | 57 ++++++++++++------- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3eb7e9cada..c13ecb07362 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -995,6 +995,12 @@ jobs: exit 1 } + - name: Smoketest C# AOT build (NativeAOT-LLVM) + run: | + cd modules/sdk-test-cs + EXPERIMENTAL_WASM_AOT=1 dotnet publish -c Release + test -f bin/Release/net8.0/wasi-wasm/publish/StdbModule.wasm + internal-tests: name: Internal Tests needs: [lints] diff --git a/crates/bindings-csharp/Runtime/build/SpacetimeDB.Runtime.targets b/crates/bindings-csharp/Runtime/build/SpacetimeDB.Runtime.targets index 780d6f19f43..aa412113b31 100644 --- a/crates/bindings-csharp/Runtime/build/SpacetimeDB.Runtime.targets +++ b/crates/bindings-csharp/Runtime/build/SpacetimeDB.Runtime.targets @@ -4,27 +4,46 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - +