Skip to content

Merge | Not Supported Binaries / Test Targets#3997

Open
benrr101 wants to merge 17 commits intomainfrom
dev/russellben/common/notsupported
Open

Merge | Not Supported Binaries / Test Targets#3997
benrr101 wants to merge 17 commits intomainfrom
dev/russellben/common/notsupported

Conversation

@benrr101
Copy link
Contributor

@benrr101 benrr101 commented Mar 4, 2026

Description

This PR consists of two main changes:

Add test targets to build2.proj

  • Expand upon the build parameter descriptions
  • Add targets for testing via dotnet
  • Targets are not wired up to anything yet, but they will be used soon

Generate "Not Supported" assemblies from common MDS

  • Add a new project to generate Not Supported assemblies, with much description and much explanation on how to use it
    • This removes dependency on GenerateNotSupported.targets and ResolveContract.targets
  • Add GenAPI projects to solution for reference purposes they are not built with the solution
  • Add generated not supported source files to the .gitignore
  • Add build2.proj target that generates the not supported targets they are not wired up to anything yet, but they will be used soon
  • Build GenAPI as part of BuildMdsNotSupported target
    • Don't worry about special paths for output of it, just dump it to the default bin output
    • Only build for one target framework (net9.0 was chosen)
  • Update GenerateNotSupported.targets to pick up the changes to paths.

Msc Changes

  • Dump ref binaries to a better place in the artifacts folder
  • Strong name sign ref binaries
  • Bring back disabling common MDS net462 building when building for unix

Issues

N/A

Testing

Running targets locally work as expected. Hopefully there are no major issues with the pipelines, since most of the changes don't affect existing pipelines.

@benrr101 benrr101 added this to the 7.0.0 milestone Mar 4, 2026
@benrr101 benrr101 requested a review from a team as a code owner March 4, 2026 19:08
@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Mar 4, 2026
Copilot AI review requested due to automatic review settings March 4, 2026 19:08
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Mar 4, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes two main changes: (1) adds test targets to build2.proj with detailed parameter documentation for running MDS tests via MSBuild, and (2) creates a new dedicated project (notsupported/) to generate "Not Supported" assemblies from the common MDS ref project using GenAPI, replacing the previous approach that was embedded in the netcore/netfx projects. Additional changes include strong-name signing for ref binaries, updated output paths for ref assemblies, conditional exclusion of net462 from Unix builds, and GenAPI project updates to target a single framework (net9.0).

Changes:

  • New notsupported/Microsoft.Data.SqlClient.csproj project and updated NotSupported.targets for generating PlatformNotSupportedException assemblies via GenAPI
  • Expanded build2.proj with test targets (TestMdsFunctional, TestMdsManual, TestMdsUnit), build targets (BuildMdsRef, BuildMdsNotSupported), and comprehensive parameter documentation
  • Conditional net462 exclusion on Unix, strong-name signing for ref binaries, and GenAPI project simplification to single net9.0 target

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
build2.proj Major expansion: imports, test/build targets, detailed parameter docs
tools/targets/NotSupported.targets Replaced old GenAPI variable setup with new paths/command, but Exec still uses old vars
src/Microsoft.Data.SqlClient/notsupported/Microsoft.Data.SqlClient.csproj New project to generate Not Supported assemblies via GenAPI
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Reordered TargetOs/TargetFrameworks, added signing, conditional net462 on Windows only
src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.csproj Added strong-name signing and custom output path under artifacts/
tools/GenAPI/Microsoft.DotNet.GenAPI/Microsoft.DotNet.GenAPI.csproj Simplified to single net9.0 target, removed custom OutputPath
tools/GenAPI/Microsoft.Cci.Extensions/Microsoft.Cci.Extensions.csproj Removed custom OutputPath
src/Microsoft.Data.SqlClient.sln Added notsupported, GenAPI, and Cci.Extensions projects (no build)
.gitignore Added pattern to ignore generated notsupported .cs files

benrr101 added 4 commits March 4, 2026 14:18
Ignore trx test results from git
Adding conditional net462 stuff to stress test Directory.Build.props
Adding TestUtilities reference to Azure test
Copilot AI review requested due to automatic review settings March 4, 2026 23:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.

