Repository navigation
build: retarget main to .NET 11 for 11.0.0-preview.1 - #292
Merged
Merged
Conversation
The 11 line opens on main, as CONTRIBUTING's "At the v10.0.0 tag" says: net11.0 in the four shipping projects and every test project, EF Core 11 RC1 (the version Npgsql.EntityFrameworkCore.PostgreSQL 11.0.0-rc.1.1 pins exactly) and the Npgsql EF 11 RC, the ASP.NET and Extensions packages at RC2, the SDK at 11.0.100-rc.2 in global.json and 11.0.x in the release workflow's publish job. Version moves to 11.0.0-preview.1, PackageValidationBaselineVersion to 10.0.0, SECURITY.md's row to 10.0.x, and the five changelogs get their preview section. All four packages target net11.0, one TFM per line. Package validation cannot pair a net11.0 asset with the net10.0 baseline (PKV006 and no member comparison), so Directory.Build.props ignores the baseline's framework with the reason, and a dotnet apicompat run over the four 10.0.0 assemblies against this build found no breaking changes; the mechanical gate returns when 11.0.0 is the baseline. EFCore.ComplexIndexes.PostgreSQL has no 11 preview yet (5.4.1 pins Npgsql EF to [10.0.0, 11.0.0)), so ComplexIndexesCrossTests and the fourth smoke consumer are conditioned on net10.0 until CaffeinatedCoder/EFCore.ComplexIndexes#38 and #42. The four behaviour changes #103 measured are held by EfCore11RetargetTests (integration) and EfCore11ShapeTests (translation): EF Core writes a null JSON property itself (HandlesNullWrites stays false); RuntimeConstantExpression is created after translation, so the variant-typed constant still reaches the retyper; NULLIF, which EF Core 11 writes for `a == b ? null : a`, gets its own arm in ValueSetSqlGuard and is refused as equality; Npgsql 11's compatibility target 16 leaves the timerange and multirange SQL unchanged. Five more changes the first test run found, each with its issue: - #286: .NET 11 reads an hour of 24 (24:00:00 as midnight, T24:00:00 as the next day) where .NET 10 refused it; IsoTemporal refuses it on both platforms. - #287: EF Core 11 rewrites every Contains on an IReadOnlyCollection into Queryable.Contains over the element type and threw ArgumentException for RangeSet.Contains(T) and Contains(RangeSet); the interceptor hands the three overloads over as static RangeSetContains calls, which translate to @> as before. The same change reaches EF Core 10 in a patch after 10.0.13 (#288). - #289: Npgsql 11 writes a JSON setter that may be null through jsonb_set_lax, which the guard did not match (the refusal lost its path), and writes the null outcome as JSON null, so the "whole document" reason is gone from the messages. - #290: EF Core 11 replaces an empty VALUES parameter with a SELECT of bare NULLs, which PostgreSQL types as text ("operator does not exist: text && int4range"); EmptyCollectionRewriter now casts those NULLs to the column's type instead of rewriting a VALUES it no longer sees. - #291: under Native AOT with ILCompiler 11 RC2, every set type's ToString trapped (SIGTRAP) in the instantiating stub of IValueSetFactory's default IFormattable.ToString; every set type implements IFormattable itself now. Reported upstream as dotnet/runtime#136073. Each fix was proved by reverting it and watching its test fail. The two oracle seeds that patch the interceptor are refreshed against the new composition. Closes #103 Closes #286 Closes #287 Closes #289 Closes #290 Closes #291 Found-By: OT Found-By: SM Defect-Class: LIT Defect-Class: SQL Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 19, 2026
Closed
This was referenced Oct 19, 2026
CaffeinatedCoder
added a commit
that referenced
this pull request
Oct 19, 2026
… .NET 11 SDK does not trap ILCompiler 11 RC2 compiles the instantiating stub for the default IFormattable.ToString of IValueSetFactory<TSet, T> to a trap, and every set type's ToString() ran through that default, so a net11.0 Native AOT consumer of the released 10.0.0 packages ended with SIGTRAP (exit 133, nothing on stderr) on the first value set ToString. #299 is the 10.x issue; #291 measured it on the 11 line, against the unchanged 10.0.0 package too, and reported it upstream as dotnet/runtime#136073. Every set type - the twelve core families and their wrapper arities, and the five NodaTime families - implements IFormattable.ToString explicitly as SetFormat.Format<TSet, T>(this, format, provider), and its ToString() calls SetFormat.Format directly, so the interface's default is never the implementation a compiled consumer runs. The interface keeps its default. Explicit interface implementations leave the public surface unchanged, and the ApiCompat baseline against 10.0.0 passes in dotnet pack. The change is the one PR #292 made on main; #292 is one commit (231f23a) holding the whole .NET 11 retarget, so this is a hand-extracted commit naming it rather than a cherry-pick -x. The clone sweep (tools/oracles.cs clones) reports no new divergence: every family changed the same way. test/consumer-smoke-test.sh gains SMOKE_AOT_SDK, which pins the AOT consumer to an installed .NET SDK through a global.json written beside it before dotnet new, and targets that SDK's framework, so the publish runs that SDK's ILCompiler over the net10.0 packages. The header says how to run it with a .NET 11 SDK installed beside the .NET 10 one the repository's global.json needs. The AOT leg now also fails on a non-zero exit of the native binary, and one case prints every value set family's ToString. Measured with SDK 11.0.100-rc.2.26504.105 on osx-arm64: against a pack of the branch without this change (48b9651) the native binary exited with 133 after printing aot-float64set, where #291 saw it stop; with this change it runs to the end, the new case prints all seventeen families, and the smoke test passes. The .NET 10 SDK run, which is what CI does, is unchanged and green. Issue #299, fixed on release/10.x only; closed by hand after the merge, since a closing keyword acts only on main. Found-By: SM Defect-Class: PKG Co-Authored-By: Claude Fable 5.1 <[email protected]>
CaffeinatedCoder
added a commit
that referenced
this pull request
Oct 19, 2026
IsoTemporal handed element text to TimeOnly.TryParseExact, DateTime.TryParseExact and
DateTimeOffset.TryParseExact. .NET 11 accepts an hour of 24 there where .NET 10 refuses
it, and this net10.0 assembly runs on the .NET 11 runtime inside a net11.0 application,
so the released 10.0.0 read `{24:00:00}` as `{00:00:00}` and `T24:00:00` as the next
day's midnight there, silently, while throwing FormatException on .NET 10.
IsoTemporal now refuses an hour of 24 before the BCL parse, for a time, a DateTime and
a DateTimeOffset, so a literal means the same on every runtime. Ported by hand from
PR #292 (231f23a, the #286 fix on main), with the TemporalLiteralGrammarTests rows
`24:00`, `24:00:00.0`, `T24:00:00`, ` 24:00`, `T24:00:00Z` and ` 24:00:00+05:30:00`.
Proved on the .NET 11.0.0-rc.2 runtime, the net10.0 test assembly run under
vstest.console with --roll-forward Major: without the fix Time_Rejects("24:00:00") and
the six new rows fail (7 of 115); with it all 115 pass, and the whole core project
passes on .NET 10.0.13 and 11.0.0-rc.2 alike. On .NET 10 the rows pass both ways.
A silent fix, so 10.1.0 is a minor: the root and core changelogs open the 10.1.0
section with "Changed answers", one row linking #300 and the new "Changed answers in
10.1.0" section of docs/migration.md, which says how to find the text whose reading
changed. docs/serialization.md's grammar list names the rule.
Found-By: OT
Defect-Class: LIT
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 19, 2026
fix: implement IFormattable on every value set so Native AOT with the .NET 11 SDK does not trap
#309
Merged
Merged
CaffeinatedCoder
added a commit
that referenced
this pull request
Oct 19, 2026
… read-only collection The EF Core 10 patch that carries dotnet/efcore#37081 (dotnet/efcore#39114, milestone 10.0.15) makes QueryableMethodNormalizingExpressionVisitor rewrite every one-argument method named Contains on an IReadOnlyCollection<T> into Queryable.Contains over the collection's element type, before any translator runs. RangeSet<TRange, T> is an IReadOnlyList<TRange> whose Contains overloads take a T, an IRange<T> or a RangeSet, so on that patch every RangeSet.Contains in a query threw ArgumentException inside EF Core. EF Core 10.0.0 through 10.0.13 rewrite only ICollection<T>, which is why the floor this repository's CI pins never saw it (#297); Npgsql EF 10.0.1-10.0.3 require EF Core >= 10.0.4, so a consumer reaches the patch with a plain restore. Reported upstream as dotnet/efcore#39329. The query interceptor now turns the three instance overloads into static methods on RangeSetContains, a declaring type that is not a collection and that EF Core's rewrite therefore leaves alone, and ValueRangesMethodCallTranslator translates that form to @> exactly as the instance call. Each static method calls the instance method it stands for, so a client-evaluated call answers as the set does. Public API unchanged. This is the fix PR #292 made on main for the 11 line (#287), ported by hand: #292 is one commit holding the whole .NET 11 retarget, so there is no commit to cherry-pick. No published EF Core 10 patch carries the change yet (the dnceng dotnet10 feed answers but lists no 10.0.x servicing build), so the proof is the query tree rather than the SQL. RangeSetContainsShapeTests and NodaRangeSetContainsShapeTests read the query as the interceptor hands it over (InterceptedQuery, through the logger call QueryCompilationContext makes) and assert that no instance Contains whose declaring type implements IReadOnlyCollection<> survives, that exactly one RangeSetContains call stands in its place, and that the SQL is still @>, for the three overloads on the BCL date and integer sets and on the NodaTime LocalDate, Instant and YearMonth sets. With the rewrite stripped from the interceptor the 5 and 8 tree tests fail and every @> SQL test still passes, on EF Core 10.0.0 and with the test hosts floated to EF Core 10.0.13 / Npgsql EF 10.0.3, which is exactly why the SQL tests could not see the defect. With it, 295/295 and 91/91 translation tests pass on both, and 280 + 4 integration tests pass on PostgreSQL 16. The two CompareTo seeds under test/oracles/seeds that diff the interceptor's chain and remarks are refreshed to the new context, as #292 did on main. The changelog line names the patch and the stopgap AppContext.SetSwitch("Microsoft.EntityFrameworkCore.Issue37081", true), whose cost is EF Core's own fix for IReadOnlySet parameters. Issue #288, fixed on release/10.x only (main has #287 through #292); closed by hand after the merge, since a closing keyword acts only on main. Found-By: OT Defect-Class: SQL Co-Authored-By: Claude Fable 5.1 <[email protected]>
This was referenced Oct 19, 2026
This was referenced Nov 11, 2026
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 CaffeinatedCoder/EFCore.ComplexIndexes#103, closes #286, closes #287, closes #289, closes #290, closes #291.
Problem
v10.0.0is tagged andrelease/10.xis cut, somainis the 11 line (CONTRIBUTING, "At thev10.0.0tag"), still sayingVersion10.0.0 onnet10.0.Change
net11.0in the four shipping projects and every test project;Npgsql.EntityFrameworkCore.PostgreSQL11.0.0-rc.1.1 (which pins EF Core to 11.0.0-rc.1 exactly, so EF Core 11 RC1 rather than RC2); ASP.NET and Extensions packages at RC2;global.jsonat the RC2 SDK; the release workflow's publish job at 11.0.x preview. All four packages targetnet11.0, one TFM per line (the core-TFM decision Check the EF Core major in the differ and generator constructors EFCore.ComplexIndexes#103 asked for; recorded in the changelog's platform line).Version11.0.0-preview.1,PackageValidationBaselineVersion10.0.0, SECURITY.md's row 10.0.x,## [11.0.0-preview.1]in the five changelogs (dated 2026-10-19; the tag commit sets the real date), README/docs/AGENTS/CONTRIBUTING moved to .NET 11.net11.0asset cannot be paired with thenet10.0baseline (PKV006, and no member comparison runs).Directory.Build.propsignores the baseline's framework with the reason; CONTRIBUTING says the mechanical gate returns when 11.0.0 is the baseline. Adotnet apicompatrun over the four 10.0.0 assemblies against this build: no breaking changes in any package.[10.0.0, 11.0.0), SchemaKit 11.0.0-preview.1: the first slice of the new API, on EF Core 11 / Npgsql 11 under the new ids CodoMetis.EFCore.SchemaKit#2 open), soComplexIndexesCrossTestsand the fourth smoke consumer are conditioned onnet10.0as Check the EF Core major in the differ and generator constructors EFCore.ComplexIndexes#103 describes; its Cross-tests with CodoMetis.ValueRanges: range and multirange columns as exclusion-constraint operands CodoMetis.EFCore.SchemaKit#4 turns them back on.EfCore11RetargetTests(integration, PostgreSQL 16 and 18) andEfCore11ShapeTests(translation): null JSON properties written by EF Core itself;RuntimeConstantExpressioncreated after translation, so the retyper still sees a constant;NULLIFrefused as equality by a new guard arm; compatibility target 16 leavestimerange/multirange SQL byte-identical to target 14.24:00:00parses as00:00:00andT24:00:00as the next day #286 .NET 11 reads hour 24 (IsoTemporalrefuses it on both platforms); EF Core 11 rewritesRangeSet.ContainsintoQueryable.Containsover the range type and throwsArgumentException#287 EF Core 11 rewritesRangeSet.ContainsintoQueryable.Containsand throws (RangeSetContainsstatic form via the interceptor; the 10.x line meets the same EF Core 10 patch, 10.x:RangeSet.ContainsthrowsArgumentExceptionon the EF Core 10 patch that carries dotnet/efcore#37081 #288); Npgsql 11 writes JSON setters throughjsonb_set_lax: the value set refusal names the column instead of the path, and a reason that no longer applies #289 Npgsql 11 writes JSON setters throughjsonb_set_lax(guard matches it; the "whole document" reason is gone, the null outcome is now JSON null); EF Core 11 reads an empty captured collection as a bare NULL that PostgreSQL types astext:operator does not exist: text && int4range#290 EF Core 11 replaces an emptyVALUESwith bareNULLs that PostgreSQL types astext(EmptyCollectionRewritercasts them); Native AOT on .NET 11 RC2: every value setToStringtraps (SIGTRAP) in the defaultIFormattable.ToStringofIValueSetFactory<TSet, T>#291 Native AOT on ILCompiler 11 RC2 traps in the set types' defaultIFormattable.ToString(every set type implements it itself; upstream NativeAOT (.NET 11 RC2, osx-arm64): SIGTRAP in the instantiating stub of a default interface IFormattable.ToString on a shared-generic interface dotnet/runtime#136073).Tests
test/consumer-smoke-test.shagainst the packed feed with the .NET 11 SDK, including the Native AOT consumer: passes (the ComplexIndexes consumer skips with its reason).RangeSet_Contains_*,NullIf_OverAServerSideUnion_IsRefusedAsEquality,ExecuteUpdateGuardTestsand the empty-collection SQL each fail with the fix stripped and pass with it; the AOT leg stops ataot-float64set-wrapper-readwithout theIFormattableimplementations.OracleSeedTestspasses.🤖 Generated with Claude Code