Remove OS-Specific Builds - #4474
Conversation
There was a problem hiding this comment.
Pull request overview
This draft PR removes the OS-specific build dimension (Unix vs Windows) from SqlClient’s build and test infrastructure, while preserving the existing NuGet package layout via a temporary “same binaries for all OSes” approach.
Changes:
- Consolidates
build.projand Kerberos CI steps to use a singleBuildSqlClienttarget instead of per-OS build targets. - Updates SqlClient output and packing layout (notably
Microsoft.Data.SqlClient.csprojOutputPathandMicrosoft.Data.SqlClient.nuspec) to no longer include OS-qualified artifact folders. - Simplifies test/perf tooling by removing OS-conditional compilation in some test tools and dropping Windows-only BenchmarkDotNet diagnoser support.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj | Removes TargetOs-based multi-targeting logic; updates Package-mode runtime assembly HintPath logic. |
| src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/TDS.EndPoint.csproj | Removes explicit Compile item lists and OS-conditional source inclusion. |
| src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/SSPI/SSPIContext.Unix.cs | Deletes the Unix SSPI stub implementation. |
| src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/SSPI/SSPIContext.cs | Adds runtime OS checks to enforce Windows-only SSPI execution. |
| src/Microsoft.Data.SqlClient/tests/TestUdts/Utf8String/Utf8String.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/TestUdts/Shapes/Shapes.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/TestUdts/Circle/Circle.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/TestUdts/Address/Address.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/StressTests/Directory.Build.props | Removes TargetOs-based targeting logic for stress test builds. |
| src/Microsoft.Data.SqlClient/tests/PerformanceTests/runnerconfig.jsonc | Removes configuration entries tied to Windows-only diagnosers. |
| src/Microsoft.Data.SqlClient/tests/PerformanceTests/Program.cs | Removes propagation of Windows-only diagnoser config into BenchmarkConfig. |
| src/Microsoft.Data.SqlClient/tests/PerformanceTests/Microsoft.Data.SqlClient.PerformanceTests.csproj | Removes Windows-only BenchmarkDotNet.Diagnostics.Windows dependency and WINDOWS constant. |
| src/Microsoft.Data.SqlClient/tests/PerformanceTests/Config/Config.cs | Removes the Windows-only profiler flag from the config model. |
| src/Microsoft.Data.SqlClient/tests/PerformanceTests/Config/BenchmarkConfig.cs | Removes conditional Windows diagnoser wiring. |
| src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/CustomConfigurableRetryLogic/CustomRetryLogicProvider.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.nuspec | Updates packed artifact paths to match non-OS-qualified build outputs while keeping runtime folder structure. |
| src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj | Removes TargetOs/NormalizedTargetOs usage; updates TargetFrameworks and OutputPath accordingly. |
| src/Microsoft.Data.SqlClient.Extensions/Azure/test/Azure.Test.csproj | Removes TargetOs-based targeting logic; now multi-targets directly. |
| eng/pipelines/ci/kerberos/sqlclient-ci-kerberos-pipeline.yml | Stops passing OS-specific build targets into the shared Kerberos build step template. |
| eng/pipelines/ci/kerberos/build-and-test-steps.yml | Removes buildTarget parameter and builds via -t:BuildSqlClient. |
| build.proj | Removes per-OS SqlClient build/test targets and replaces with a unified implementation build target. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4474 +/- ##
==========================================
- Coverage 64.73% 64.02% -0.72%
==========================================
Files 288 288
Lines 44088 70331 +26243
==========================================
+ Hits 28542 45026 +16484
- Misses 15546 25305 +9759
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/SSPI/SSPIContext.cs:142
CreateServercallsThrowIfNotWindows(), but theSSPIContextconstructor also calls it. This results in a redundant OS check (and double work) on the Windows path.
This issue also appears on line 163 of the same file.
src/Microsoft.Data.SqlClient/tests/tools/TDS/TDS.EndPoint/SSPI/SSPIContext.cs:168
CreateClientcallsThrowIfNotWindows(), but theSSPIContextconstructor also calls it. This results in a redundant OS check (and double work) on the Windows path.
|
This all looks good. A few notes from my earlier explorations in the area:
|
|
Thanks for the notes - I've got a couple responses inline
Yep, that's the next hurdle I have to tackle. It may be a showstopper for continuing past this PR as the alternatives might be too much effort for the simplification of the projects. I have an idea I want to try before I give up, though.
Those are all good suggestions. I'll check against those before I report this as ready to go.f |
31f3e6a to
579854d
Compare
mdaigle
left a comment
There was a problem hiding this comment.
🥳
Only one spot stood out to me, otherwise looks good!
Do you anticipate this change to be visible to customers at all? Is there any case where someone might be dependent on having platform in the path in the nuget package?
| above to locate the runtime DLL inside the NuGet package layout. --> | ||
| <Reference Include="Microsoft.Data.SqlClient" | ||
| HintPath="$(PkgMicrosoft_Data_SqlClient)/runtimes/$(_SqlClientRid)/lib/$(_SqlClientPackageTfm)/Microsoft.Data.SqlClient.dll" /> | ||
| HintPath="$(PkgMicrosoft_Data_SqlClient)/runtimes/win/lib/$(_SqlClientPackageTfm)/Microsoft.Data.SqlClient.dll" /> |
There was a problem hiding this comment.
does this work when running on unix? I wouldn't expect to see platform in any paths.
Description:
This PR is one of a few to finish removing OS-specific-ness in the project. In this step:
Testing:
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=166024&view=results
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=167254&view=results
https://dev.azure.com/SqlClientDrivers/ADO.Net/_build/results?buildId=166026&view=results