Enable --native-aot flag during spacetime init and spacetime publish for NativeAOT-LLVM support#4672
Open
rekhoff wants to merge 5 commits intotyler/update-nativeaot-llvm-infrastructurefrom
Conversation
jdetter
reviewed
Mar 25, 2026
Collaborator
jdetter
left a comment
There was a problem hiding this comment.
Just a few things for now - I ran into the issue that I DM'd you about so I'll do another review pass later today
| ### Prerequisites: | ||
| NativeAOT-LLVM compiles C# modules to native WebAssembly (WASM) instead of using the Mono runtime. | ||
|
|
||
| This is currently only supported for Windows server modules and is experimental. Please test your modules throughly. |
Collaborator
There was a problem hiding this comment.
I would change this to use a warning block, and just let users know that they need to use windows for this. It seems to me that this doesn't really impose any new risk to users so I would probably omit the second sentence unless you've seen something in testing that makes you think this is risky.
Suggested change
| This is currently only supported for Windows server modules and is experimental. Please test your modules throughly. | |
| > [!WARNING] | |
| > This is currently only supported for Windows server modules and is experimental. |
Comment on lines
+58
to
+59
|
|
||
| ### Manual Configuration |
Collaborator
There was a problem hiding this comment.
I think this is a redundant header, no?
Suggested change
| ### Manual Configuration |
| // Print warning about Windows-only support | ||
| println!( | ||
| "{}", | ||
| "Note: NativeAOT-LLVM is experimental and currently only supported for Windows server modules.".yellow() |
Collaborator
There was a problem hiding this comment.
Suggested change
| "Note: NativeAOT-LLVM is experimental and currently only supported for Windows server modules.".yellow() | |
| "Note: NativeAOT-LLVM is experimental and building for this platform is currently only supported on Windows.".yellow() |
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.
Description of Changes
Adds
--native-aotflag tospacetime initcommand for creating NativeAOT-LLVM enabled C# projects. This automatically adds the required LLVM package references to the generated.csprojfile and sets"native-aot": trueinspacetime.json.This also adds
--native-aotflag tospacetime publish. This is optional because the developer will still need to add the required LLVM package references to their.csprojfile, and the provided instructions also include adding"native-aot": trueto theirspacetime.jsonwhich will already apply the flag.API and ABI breaking changes
None.
Expected complexity level and risk
1 (Low). Adds new optional flag to init command and post-processing of generated .csproj files.
Testing
spacetime init --lang csharp --native-aotcreates projects with required LLVM package referencesspacetime.jsonis generated with"native-aot": true--native-aotflag andspacetime.jsonconfiguration