build2.proj Outdated
<Target Name="BuildMdsNotSupported">
<PropertyGroup>
<DotNetCommand>
"$(DotNetPath)dotnet" build "$(GenApiPath)/Microsoft.DotNet.GenAPI.csproj"
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: $(GenApiPath) already ends with a trailing / (defined at line 155 as $(RepoRoot)tools/GenAPI/Microsoft.DotNet.GenAPI/), so this produces a double slash in the path: .../Microsoft.DotNet.GenAPI//Microsoft.DotNet.GenAPI.csproj.

Additionally, line 156 already defines $(GenApiProjectPath) as $(GenApiPath)Microsoft.DotNet.GenAPI.csproj for exactly this purpose, but it's not used here. Replace "$(GenApiPath)/Microsoft.DotNet.GenAPI.csproj" with "$(GenApiProjectPath)".

Suggested change
"$(DotNetPath)dotnet" build "$(GenApiPath)/Microsoft.DotNet.GenAPI.csproj"
"$(DotNetPath)dotnet" build "$(GenApiProjectPath)"

Copilot uses AI. Check for mistakes.
benrr101 added 2 commits March 4, 2026 18:18
Remove redundant strong naming from common MDS
Fix typos as per copilot (why couldn't it find these the first time around??)
Copilot AI review requested due to automatic review settings March 5, 2026 01:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.

PackageVersionLogging
Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows
TestMdsFunctiona, TestMdsManual
Description: Specifies what version of the Microsoft.Data.SqlCLient.Logging to use
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: "SqlCLient" should be "SqlClient" (lowercase 'l'), same as the occurrence at line 33.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +20
<!-- Strong name signing ============================================= -->
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
</PropertyGroup>

Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strong name signing properties (SignAssembly, AssemblyOriginatorKeyFile) are already set by src/Directory.Build.props (lines 121-123), which this project inherits via MSBuild's automatic Directory.Build.props walk-up. This block is redundant. Consider removing it to keep the signing configuration centralized, or at minimum add a comment explaining why the duplication is intentional.

Suggested change
<!-- Strong name signing ============================================= -->
<!-- When a signing key is specified, we will perform strong name assembly signing. -->
<PropertyGroup Condition="'$(SigningKeyPath)' != ''">
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(SigningKeyPath)</AssemblyOriginatorKeyFile>
</PropertyGroup>

Copilot uses AI. Check for mistakes.
<!--
PackageVersionLogging
Applies to: BuildMds, BuildMdsUnix, BuildMdsWindows
TestMdsFunctiona, TestMdsManual
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: "TestMdsFunctiona" is missing the trailing "l" — should be "TestMdsFunctional".

Suggested change
TestMdsFunctiona, TestMdsManual
TestMdsFunctional, TestMdsManual

Copilot uses AI. Check for mistakes.
<Target Name="BuildMds" DependsOnTargets="BuildMdsUnix;BuildMdsWindows;BuildMdsRef;BuildMdsNotSupported" />

<!--
BuildMdsNotSupportd: Builds a version of the MDS assemblies that always throws
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: "BuildMdsNotSupportd" in the comment is missing the trailing "e" — should be "BuildMdsNotSupported".

Suggested change
BuildMdsNotSupportd: Builds a version of the MDS assemblies that always throws
BuildMdsNotSupported: Builds a version of the MDS assemblies that always throws

Copilot uses AI. Check for mistakes.
Comment on lines +214 to +219
<DotNetCommand>
"$(DotNetPath)dotnet" build "$(GenApiProjectPath)"
-p:Configuration=$(Configuration)
</DotNetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: $(DotNetPath) (capital N) on lines 215 and 232 is inconsistently cased compared to the build parameter $(DotnetPath) (lowercase n) defined on line 27. While MSBuild properties are case-insensitive so this won't cause a runtime failure, the naming within this same target is self-inconsistent: the property is initially set as DotNetCommand (lines 214, 231) but the regex replace overwrites a differently-cased DotnetCommand (lines 219, 237). Although MSBuild treats these as the same property, please use consistent casing throughout for readability — the rest of the file uses DotnetCommand and DotnetPath.

Copilot uses AI. Check for mistakes.
PackageVersionAbstractions
Applies to: BuildMds, BuildMdsRef, BuildMdsUnix, BuildMdsWindows
TestMdsFunctional, TestMdsManual
Description: Specifies what version of the Microsoft.Data.SqlCLient.Abstractions to use
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling: "SqlCLient" should be "SqlClient" (lowercase 'l'). This appears in both the PackageVersionAbstractions and PackageVersionLogging parameter descriptions.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Common Project 🚮 Things that relate to the common project project

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

2 participants