Update NativeAOT-LLVM infrastructure to current ABI#4515
Open
cloutiertyler wants to merge 1 commit intomasterfrom
Open
Update NativeAOT-LLVM infrastructure to current ABI#4515cloutiertyler wants to merge 1 commit intomasterfrom
cloutiertyler wants to merge 1 commit intomasterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EXPERIMENTAL_WASM_AOT=1) to include all host function imports from ABI versions 10.0 through 10.4Context
See #4514 for the full writeup on the C# AOT situation. The
wasi-experimentalworkload that all C# module builds depend on is deprecated and removed from .NET 9+. NativeAOT-LLVM is the recommended path forward for ahead-of-time compilation of C# to WebAssembly.The existing NativeAOT-LLVM support (added by RReverser in #713) was stale: missing imports added since then and a Windows-only package reference.
Changes
SpacetimeDB.Runtime.targets:WasmImportdeclarations across spacetime_10.0 through 10.4runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVMwithruntime.$(NETCoreSdkPortableRuntimeIdentifier).Microsoft.DotNet.ILCompiler.LLVMso it resolves correctly on Linux x64 as well$(SpacetimeNamespace)variableci.yml:csharp-testsuitejobTest plan
EXPERIMENTAL_WASM_AOT=1 dotnet publish -c Releasebuilds successfully on Linux x64