[DRAFT] 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. |
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0</TargetFrameworks> | ||
|
|
||
| <!-- We cannot build netfx unless we are building for Windows. Thus, we will only add netfx if --> | ||
| <!-- we are building for Windows. --> | ||
| <TargetFrameworks Condition="'$(NormalizedTargetOs)' == 'windows_nt'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0</TargetFrameworks> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
This isn't true - linux builds net462 just fine without any extra nonsense.
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> |
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
| <!-- Target Frameworks =============================================== --> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks> | ||
|
|
||
| <!-- Default TargetOs to host OS if not specified (eg, during IDE development). --> | ||
| <TargetOs Condition="'$(TargetOs)' == ''">$(OS)</TargetOs> | ||
|
|
||
| <!-- Add net462 when targeting Windows. Building net462 is supported on any host OS. --> | ||
| <TargetFrameworks Condition="'$(TargetOs)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks> | ||
| <TargetFrameworks>net462;net8.0;net9.0;net10.0</TargetFrameworks> | ||
| </PropertyGroup> |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #4474 +/- ##
==========================================
- Coverage 70.88% 63.51% -7.37%
==========================================
Files 288 283 -5
Lines 43935 66821 +22886
==========================================
+ Hits 31142 42444 +11302
- Misses 12793 24377 +11584
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.
| <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" /> |
| <!-- Runtime Binaries ============================================== --> | ||
| <!-- @TODO: This is a temporary measure - removing the not support DLLs will come next --> | ||
|
|
Description:
This PR is one of a few to finish removing OS-specific-ness in the project. In this step:
Testing: