-
Notifications
You must be signed in to change notification settings - Fork 466
.NET 10 NativeAOT migration #1953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6633447
Retarget managed projects to .NET 10 with NativeAOT
tyrielv f2df404
Replace System.Reflection.Assembly usage for NativeAOT
tyrielv c5b7ca7
Replace changed .NET 10 APIs
tyrielv bb78760
Replace System.Management WMI with kernel32 P/Invoke
tyrielv c36bc23
Guard against null triggeringProcessImageFileName from ProjFS
tyrielv 97fa1e1
Replace HTTP stack for .NET 10
tyrielv 33d3b95
Add source-generated JSON serialization for NativeAOT
tyrielv 62c5c6c
Adapt functional tests for .NET 10 ProjFS behavioral changes
tyrielv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add source-generated JSON serialization for NativeAOT
NativeAOT cannot use runtime reflection for JSON serialization. GVFSJsonContext provides source-generated System.Text.Json serializers for 25+ types used in named pipe messages and configuration. GVFSJsonOptions chains source-gen (primary) with reflection fallback for types not yet in the context, allowing incremental migration. NamedPipeMessages: add parameterless constructors required by the source generator's deserialization codegen. RepoRegistration: add ServiceJsonContext source generator in GVFS.Service for types that cannot be registered in GVFSJsonContext (GVFS.Common) due to assembly dependency direction. Co-authored-by: Michael Niksa <miniksa@microsoft.com> Assisted-by: Claude Opus 4.6 Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
- Loading branch information
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| using GVFS.Common.Http; | ||
| using GVFS.Common.NamedPipes; | ||
| using GVFS.Common.Tracing; | ||
| using GVFS.Common.Prefetch; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text.Json; | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace GVFS.Common | ||
| { | ||
| /// <summary> | ||
| /// Source-generated JSON serializer context for all types used in GVFS serialization. | ||
| /// This enables trim-safe and AOT-compatible JSON serialization without reflection. | ||
| /// </summary> | ||
| [JsonSourceGenerationOptions( | ||
| PropertyNameCaseInsensitive = true, | ||
| DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, | ||
| Converters = new[] { typeof(VersionConverter) })] | ||
| [JsonSerializable(typeof(string))] | ||
| [JsonSerializable(typeof(Dictionary<string, string>))] | ||
| [JsonSerializable(typeof(KeyValuePair<string, string>))] | ||
| [JsonSerializable(typeof(List<string>))] | ||
| [JsonSerializable(typeof(List<GitObjectsHttpRequestor.GitObjectSize>))] | ||
| [JsonSerializable(typeof(ServerGVFSConfig))] | ||
| [JsonSerializable(typeof(VersionResponse))] | ||
| [JsonSerializable(typeof(InternalVerbParameters))] | ||
| [JsonSerializable(typeof(CacheServerInfo))] | ||
| [JsonSerializable(typeof(NamedPipeMessages.GetStatus.Response), TypeInfoPropertyName = "GetStatusResponse")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.DehydrateFolders.Request), TypeInfoPropertyName = "DehydrateFoldersRequest")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.DehydrateFolders.Response), TypeInfoPropertyName = "DehydrateFoldersResponse")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.Notification.Request), TypeInfoPropertyName = "NotificationRequest")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.UnregisterRepoRequest))] | ||
| [JsonSerializable(typeof(NamedPipeMessages.UnregisterRepoRequest.Response), TypeInfoPropertyName = "UnregisterRepoResponse")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.RegisterRepoRequest))] | ||
| [JsonSerializable(typeof(NamedPipeMessages.RegisterRepoRequest.Response), TypeInfoPropertyName = "RegisterRepoResponse")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.EnableAndAttachProjFSRequest))] | ||
| [JsonSerializable(typeof(NamedPipeMessages.EnableAndAttachProjFSRequest.Response), TypeInfoPropertyName = "EnableAndAttachProjFSResponse")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.GetActiveRepoListRequest))] | ||
| [JsonSerializable(typeof(NamedPipeMessages.GetActiveRepoListRequest.Response), TypeInfoPropertyName = "GetActiveRepoListResponse")] | ||
| [JsonSerializable(typeof(NamedPipeMessages.BaseResponse<string>))] | ||
| [JsonSerializable(typeof(TelemetryDaemonEventListener.PipeMessage))] | ||
| [JsonSerializable(typeof(PrettyConsoleEventListener.ConsoleOutputPayload))] | ||
| internal partial class GVFSJsonContext : JsonSerializerContext | ||
| { | ||
| } | ||
| } |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using System.Text.Json.Serialization; | ||
|
|
||
| namespace GVFS.Service | ||
| { | ||
| /// <summary> | ||
| /// Source-generated JSON context for GVFS.Service types that cannot be registered | ||
| /// in GVFSJsonContext (GVFS.Common) due to assembly dependency direction. | ||
| /// Required for native AOT where the DefaultJsonTypeInfoResolver reflection | ||
| /// fallback is not available. | ||
| /// </summary> | ||
| [JsonSerializable(typeof(RepoRegistration))] | ||
| internal partial class ServiceJsonContext : JsonSerializerContext | ||
| { | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| using System.Text.Json.Serialization; | ||
| using GVFS.Virtualization.Background; | ||
|
|
||
| namespace GVFS.Virtualization | ||
| { | ||
| [JsonSerializable(typeof(FileSystemTask))] | ||
| internal partial class VirtualizationJsonContext : JsonSerializerContext | ||
| { | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.