Repository navigation
Native AOT DataProviderMigrate release build passes again, and CI publishes it on every PR - #127
Merged
Merged
Conversation
Microsoft.Data.SqlClient is not trim or Native AOT compatible, so the native DataProviderMigrate build leaves out the SQL Server provider and reports it as unavailable; the managed dotnet tool keeps it. The SQLite generator's config reads use a source-generated JSON context so the AOT analyzers accept the assembly the migrate binary now compiles for its SQLite parser. make aot no longer writes its smoke database to /tmpdataprovider_aot_smoke.db when TMPDIR is unset, and CI runs make aot plus the native smoke tests.
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.
TLDR
Make the Native AOT
DataProviderMigraterelease build pass again, and run it on every PR so it can't silently break.What Was Added?
Migration/DataProviderMigrate/Program.SqlServer.cs: the SQL Server migrate path, compiled only in the managed build. In the native (AOT) build,--provider sqlserverprints that the provider is unavailable there and points to the manageddotnet tool.DataProvider/Nimblesite.DataProvider.SQLite/SqliteGeneratorJsonContext.cs: source-generated System.Text.Json metadata for the SQLite generator's config files.NativeAotMigrateSmokeTests.NativeBinary_SqlServerProvider_ReportsUnsupported.lint-and-dataproviderjob): installs the Linux AOT toolchain, runsmake aot(native publish + smoke migrate), and runsNativeAotMigrateSmokeTestsagainst the published binary.What Was Changed or Deleted?
v0.10.0-beta.1release failed inrelease-dotnet-binarieson all four platforms, andmainfailed the same way.Microsoft.Data.SqlClientis not trim or AOT compatible (IL2104/IL3053, including 7.1.1), and it pulledSystem.DataXML serialization andConfigurationManagerinto the native binary.Migration.SQLitenow referencesDataProvider.SQLitefor its SQLite parser. The publish passes-p:PublishAot=trueglobally, so the AOT analyzers ran on that project and rejected two reflection-basedJsonSerializer.Deserializecalls (IL2026/IL3050).DataProviderMigrate.csproj: referencesMigration.SqlServeronly whenPublishAotis not set.SqliteCodeGenerator: both config reads now useSqliteGeneratorJsonContext(case-insensitive, as before). The!operators on those lines are removed.Makefile: withTMPDIRunset (Linux, CI),make aotsmoke-tested against/tmpdataprovider_aot_smoke.db, which can't be created. It now joins the path with exactly one/.How Do The Automated Tests Prove It Works?
dotnet publish Migration/DataProviderMigrate -c Release -r linux-x64 -p:PublishAot=true -p:InvariantGlobalization=true --self-contained) now succeeds with zero warnings. Before, it failed with the IL2026/IL3050 and IL2104/IL3053 errors above.example-schema.yamlto SQLite with the native binary) passes, including the schema integrity check.make aotpasses.NativeAotMigrateSmokeTests(4/4) pass against the published binary, including the newNativeBinary_SqlServerProvider_ReportsUnsupported. CI now runs them on every PR.dotnet run --project Migration/DataProviderMigrate -- migrate --provider sqlserverreachesSqlClient(connection error against an unreachable server, not the AOT message). The in-process SQL Server CLI tests inMigration.Testspass.make fmt CHECK=1,make lintanddeslop .(14.81% against the 15% budget) pass.DataProvider.Tests(393),DataProvider.Example.Tests(194) andMigration.Tests(610, plus the 4 native smoke tests that skip without a binary) pass with their coverage gates.Spec / Doc Changes
docs/plans/dataprovider-migrate-aot.md: new[MIG-AOT-SQLSERVER]section covering the SQL Server exclusion and the[MIG-AOT-CI]PR gate.Breaking Changes
DataProviderMigratebinaries (Homebrew/Scoop/GitHub Release) do not support--provider sqlserver. Nothing regresses: no native binary has shipped yet (the AOT release workflow arrived in Fix existing-database upgrades and strengthen cross-platform toolkit CI #113 and has failed on every tag since), and 0.9.12-beta's CLI had no SQL Server migrate path. The manageddotnet tooland the NuGet packages keep full SQL Server support.