Annotate remaining AOT pillar tail in JasperFx (74 → 0 warnings)#260
Merged
Conversation
Final AOT-pillar cleanup pass for JasperFx (#213). After PRs #256–#259 closed the four largest slices (ServiceContainer, CodeGeneration/Services, Core/IoC, Core/Reflection), 74 warnings per TFM remained across the long tail. This PR brings the JasperFx project to **0 IL warnings** with `IsAotCompatible=true` enabled. Annotated reflective entry points AssemblyFinder.FindAssemblies (3 overloads) — [RUC] IJasperFxAssemblyLoadContext + impl — [RUC] AssemblyTypes(Assembly) — [RUC] TypeRepository.ForAssembly / FindTypes (3x) — [RUC] TypeQuery.Find(IEnumerable<Assembly>) — [RUC] AssemblyScanner.Start + assembly-scan APIs — [RUC] (matches IAssemblyScanner) IAssemblyScanner.AssembliesFrom* — [RUC] on interface CommandLineHostingExtensions.ApplyJasperFx* — already RUC; cascades JasperFxOptions.HasReferenceToJasperFxTool — [RUC] JasperFxOptions.DetermineCallingAssembly — [RUC] JasperFxOptions.establishApplicationAssembly — [RUC] JasperFxOptions.ReadHostEnvironment — [RUC] JasperFxServiceCollectionExtensions.AddJasperFx + CritterStackDefaults — [RUC] EnvironmentCheckExtensions (5 overloads) — [RUC] SnapshotGate.Read / SnapshotGate.Write — [RUC] + [RDC] (STJ JsonSerializer) ISystemPart.WriteToConsole — [RUC] on interface DescribeCommand.Execute — suppress + #pragma on async-state-machine WriteToConsole call CodeGeneration/Frames/MethodCall(Type,string) — [RUC] + [DAM(PublicMethods)] CodeGeneration/Frames/MethodCall.correctedReturnType — suppress IL2067 (well-known Task types) CodeGeneration/Frames/MethodCall.returnsValueTask — suppress IL2072 CodeGeneration/GeneratedAssembly.AddType — [DAM(PublicCtors|PublicMethods|NonPublicMethods)] CodeGeneration/GeneratedAssembly.AttachAssembly — [RUC] CodeGeneration/GeneratedType.CompiledType property — [DAM(PublicCtors)] CodeGeneration/GeneratedType.InheritsFrom<T>/<Type> — [DAM(PublicCtors|Methods)] CodeGeneration/GeneratedType.Implements<T>/(Type) — [DAM(PublicMethods)] CodeGeneration/GeneratedType.FindType + ApplySetterValues — [RUC]/suppress CodeGeneration/Model/Setter.SetInitialValue — [RUC] CodeGeneration/Model/Variable.VariablesForProperties<T> — [DAM(PublicProperties)] CodeGeneration/Model/Variable.DefaultArgName — suppress (cosmetic) CodeGeneration/Expressions/LambdaDefinition.Compile<TFunc> — [RUC] ServiceCollectionServerVariableSource.Matches — suppress (IVariableSource contract doesn't carry DAM) CodeGeneration/CodeGenerationExtensions.BuildExportedTypeIndex — suppress CodeGeneration/Services findFamily — re-applied IL2067 suppression (was lost in #256 + #257 merge) ServiceContainer.CouldResolve(Type) — [DAM(PublicCtors)] ServiceContainer.findFamily — re-applied IL2067 suppression (was lost in PR #256 + #257 merge resolution) Descriptors/OptionsDescription — [RUC] on ctor / For() / readProperties Descriptors/DatabaseDescriptor ctors — [RUC] (inherits OptionsDescription) CommandLine/Descriptions/ConfigurationPreview.WriteToConsole — [RUC] CommandLine/Descriptions/DescribeCommand.WriteToConsole (×2 overrides) — [RUC] CommandLine/CommandFactory.IsJasperFxCommandType — [DAM(Interfaces)] CommandLine/CommandFactory.TryRegisterFromGeneratedManifest — IL2072 suppress added Resources/ResourcesCommand.ExecuteOnEach — suppress IL3050 (Spectre WriteException on error-display path) JasperFxAssemblyAttribute ctor — [DAM(PublicCtors|NonPublicCtors)] Effect on the punch list Before: JasperFx total per TFM 74 warnings After: JasperFx total per TFM 0 warnings Cumulative since #213 flag-flip (PR #247): 236 (initial fallout) → 0 (all addressed) Note on JasperFx.Events The propagation of new annotations into the JasperFx.Events compilation surfaces ~246 warnings per TFM that aren't addressed here. That deserves its own focused PR + likely an issue under #213. Verification CoreTests 407/407 pass on net9.0 + net10.0 CommandLineTests 280/280 pass on net9.0 + net10.0 CodegenTests 366/366 pass on net9.0 + net10.0 SmokeTestAot build clean, exits 0 Closes (most) the AOT pillar #213 for JasperFx itself. Events follow-up deferred to a separate PR.
This was referenced May 13, 2026
Closed
Closed
thechucklingatom
pushed a commit
to thechucklingatom/jasperfx
that referenced
this pull request
May 19, 2026
Carries the AOT pillar tail cleanup (JasperFx#213) that landed in JasperFx#260, closing the remaining 74 IL warnings per TFM in JasperFx itself. With this release, JasperFx + JasperFx.Events compile clean under IsAotCompatible=true — downstream consumers (Marten 9, Wolverine 6, Polecat 4, Weasel 9) can adopt the new alphas and see the propagated annotations on JasperFx surfaces (TypeScanning, Hosting, Snapshots, CodeGeneration model + frames, OptionsDescription, etc.). JasperFx.Events itself didn't get direct changes, but the lockstep bump ensures consumers picking up alpha.12 also get the matching Events alpha. Per-area annotation work in JasperFx.Events deserves its own follow-up PR (~246 cascaded warnings as of JasperFx#260); will be filed as a tracking issue once this release ships. NugetPush is SkipDuplicate; other packages (RuntimeCompiler, SourceGeneration, Events.SourceGenerator) keep their current versions — nothing changed in those projects this cycle.
thechucklingatom
pushed a commit
to thechucklingatom/jasperfx
that referenced
this pull request
May 19, 2026
…lice 1/4) First of four slices that mirror the JasperFx-side cleanup pattern (JasperFx#252-JasperFx#255 + JasperFx#260) on the JasperFx.Events side, tracked by JasperFx#262. The aggregator graph (AggregateApplication and friends) reflects TAggregate / TProjection to discover Create/Apply/ShouldDelete handlers, builds delegates via Expression.Call + FastExpressionCompiler.CompileFast, and threads event types via IEvent<T>.MakeGenericType. Both aggregate and event types are preserved at the registered projection boundary (caller-side generic parameters that trimming sees). AOT consumers should rely on the source-generated evolver from JasperFx.Events.SourceGenerator per the AOT publishing guide. Apply class-level [UnconditionalSuppressMessage] with justifications: - Aggregation/AggregateApplication (primary partial — covers Register/ Creating/Applies/ShouldDelete): IL2026/IL2070/IL2072/IL2075/IL2077/ IL2087/IL2090/IL3050 - Aggregation/JasperFxAggregationProjectionBase: IL2065/IL2067/IL2070/ IL2072/IL2075/IL2090 - Aggregation/JasperFxMultiStreamProjectionBase: IL2026/IL2087 - Aggregation/CreateMethodCollection: IL2070/IL2072/IL3050 - Aggregation/ApplyMethodCollection: IL3050 - Aggregation/AggregateVersioning<T> + <T,TQuerySession>: IL2026/IL2090 240 → 130 unique IL warnings (-110) in JasperFx.Events.csproj. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Final AOT-pillar cleanup pass for JasperFx (#213). After PRs #256–#259 closed the four largest slices (
ServiceContainer,CodeGeneration/Services,Core/IoC,Core/Reflection), 74 warnings per TFM remained across the long tail. This PR brings the JasperFx project to 0 IL warnings withIsAotCompatible=trueenabled.Effect
Areas annotated
The tail spans the parts of JasperFx that weren't large enough to deserve dedicated per-area issues but still needed annotation work to close out the pillar:
Core/TypeScanningAssemblyFinder.FindAssemblies(×3),IJasperFxAssemblyLoadContext+ impl,AssemblyTypes(Assembly),TypeRepository.ForAssembly,TypeRepository.FindTypes(×3),TypeQuery.FindCore/IoCAssemblyScanner.Start+ assembly-scan APIs; matchingIAssemblyScanner.AssembliesFrom*annotationsJasperFxOptions.HasReferenceToJasperFxTool,DetermineCallingAssembly,establishApplicationAssembly,ReadHostEnvironment;JasperFxServiceCollectionExtensions.AddJasperFx+CritterStackDefaults;EnvironmentCheckExtensions(5 overloads)CodeGeneration/Snapshots/SnapshotGateRead/Writeannotated[RequiresUnreferencedCode]+[RequiresDynamicCode]for STJ usageCodeGeneration/Frames/MethodCallMethodCall(Type, string)ctor annotated,correctedReturnType/returnsValueTasksuppress for well-known Task typesCodeGeneration/GeneratedAssembly+GeneratedTypeAddType,AttachAssembly,CompiledTypeproperty,InheritsFrom<T>/<Type>,Implements<T>/(Type),FindType,ApplySetterValuesCodeGeneration/ModelSetter.SetInitialValue,Variable.VariablesForProperties<T>,Variable.DefaultArgNameCodeGeneration/ExpressionsLambdaDefinition.Compile<TFunc>CodeGeneration/ServicesServiceCollectionServerVariableSource.Matchessuppress (IVariableSource contract doesn't carry DAM)DescriptorsOptionsDescriptionctor /For()/readProperties;DatabaseDescriptorctorsCommandLine/DescriptionsISystemPart.WriteToConsoleannotated on interface; overrides inConfigurationPreview,DescribeCommand(×2)CommandLineCommandFactory.IsJasperFxCommandTypeDAM,TryRegisterFromGeneratedManifestIL2072 suppress;DescribeCommand.Executepragma overWriteToConsoleasync callResourcesResourcesCommand.ExecuteOnEachsuppress IL3050 (Spectre on error-display path)JasperFxAssemblyAttributeServiceContainerCouldResolve(Type)DAM; re-applied IL2067 suppression onfindFamilythat was lost in the #256 + #257 merge resolutionNote on JasperFx.Events propagation
This PR brings the JasperFx project itself to 0 warnings. The annotations propagate into
JasperFx.Events, which now surfaces ~246 warnings per TFM that weren't there before. That deserves its own focused PR + likely an issue under #213 — not included here to keep this review-able.Verification
CoreTests— 407/407 pass on net9.0 + net10.0CommandLineTests— 280/280 pass on net9.0 + net10.0CodegenTests— 366/366 pass on net9.0 + net10.0SmokeTestAot— build clean, exits 0This (mostly) closes the AOT pillar #213 for JasperFx itself. Events follow-up is queued.
🤖 Generated with Claude Code