Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Windows native packages break formatting in released IDE plugins, while publishing retry failures and YAML configuration regressions also remain unresolved.
4 open issues
What changed in this PR
Implements NativeAOT support to reduce CSharpier’s startup cost, addressing #474’s single-file formatting performance goal while retaining managed builds.
Changes:
- Replaces reflection-based serialization with AOT-compatible JSON contexts and explicit YAML parsing.
- Adds native executable process tests and managed/native output comparisons.
- Introduces runtime-specific tool packaging, release automation, and rollout documentation.
| File | Description |
|---|---|
| Src/CSharpierProcess.Tests/ServerTests.cs | Supports testing a native server executable. |
| Src/CSharpierProcess.Tests/CSharpierExecutable.cs | Centralizes managed/native executable selection. |
| Src/CSharpierProcess.Tests/CliTests.cs | Adds compatibility scenarios and executable selection. |
| Src/CSharpier.Tests/Cli/Options/CSharpierConfigParserTests.cs | Expands YAML and JSON configuration coverage. |
| Src/CSharpier.Tests/Cli/FormattingCacheTests.cs | Checks cache-key serialization compatibility. |
| Src/CSharpier.MsBuild/CSharpier.MsBuild.csproj | Excludes runtime-specific outputs from managed packaging. |
| Src/CSharpier.Core/Xml/RawNodeSyntaxWriter.cs | Uses source-generated XML-node serialization. |
| Src/CSharpier.Core/Xml/RawNode.cs | Uses an AOT-compatible enum converter. |
| Src/CSharpier.Core/DebugLogger.cs | Removes reflection-based object logging. |
| Src/CSharpier.Core/CSharpier.Core.csproj | Enables AOT compatibility checks for supported targets. |
| Src/CSharpier.Core/CSharp/CSharpFormatter.cs | Uses JSON nodes for syntax-tree output. |
| Src/CSharpier.Cli/Server/ServerFormatter.cs | Uses generated request and response serialization. |
| Src/CSharpier.Cli/Server/FormatFileResult.cs | Uses an AOT-compatible status converter. |
| Src/CSharpier.Cli/Options/CSharpierConfigParser.cs | Adds explicit YAML mapping and generated JSON parsing. |
| Src/CSharpier.Cli/Options/ConfigurationFileOptions.cs | Makes configuration properties writable for serialization. |
| Src/CSharpier.Cli/FormattingCache.cs | Uses generated cache serialization. |
| Src/CSharpier.Cli/CSharpier.Cli.csproj | Enables native publishing and runtime-specific packages. |
| Src/CSharpier.Cli/CliJsonContext.cs | Defines generated CLI and configuration JSON contexts. |
| Scripts/CompareManagedAndNative.ps1 | Compares managed/native formatting results and output. |
| openspec/changes/native-aot-tool/tasks.md | Tracks implementation and rollout tasks. |
| openspec/changes/native-aot-tool/specs/native-aot-distribution/spec.md | Defines distribution and compatibility requirements. |
| openspec/changes/native-aot-tool/proposal.md | Describes motivation, scope, and impact. |
| openspec/changes/native-aot-tool/design.md | Records design decisions, benchmarks, and rollout constraints. |
| openspec/changes/native-aot-tool/.openspec.yaml | Adds change metadata. |
| .github/workflows/ValidatePullRequest.yml | Adds native publishing and compatibility validation. |
| .github/workflows/publish_nuget.yml | Adds multi-platform packaging and coordinated publication. |
Review effort: Balanced
| runs-on: ubuntu-latest | ||
| name: publish nuget | ||
| needs: test | ||
| needs: [ test, check-version, pack-native, pack-pointer ] |
Comment on lines
+98
to
+103
| var overrides = new List<Override>(); | ||
| if (FindValue(root, "overrides") is YamlSequenceNode overrideNodes) | ||
| { | ||
| foreach (var overrideNode in overrideNodes.OfType<YamlMappingNode>()) | ||
| { | ||
| overrides.Add( |
Comment on lines
+200
to
+204
| return bool.TryParse(value, out var result) | ||
| ? result | ||
| : throw new InvalidOperationException( | ||
| $"The value '{value}' for '{key}' is not a valid boolean." | ||
| ); |
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.


closes #474