Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 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
9902837
Move back to custom runner
jdetter May 8, 2026
8d9f5e3
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 8, 2026
ee9ddce
Remove `run_dlls` function from `main.rs`
rekhoff May 8, 2026
adf35e5
Update lint
rekhoff May 8, 2026
ee130e4
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 11, 2026
576db3e
Fixed some dotnet version ordering logic
rekhoff May 11, 2026
a5a0d58
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 11, 2026
b0ce8d3
Resolve conflict with .NET 8 GC removing a needed .NET 10 workload
rekhoff May 12, 2026
b023178
Explicitly adding `EXPERIMENTAL_WASM_AOT` to .NET restore
rekhoff May 12, 2026
2f612bd
Adding a cache clearing step for AOT paths to prevent fallback to .NE…
rekhoff May 12, 2026
503f790
Moved `EXPERIMENTAL_WASM_AOT` set to start of `csharp-testsuite` job
rekhoff May 12, 2026
283ce83
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 14, 2026
01f4b74
Support Net8 JIT "bindings" ABI and fix CLI native_aot env isolation
rekhoff May 15, 2026
e3999d9
Update lint
rekhoff May 15, 2026
2d06a3d
Moved `EXPERIMENTAL_WASM_AOT` to Override NuGet packages step
rekhoff May 16, 2026
25ceaee
Only delete `project.assets.json` for `Net8Aot`
rekhoff May 16, 2026
95f0f67
Add diagnostic for `bin_dir_name`
rekhoff May 16, 2026
b92a91c
Update lint
rekhoff May 16, 2026
202f125
Additional diagnostics
rekhoff May 16, 2026
e0961df
Fix `IL1034` entry point error and schema extraction hang
rekhoff May 18, 2026
8bb32ef
Update C# regression test targets to .NET 10
rekhoff May 18, 2026
2e3df4b
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 19, 2026
5bb5829
Revert bindings namespace and fix NativeAOT-LLVM builds
rekhoff May 19, 2026
64337ca
Add `--dotnet-version 8` to `test_quickstart_csharp` test
rekhoff May 19, 2026
27c7912
Suppress the hardcoded wasi-sdk version check in WasiApp.targets
rekhoff May 20, 2026
d7753be
Move `WasmSingleFileBundle` to the non-AOT path of Runtime.props
rekhoff May 20, 2026
92d2daa
Suppress the Mono/WasiApp.targets pipeline for AOT
rekhoff May 20, 2026
2fee8d8
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 21, 2026
fcf09c5
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 21, 2026
3221c3b
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 23, 2026
be0975d
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 26, 2026
5745f96
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 27, 2026
a680920
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 28, 2026
ea42791
Corrected merge conflict issue
rekhoff May 28, 2026
eafe0e1
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 29, 2026
7f730ad
Merge branch 'master' into rekhoff/nativeaot-net10
rekhoff May 29, 2026
4b203d1
Merge branch 'master' into rekhoff/nativeaot-net10
lisandroct Jun 12, 2026
199f167
Merge branch 'master' into rekhoff/nativeaot-net10
jdetter Jun 15, 2026
fd119d2
Merge branch 'master' into rekhoff/nativeaot-net10
lisandroct Jun 16, 2026
7523e2e
Minor cleanup
lisandroct Jun 9, 2026
5f10d9e
Fix compilation error due to uint [CallerLineNumber]
lisandroct Jun 9, 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
136 changes: 134 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,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 @@ -104,6 +124,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 @@ -124,9 +167,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 @@ -237,6 +285,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 @@ -964,7 +1031,57 @@ 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
# Reinstall wasi-experimental for .NET 10 SDK: the .NET 8 install above triggers garbage
# collection that removes the .NET 10 workload packs installed by `workload update`.
# The regression-test server targets net10.0, so we need the .NET 10 packs restored.
dotnet workload install wasi-experimental

# 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
env:
EXPERIMENTAL_WASM_AOT: 1
run: |
dotnet pack crates/bindings-csharp/BSATN.Runtime
dotnet pack crates/bindings-csharp/Runtime
Expand Down Expand Up @@ -1059,6 +1176,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
20 changes: 9 additions & 11 deletions crates/bindings-csharp/Codegen.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ public static class GeneratorSnapshotTests

record struct StepOutput(string Key, IncrementalStepRunReason Reason, object Value);

class Fixture
private class Fixture
{
private readonly string projectDir;
private readonly CSharpCompilation sampleCompilation;
public CSharpCompilation SampleCompilation { get; }

public Fixture(string projectDir, CSharpCompilation sampleCompilation)
{
this.projectDir = projectDir;
this.sampleCompilation = sampleCompilation;
SampleCompilation = sampleCompilation;
}

public CSharpCompilation SampleCompilation => sampleCompilation;

public static async Task<Fixture> Compile(string name)
{
var projectDir = Path.Combine(GetProjectDir(), "fixtures", name);
Expand Down Expand Up @@ -71,30 +69,30 @@ private async Task<IEnumerable<SyntaxTree>> RunAndCheckGenerator(
IIncrementalGenerator generator
)
{
var driver = CreateDriver(generator, sampleCompilation.LanguageVersion);
var driver = CreateDriver(generator, SampleCompilation.LanguageVersion);

// Store the new driver instance - it contains the results and the cache.
var driverAfterGen = driver.RunGenerators(sampleCompilation);
var driverAfterGen = driver.RunGenerators(SampleCompilation);
var genResult = driverAfterGen.GetRunResult();

// Verify the generated code against the snapshots.
await Verify(generator.GetType().Name, genResult);

CheckCacheWorking(sampleCompilation, driverAfterGen);
CheckCacheWorking(SampleCompilation, driverAfterGen);

return genResult.GeneratedTrees;
}

public GeneratorDriverRunResult RunGeneratorAndGetResult(IIncrementalGenerator generator)
{
var driver = CreateDriver(generator, sampleCompilation.LanguageVersion);
return driver.RunGenerators(sampleCompilation).GetRunResult();
var driver = CreateDriver(generator, SampleCompilation.LanguageVersion);
return driver.RunGenerators(SampleCompilation).GetRunResult();
}

public async Task<CSharpCompilation> RunAndCheckGenerators(
params IIncrementalGenerator[] generators
) =>
sampleCompilation.AddSyntaxTrees(
SampleCompilation.AddSyntaxTrees(
(await Task.WhenAll(generators.Select(RunAndCheckGenerator))).SelectMany(output =>
output
)
Expand Down
Loading
Loading