Skip to content

Enable --native-aot flag during spacetime init and spacetime publish for NativeAOT-LLVM support#4672

Merged
rekhoff merged 22 commits into
tyler/update-nativeaot-llvm-infrastructurefrom
rekhoff/update-nativeaot-llvm-infrastructure
Apr 20, 2026
Merged

Enable --native-aot flag during spacetime init and spacetime publish for NativeAOT-LLVM support#4672
rekhoff merged 22 commits into
tyler/update-nativeaot-llvm-infrastructurefrom
rekhoff/update-nativeaot-llvm-infrastructure

Conversation

@rekhoff
Copy link
Copy Markdown
Contributor

@rekhoff rekhoff commented Mar 19, 2026

Description of Changes

Adds --native-aot flag to spacetime init command for creating NativeAOT-LLVM enabled C# projects. This automatically adds the required LLVM package references to the generated .csproj file and sets "native-aot": true in spacetime.json.

This also adds --native-aot flag to spacetime publish. This is optional because the developer will still need to add the required LLVM package references to their .csproj file, and the provided instructions also include adding "native-aot": true to their spacetime.json which 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

  • Verified spacetime init --lang csharp --native-aot creates projects with required LLVM package references
  • Confirmed spacetime.json is generated with "native-aot": true
  • Tested publish command works with both --native-aot flag and spacetime.json configuration

@rekhoff rekhoff self-assigned this Mar 19, 2026
@rekhoff rekhoff marked this pull request as ready for review March 19, 2026 18:55
Copy link
Copy Markdown
Contributor

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/cli/src/subcommands/init.rs Outdated
rekhoff and others added 16 commits March 25, 2026 12:13
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Signed-off-by: Ryan <r.ekhoff@clockworklabs.io>
…ables

`NativeAOT-LLVM` IL scanner fails to compute `vtables` for `TaggedEnum<T>`
types when they're only referenced indirectly (e.g., through generated
`Equals` methods). This caused publish failures for modules with no tables
having indexes/primary keys.

Fix: Add type rooting in `Module.__describe_module__` to ensure all
`TaggedEnum` subtypes are processed by the IL scanner.
Copy link
Copy Markdown
Contributor

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few things for now, I'm going to test against a new system to see what we get

Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md Outdated
Comment thread crates/bindings-csharp/NATIVEAOT-LLVM.md
Copy link
Copy Markdown
Contributor

@jdetter jdetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, working. Code looks good as well, thanks for all of the help getting the testing working on this Ryan 🙏

@rekhoff rekhoff merged commit 5893f67 into tyler/update-nativeaot-llvm-infrastructure Apr 20, 2026
51 of 57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants