Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
89586a2
Add the functionality to use NativeAOT-LLVM to build a P1 .wasm (core…
JasonAtClockwork Apr 2, 2026
891a4b4
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff Apr 28, 2026
2351acb
Add support for .NET 8 JIT, .NET AOT and .NET 10 AOT in the same NuGe…
rekhoff Apr 29, 2026
3abc343
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff Apr 29, 2026
62f1354
Resolved 3 CI failures
rekhoff Apr 29, 2026
c3041ac
Update C# module smoketests for .NET 10, cli ref docs, and Unity Meta…
rekhoff Apr 29, 2026
98216f9
Update lint
rekhoff Apr 29, 2026
fcfbef2
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff Apr 29, 2026
1fe6d8b
Adding additional `dotnet-experimental` package sources
rekhoff Apr 30, 2026
8008c6e
Group package by source and install WASI SDK on Linux
rekhoff Apr 30, 2026
e3e1d78
Target Linux WASI SDK
rekhoff Apr 30, 2026
b0d1fc6
Added specific `dotnet-experimental` check for quickstart, and `WASI …
rekhoff Apr 30, 2026
171767f
Update lint
rekhoff Apr 30, 2026
551b656
Fix NativeAOT-LLVM CI build and add --dotnet-version flag
rekhoff May 1, 2026
15266d0
Update lint
rekhoff May 1, 2026
eb613c2
Added check if `WASI SDK` already installed, and changed target to ve…
rekhoff May 1, 2026
5e5ed90
Updated target framework to also check for `net10.0`
rekhoff May 3, 2026
73fceb0
Update `csharp_module` to use .NET 8 JIT path
rekhoff May 3, 2026
024bf61
Add `--from-previous-sdk` to `dotnet workload update`
rekhoff May 4, 2026
c2ac428
Adding additional `wasi-experimental` install locations
rekhoff May 5, 2026
0a9dd20
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 5, 2026
a1fd123
Write `global.json` files for .NET 8 workloads, to ensure `wasi-exper…
rekhoff May 5, 2026
633861a
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 5, 2026
aaf16d6
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 5, 2026
dba4176
Adds additional checks on when to use NativeAOT to the Runtime.props
rekhoff May 6, 2026
157499d
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 6, 2026
1304ac9
Adds a step to install native WASI SDK toolchain to the `csharp-tests…
rekhoff May 6, 2026
d645103
Adds a crash protection when `global.json` appears missing
rekhoff May 6, 2026
1fc33cf
Fixed logic error in crash protection when `global.json` appears missing
rekhoff May 6, 2026
044d516
Fix global.json symlinks for regression tests
rekhoff May 6, 2026
6655bff
Use absolute path to the repo root in GitHub Actions
rekhoff May 6, 2026
17ee828
Just creating the `global.json` if missing
rekhoff May 6, 2026
9273f4f
Restores the original global.json symlinks after regression test
rekhoff May 6, 2026
c320f48
Running `spacetimedb-sdk` test with `--test-threads=1` to avoid SIGKI…
rekhoff May 6, 2026
61d57eb
Reverting `spacetimedb-sdk` tests back to `--test-threads=2`
rekhoff May 6, 2026
2f268e8
Updates made to documentation
rekhoff May 7, 2026
3b5fb03
Setting CI test to use `ubuntu-latest` rather than `spacetimedb-new-r…
rekhoff May 7, 2026
1247efa
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 7, 2026
15ae5e8
Update Wasi SDK version back to 29
rekhoff May 7, 2026
764abb6
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 129 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,26 @@ jobs:
./emsdk install 4.0.21
./emsdk activate 4.0.21

# Install WASI SDK for .NET 10 NativeAOT-LLVM compilation.
- name: Install WASI SDK (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
WASI_SDK_VERSION="29"
WASI_SDK_PATH="/opt/wasi-sdk"
if [ -d "$WASI_SDK_PATH" ] && [ -f "$WASI_SDK_PATH/bin/clang" ]; then
echo "WASI SDK already installed at $WASI_SDK_PATH"
else
echo "Installing WASI SDK version $WASI_SDK_VERSION..."
wget -q "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
tar -xzf "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
sudo mv "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux" "$WASI_SDK_PATH"
rm -f "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
echo "WASI SDK installed successfully"
fi
echo "WASI_SDK_PATH=$WASI_SDK_PATH" >> "$GITHUB_ENV"
echo "Using WASI SDK at: $WASI_SDK_PATH"

- name: Install emscripten (Windows)
if: runner.os == 'Windows'
shell: pwsh
Expand All @@ -103,6 +123,29 @@ jobs:
.\emsdk install 4.0.21
.\emsdk activate 4.0.21

# Install WASI SDK for .NET 10 NativeAOT-LLVM compilation.
- name: Install WASI SDK (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$wasiSdkVersion = "25"
$wasiDir = "$env:USERPROFILE\.wasi-sdk"
$clangPath = Join-Path $wasiDir "bin\clang.exe"
if (Test-Path $clangPath) {
Write-Host "WASI SDK already installed at $wasiDir"
} else {
Write-Host "Installing WASI SDK version $wasiSdkVersion..."
$wasiUrl = "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${wasiSdkVersion}/wasi-sdk-${wasiSdkVersion}.0-x86_64-windows.tar.gz"
Invoke-WebRequest -Uri $wasiUrl -OutFile "$env:TEMP\wasi-sdk.tar.gz"
New-Item -ItemType Directory -Force -Path $wasiDir | Out-Null
& "$env:SystemRoot\System32\tar.exe" -xzf "$env:TEMP\wasi-sdk.tar.gz" -C $wasiDir --strip-components=1
Remove-Item "$env:TEMP\wasi-sdk.tar.gz" -Force -ErrorAction SilentlyContinue
Write-Host "WASI SDK installed successfully"
}
echo "WASI_SDK_PATH=$wasiDir" >> $env:GITHUB_ENV
Write-Host "Using WASI SDK at: $wasiDir"

- name: Install psql (Windows)
if: runner.os == 'Windows'
shell: pwsh
Expand All @@ -123,9 +166,14 @@ jobs:
$PSNativeCommandUseErrorActionPreference = $true

cd modules
# the sdk-manifests on windows-latest are messed up, so we need to update them
dotnet workload config --update-mode manifests
dotnet workload update
dotnet workload update --from-previous-sdk
# Explicitly install wasi-experimental for .NET 8 SDK (needed for test_build_csharp_module)
# Create temp global.json to target .NET 8 SDK for workload install
$sdk8Json = '{"sdk":{"version":"8.0.400","rollForward":"latestFeature"}}'
$sdk8Json | Out-File -FilePath global.json -Encoding utf8
dotnet workload install wasi-experimental
Remove-Item global.json

- name: Override NuGet packages
shell: bash
Expand Down Expand Up @@ -178,7 +226,7 @@ jobs:
test:
needs: [lints]
name: Test Suite
runs-on: spacetimedb-new-runner-2
runs-on: ubuntu-latest

env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
Expand Down Expand Up @@ -235,6 +283,25 @@ jobs:
./emsdk install 4.0.21
./emsdk activate 4.0.21

# Install WASI SDK for .NET 10 NativeAOT-LLVM compilation (idempotent - checks if already exists).
- name: Install WASI SDK
shell: bash
run: |
WASI_SDK_VERSION="29"
WASI_SDK_PATH="/opt/wasi-sdk"
if [ -d "$WASI_SDK_PATH" ] && [ -f "$WASI_SDK_PATH/bin/clang" ]; then
echo "WASI SDK already installed at $WASI_SDK_PATH"
else
echo "Installing WASI SDK version $WASI_SDK_VERSION..."
wget -q "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
tar -xzf "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
sudo mv "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux" "$WASI_SDK_PATH"
rm -f "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
echo "WASI SDK installed successfully"
fi
echo "WASI_SDK_PATH=$WASI_SDK_PATH" >> "$GITHUB_ENV"
echo "Using WASI SDK at: $WASI_SDK_PATH"

- name: Install wasm-bindgen CLI
run: |
REQUIRED_WASM_BINDGEN_VERSION="$(
Expand Down Expand Up @@ -760,6 +827,50 @@ jobs:
with:
global-json-file: global.json

- name: Install .NET workloads
run: |
dotnet workload config --update-mode manifests
dotnet workload update --from-previous-sdk
# Explicitly install wasi-experimental for .NET 8 SDK (needed for test_build_csharp_module)
# Create temp global.json to target .NET 8 SDK for workload install
echo '{"sdk":{"version":"8.0.400","rollForward":"latestFeature"}}' > global.json
dotnet workload install wasi-experimental
rm global.json

# Install native WASI SDK toolchain (needed by WasiApp.Native.targets to compile native files).
- name: Install WASI SDK
run: |
WASI_SDK_VERSION="29"
WASI_SDK_PATH="/opt/wasi-sdk"
if [ -d "$WASI_SDK_PATH" ] && [ -f "$WASI_SDK_PATH/bin/clang" ]; then
echo "WASI SDK already installed at $WASI_SDK_PATH"
else
echo "Installing WASI SDK version $WASI_SDK_VERSION..."
wget -q "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
tar -xzf "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
sudo mv "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux" "$WASI_SDK_PATH"
rm -f "wasi-sdk-${WASI_SDK_VERSION}.0-x86_64-linux.tar.gz"
echo "WASI SDK installed successfully"
fi
echo "WASI_SDK_PATH=$WASI_SDK_PATH" >> "$GITHUB_ENV"
echo "Using WASI SDK at: $WASI_SDK_PATH"

# Ensure global.json files exist for regression tests (symlinks may not work in CI)
- name: Fix global.json symlinks
run: |
for dir in sdks/csharp/examples~/regression-tests/server \
sdks/csharp/examples~/regression-tests/republishing/server-initial \
sdks/csharp/examples~/regression-tests/republishing/server-republish; do
if [ -L "$dir/global.json" ] && [ ! -f "$dir/global.json" ]; then
echo "Fixing broken symlink at $dir/global.json"
rm -f "$dir/global.json"
fi
if [ ! -f "$dir/global.json" ]; then
echo "Creating $dir/global.json"
echo '{"sdk":{"version":"10.0.100","rollForward":"latestMinor"}}' > "$dir/global.json"
fi
done

- name: Override NuGet packages
run: |
dotnet pack crates/bindings-csharp/BSATN.Runtime
Expand Down Expand Up @@ -856,6 +967,21 @@ jobs:
- name: Run regression tests
run: |
bash sdks/csharp/tools~/run-regression-tests.sh
# Restore global.json symlinks (we replaced them with files to work around .NET 10 SDK bug)
# server is 5 levels deep from root, republishing dirs are 6 levels deep
if [ -f sdks/csharp/examples~/regression-tests/server/global.json ] && [ ! -L sdks/csharp/examples~/regression-tests/server/global.json ]; then
echo "Restoring symlink at server/global.json"
rm -f sdks/csharp/examples~/regression-tests/server/global.json
ln -s ../../../../../global.json sdks/csharp/examples~/regression-tests/server/global.json
fi
for dir in sdks/csharp/examples~/regression-tests/republishing/server-initial \
sdks/csharp/examples~/regression-tests/republishing/server-republish; do
if [ -f "$dir/global.json" ] && [ ! -L "$dir/global.json" ]; then
echo "Restoring symlink at $dir/global.json"
rm -f "$dir/global.json"
ln -s ../../../../../../global.json "$dir/global.json"
fi
done
tools/check-diff.sh sdks/csharp/examples~/regression-tests || {
echo 'Error: Bindings are dirty. Please run `sdks/csharp/tools~/gen-regression-tests.sh`.'
exit 1
Expand Down
2 changes: 1 addition & 1 deletion crates/bindings-csharp/BSATN.Runtime/BSATN.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PropertyGroup>
<!-- Note: the binary produced by this package is used in Unity too, which is limited to .NET Standard 2.1. -->
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net8.0;net10.0</TargetFrameworks>
<RootNamespace>SpacetimeDB</RootNamespace>
<!-- You can enable this when debugging codegen problems. Outputs in obj/debug/[version]/generated. -->
<!-- <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> -->
Expand Down
Loading
Loading