Skip to content

DRAFT Pack experiment#3985

Open
mdaigle wants to merge 12 commits intomainfrom
dev/russellben/common/pack
Open

DRAFT Pack experiment#3985
mdaigle wants to merge 12 commits intomainfrom
dev/russellben/common/pack

Conversation

@mdaigle
Copy link
Contributor

@mdaigle mdaigle commented Feb 25, 2026

Description

Provide a summary of the changes being introduced. Important topics to cover
include:

  • Description of the functionality.
  • API changes, backwards compatibility, deprecations, etc.
  • Documentation, localization.
  • Bug fixes.
  • Code hygiene, refactoring, improvements.
  • Engineering processes (CI, pipelines, test coverage)

High quality descriptions will lead to a smoother review experience.

Issues

Link to any relevant issues, bugs, or discussions (e.g., Closes #123, Fixes issue #456).

Testing

Describe the automated tests (unit, integration) you created or modified.
Provide justification for any gap in automated testing. List any manual testing
steps that were performed to ensure the changes work. 

Guidelines

Please review the contribution guidelines before submitting a pull request:

Copilot AI review requested due to automatic review settings February 25, 2026 19:48
@mdaigle mdaigle requested a review from a team as a code owner February 25, 2026 19:48
@mdaigle mdaigle changed the title Pack experiment DRAFT Pack experiment Feb 25, 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 introduces experimental build infrastructure changes to support packaging Microsoft.Data.SqlClient. The changes modernize the OS targeting logic in the unified source project and introduce a new experimental build file (build2.proj) with packaging targets.

Changes:

  • Refactored OS targeting in Microsoft.Data.SqlClient.csproj to accept OSGroup from build.proj and support AnyOS stub assemblies
  • Added build2.proj with experimental build, pack, and test targets for Microsoft.Data.SqlClient and AKV provider
  • Updated build.proj to use unified MdsSource project instead of separate NetFxDriver/NetCoreDriver ItemGroups

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
src/Microsoft.Data.SqlClient/src/Microsoft.Data.SqlClient.csproj Refactored TargetOs logic to accept OSGroup parameter; added AnyOS stub assembly generation; restructured output paths to maintain legacy layout compatibility
build2.proj New experimental build file with BuildMds, PackMds, BuildAkv targets and placeholder test targets
build.proj Replaced NetFxDriver/NetCoreDriver with unified MdsSource ItemGroup; updated all build targets to pass TargetFrameworks parameter

build2.proj Outdated
NugetPath
Applies to: Pack* targets
Description: Path to folder containing `nuget` binary. Override this if a specific version
is required. Othrwise, this defaults to the `nuget` binary in the PATH
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

Typo in "Othrwise" should be "Otherwise".

Suggested change
is required. Othrwise, this defaults to the `nuget` binary in the PATH
is required. Otherwise, this defaults to the `nuget` binary in the PATH

Copilot uses AI. Check for mistakes.
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Packageing MDS via command: $(NugetCommand)" />
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

Typo in "Packageing" should be "Packaging".

Suggested change
<Message Text=">>> Packageing MDS via command: $(NugetCommand)" />
<Message Text=">>> Packaging MDS via command: $(NugetCommand)" />

Copilot uses AI. Check for mistakes.
Comment on lines 92 to 93
<OutputPath>$(BinFolder)$(Configuration).$(Platform)/$(AssemblyName)/$(_TfmGroup)/</OutputPath>
<IntermediateOutputPath>$(ObjFolder)$(Configuration).$(Platform)/$(AssemblyName)/$(_TfmGroup)/</IntermediateOutputPath>
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The OutputPath and IntermediateOutputPath use the $(Platform) property, but Platform is not defined with a default value in this project file. When building directly (e.g., from an IDE without passing Platform explicitly), this could result in an invalid path. Consider adding a default value such as <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform> in a PropertyGroup before these paths are set.

Copilot uses AI. Check for mistakes.
@@ -2,24 +2,56 @@
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The PR description is empty and the mentioned issues (#123 about SQL Graph edge pseudo-columns and #456 about UDT buffers) appear to be unrelated to the changes in this PR, which focus on build infrastructure and packaging experiments. The PR description should be filled out to explain the purpose of this experimental build infrastructure, what problems it's trying to solve, and whether build2.proj is intended to replace or supplement build.proj.

Copilot uses AI. Check for mistakes.
build2.proj Outdated
Comment on lines 122 to 137
<!-- TestMds: Runs all test projects for MDS -->
<Target Name="TestMds" DependsOnTargets="TestMdsFunctional;TestMdsManual;TestMdsUnit" />

<!-- TestMdsFunctional: Runs functional tests for MDS -->
<Target Name="TestMdsFunctional">
<!-- @TODO -->
</Target>

<!-- TestMdsManual: Runs manual tests for MDS -->
<Target Name="TestMdsManual">
<!-- @TODO -->
</Target>

<!-- TestMdsUnit: Runs unit tests for MDS -->
<Target Name="TestMdsUnit">
<!-- @TODO -->
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The test targets (TestMdsFunctional, TestMdsManual, TestMdsUnit) are not implemented and contain TODO comments. Before this PR is merged, these targets should either be implemented or the TestMds target should be removed/documented as a placeholder for future work.

Suggested change
<!-- TestMds: Runs all test projects for MDS -->
<Target Name="TestMds" DependsOnTargets="TestMdsFunctional;TestMdsManual;TestMdsUnit" />
<!-- TestMdsFunctional: Runs functional tests for MDS -->
<Target Name="TestMdsFunctional">
<!-- @TODO -->
</Target>
<!-- TestMdsManual: Runs manual tests for MDS -->
<Target Name="TestMdsManual">
<!-- @TODO -->
</Target>
<!-- TestMdsUnit: Runs unit tests for MDS -->
<Target Name="TestMdsUnit">
<!-- @TODO -->
<!-- TestMds: Runs all test projects for MDS (see individual targets below). -->
<Target Name="TestMds" DependsOnTargets="TestMdsFunctional;TestMdsManual;TestMdsUnit" />
<!--
TestMdsFunctional: Placeholder target for running functional tests for MDS.
Currently this target does not execute any tests and exists as an extension
point for future work. Consumers that require functional tests should
override or extend this target in their own build scripts.
-->
<Target Name="TestMdsFunctional">
<Message Importance="High"
Text="TestMdsFunctional is currently a placeholder and does not run any functional tests. Override this target to add functional test execution." />
</Target>
<!--
TestMdsManual: Placeholder target for running manual/integration tests for MDS.
Currently this target does not execute any tests and exists as an extension
point for future work. Consumers that require manual tests should
override or extend this target in their own build scripts.
-->
<Target Name="TestMdsManual">
<Message Importance="High"
Text="TestMdsManual is currently a placeholder and does not run any manual tests. Override this target to add manual test execution." />
</Target>
<!--
TestMdsUnit: Placeholder target for running unit tests for MDS.
Currently this target does not execute any tests and exists as an extension
point for future work. Consumers that require unit tests should
override or extend this target in their own build scripts.
-->
<Target Name="TestMdsUnit">
<Message Importance="High"
Text="TestMdsUnit is currently a placeholder and does not run any unit tests. Override this target to add unit test execution." />

Copilot uses AI. Check for mistakes.
<PropertyGroup>
<NugetCommand>
nuget pack &quot;$(MdsNuspecPath)&quot;
-OutputDirectory &quot;$(MdsArtifactsPath)&quot;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The property MdsArtifactsPath is referenced but never defined. It should likely be MdsArtifactsFolder instead, which is defined on line 52.

Suggested change
-OutputDirectory &quot;$(MdsArtifactsPath)&quot;
-OutputDirectory &quot;$(MdsArtifactsFolder)&quot;

Copilot uses AI. Check for mistakes.
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The variable NugetCommand is assigned here but then DotnetCommand is incorrectly used in the whitespace cleanup on line 116. This should be cleaning up NugetCommand instead.

Suggested change
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
<NugetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(NugetCommand), "\s+", " "))</NugetCommand>

Copilot uses AI. Check for mistakes.
@benrr101 benrr101 force-pushed the dev/russellben/common/pack branch from 8d2321d to 52cf1df Compare February 26, 2026 20:13
Copilot AI review requested due to automatic review settings February 27, 2026 00:51
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 4 out of 4 changed files in this pull request and generated 14 comments.

Comment on lines +121 to 136
<!-- /ref/ ========================================================= -->
<!-- @TODO: ref NetFx -->
<file src="..\..\artifacts\$ReferenceType$\bin\Windows_NT\$Configuration$\Microsoft.Data.SqlClient\ref\net462\Microsoft.Data.SqlClient.dll" target="ref\net462\" exclude="" />
<file src="..\..\artifacts\$ReferenceType$\bin\Windows_NT\$Configuration$\Microsoft.Data.SqlClient\ref\net462\Microsoft.Data.SqlClient.xml" target="ref\net462\" exclude="" />

<!-- ref NetCore for Net 8 -->
<!-- @TODO: ref NetCore for Net 8 -->
<file src="..\..\artifacts\$ReferenceType$\bin\AnyOS\$Configuration$\Microsoft.Data.SqlClient\ref\net8.0\Microsoft.Data.SqlClient.dll" target="ref\net8.0\" exclude="" />
<file src="..\..\artifacts\$ReferenceType$\bin\AnyOS\$Configuration$\Microsoft.Data.SqlClient\ref\net8.0\Microsoft.Data.SqlClient.xml" target="ref\net8.0\" exclude="" />

<!-- ref NetCore for Net 9 -->
<!-- @TODO: ref NetCore for Net 9 -->
<file src="..\..\artifacts\$ReferenceType$\bin\AnyOS\$Configuration$\Microsoft.Data.SqlClient\ref\net9.0\Microsoft.Data.SqlClient.dll" target="ref\net9.0\" exclude="" />
<file src="..\..\artifacts\$ReferenceType$\bin\AnyOS\$Configuration$\Microsoft.Data.SqlClient\ref\net9.0\Microsoft.Data.SqlClient.xml" target="ref\net9.0\" exclude="" />

<!-- ref NetCore for NetStandard2.0 -->
<!-- @TODO: ref NetCore for NetStandard2.0 -->
<file src="..\..\artifacts\$ReferenceType$\bin\AnyOS\$Configuration$\Microsoft.Data.SqlClient\ref\netstandard2.0\Microsoft.Data.SqlClient.dll" target="ref\netstandard2.0\" exclude="" />
<file src="..\..\artifacts\$ReferenceType$\bin\AnyOS\$Configuration$\Microsoft.Data.SqlClient\ref\netstandard2.0\Microsoft.Data.SqlClient.xml" target="ref\netstandard2.0\" exclude="" />
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

These /ref/ file entries still use the legacy artifacts\$ReferenceType$\bin\... layout and the $ReferenceType$ token. With the new SDK-style project OutputPath (and build2.proj's nuget pack invocation not passing ReferenceType), these paths/tokens will not resolve and nuget pack will fail. Either update these src= paths to the new artifacts\Microsoft.Data.SqlClient... layout (or wherever ref outputs now land) or ensure the build + pack pipeline still produces and passes the expected $ReferenceType$ structure/property.

Copilot uses AI. Check for mistakes.
Comment on lines 138 to 151
@@ -154,27 +150,29 @@
<file src="..\..\artifacts\$ReferenceType$\bin\Windows_NT\$Configuration$.AnyCPU\Microsoft.Data.SqlClient\netfx\net462\zh-Hans\Microsoft.Data.SqlClient.resources.dll" target="lib\net462\zh-Hans\" exclude="" />
<file src="..\..\artifacts\$ReferenceType$\bin\Windows_NT\$Configuration$.AnyCPU\Microsoft.Data.SqlClient\netfx\net462\zh-Hant\Microsoft.Data.SqlClient.resources.dll" target="lib\net462\zh-Hant\" exclude="" />
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The net462 satellite resource src= paths are still pointing at artifacts\$ReferenceType$\bin\Windows_NT\...\netfx\net462\<culture>\.... The updated project output layout writes binaries under artifacts\Microsoft.Data.SqlClient\$(Configuration)\windows_nt\net462\... (with cultures as subfolders), so these file includes likely won't exist and will break packing. Align these resource paths with the actual output directory structure used by the SDK-style project build.

Copilot uses AI. Check for mistakes.
Comment on lines +219 to +224
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);&quot;
-Symbols
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The nuget pack invocation doesn't pass required nuspec properties. The nuspec uses tokens like $ReferenceType$, $AbstractionsPackageVersion$, and $LoggingPackageVersion$; without supplying these via -Properties, packing will fail (unresolved tokens / missing file paths). Update -Properties to include these values (or remove the tokens from the nuspec if they are no longer needed).

Suggested change
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);&quot;
-Symbols
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);ReferenceType=$(ReferenceType);AbstractionsPackageVersion=$(AbstractionsPackageVersion);LoggingPackageVersion=$(LoggingPackageVersion);&quot;
-Symbols
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<NugetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(NugetCommand), "\s+", " "))</NugetCommand>

Copilot uses AI. Check for mistakes.
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
</PropertyGroup>
<Message Text=">>> Packageing MDS via command: $(NugetCommand)" />
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Typo in the message text: "Packageing" should be "Packaging".

Suggested change
<Message Text=">>> Packageing MDS via command: $(NugetCommand)" />
<Message Text=">>> Packaging MDS via command: $(NugetCommand)" />

Copilot uses AI. Check for mistakes.
$(TestFilterArgument)
$(TestFrameworkArgument)
--results-directory "$(TestResultsFolderPath)"
--logger:"trx;LogFilePrefix=$(LogFilePrefix)
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The unit test dotnet test command has an unterminated --logger: argument (missing the closing quote) and likely a missing closing )/quote at the end of the command block. This will cause the dotnet test invocation to fail when the target runs.

Suggested change
--logger:"trx;LogFilePrefix=$(LogFilePrefix)
--logger:"trx;LogFilePrefix=$(LogFilePrefix)"

Copilot uses AI. Check for mistakes.
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

In PackMds, the whitespace-normalization step is applied to $(DotnetCommand), but the command being built/executed here is $(NugetCommand). As written, $(NugetCommand) will keep the original whitespace/newlines, and $(DotnetCommand) may be unintentionally overwritten. Apply the regex replace to $(NugetCommand) instead.

Suggested change
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
<NugetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(NugetCommand), "\s+", " "))</NugetCommand>

Copilot uses AI. Check for mistakes.
$(TestCollectArgument)
$(TestFilterArgument)
$(TestFrameworkArgument)
$(TestPackageReferenceArgument)
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

$(TestPackageReferenceArgument) is referenced in the functional test command, but this property is never defined (the file defines TestPackageBuildArgument). As a result, ReferenceType=Package / MdsPackageVersion won't be forwarded to the test build. Use the defined property name consistently (or define TestPackageReferenceArgument).

Suggested change
$(TestPackageReferenceArgument)
$(TestPackageBuildArgument)

Copilot uses AI. Check for mistakes.
Comment on lines +215 to +224
<NugetCommand>
nuget pack &quot;$(MdsNuspecPath)&quot;
-OutputDirectory &quot;$(MdsArtifactsPath)&quot;
-Version &quot;$(MdsPackageVersion)&quot;
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);&quot;
-Symbols
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

PackMds always passes -Version "$(MdsPackageVersion)", but MdsPackageVersion defaults to empty. nuget pack requires a non-empty version (or you should omit -Version to fall back to the nuspec <version>). Consider only adding -Version when $(MdsPackageVersion) is set, or set a sensible default.

Suggested change
<NugetCommand>
nuget pack &quot;$(MdsNuspecPath)&quot;
-OutputDirectory &quot;$(MdsArtifactsPath)&quot;
-Version &quot;$(MdsPackageVersion)&quot;
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);&quot;
-Symbols
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
<!-- Only pass -Version when MdsPackageVersion is set -->
<VersionArgument Condition=" '$(MdsPackageVersion)' != '' ">-Version &quot;$(MdsPackageVersion)&quot;</VersionArgument>
<NugetCommand>
nuget pack &quot;$(MdsNuspecPath)&quot;
-OutputDirectory &quot;$(MdsArtifactsPath)&quot;
$(VersionArgument)
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);&quot;
-Symbols
-SymbolPackageFormat snupkg
</NugetCommand>
<!-- Convert more than one whitespace character into one space -->
<NugetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(NugetCommand), "\s+", " "))</NugetCommand>

Copilot uses AI. Check for mistakes.
Comment on lines +205 to +220
<GitCommand>
git rev-parse HEAD
</GitCommand>
</PropertyGroup>
<Message Text=">>> Fetching git commit hash via command: $(GitCommand)" />
<Exec Command="$(GitCommand)" ConsoleToMsBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" />
</Exec>

<PropertyGroup>
<NugetCommand>
nuget pack &quot;$(MdsNuspecPath)&quot;
-OutputDirectory &quot;$(MdsArtifactsPath)&quot;
-Version &quot;$(MdsPackageVersion)&quot;
-Properties &quot;COMMITID=$(CommitHash);Configuration=$(Configuration);&quot;
-Symbols
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

CommitHash is captured from git rev-parse HEAD via ConsoleOutput, which typically includes a trailing newline. Passing that directly into -Properties "COMMITID=$(CommitHash)..." can result in an invalid COMMITID value (newline in the property) and potentially break nuget pack property parsing. Trim $(CommitHash) before using it (e.g., strip whitespace/newlines).

Copilot uses AI. Check for mistakes.
Comment on lines +218 to +221
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\unix\net9.0\Microsoft.Data.SqlClient.dll" target="runtimes\win\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\unix\net9.0\Microsoft.Data.SqlClient.pdb" target="runtimes\win\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\windows_nt\net9.0\Microsoft.Data.SqlClient.dll" target="runtimes\unix\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\windows_nt\net9.0\Microsoft.Data.SqlClient.pdb" target="runtimes\unix\lib\net9.0\" exclude="" />
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

The net9.0 runtime entries appear to have the OS targets swapped: files sourced from the Unix build are being placed under runtimes\win\..., and files sourced from the Windows build are being placed under runtimes\unix\.... This will cause the wrong assembly to be selected at runtime for each OS.

Suggested change
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\unix\net9.0\Microsoft.Data.SqlClient.dll" target="runtimes\win\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\unix\net9.0\Microsoft.Data.SqlClient.pdb" target="runtimes\win\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\windows_nt\net9.0\Microsoft.Data.SqlClient.dll" target="runtimes\unix\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\windows_nt\net9.0\Microsoft.Data.SqlClient.pdb" target="runtimes\unix\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\unix\net9.0\Microsoft.Data.SqlClient.dll" target="runtimes\unix\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\unix\net9.0\Microsoft.Data.SqlClient.pdb" target="runtimes\unix\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\windows_nt\net9.0\Microsoft.Data.SqlClient.dll" target="runtimes\win\lib\net9.0\" exclude="" />
<file src="..\..\artifacts\Microsoft.Data.SqlClient\$Configuration$\windows_nt\net9.0\Microsoft.Data.SqlClient.pdb" target="runtimes\win\lib\net9.0\" exclude="" />

Copilot uses AI. Check for mistakes.

<!-- 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>
Copy link
Contributor

Choose a reason for hiding this comment

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

My workflow to do a sanity check build before I commit is:

dotnet build src

I run this on Linux, and with this change, it will no longer build net462 or any code gated by _WINDOWS, even though that target and code builds just fine on Linux. I guess my new workflow will need to be:

dotnet build src
dotnet build src -p:TargetOs=Windows_NT

Will the new build2.proj have a single (default) target that builds everything for all combinations?

It will be nice if/when we can eliminate OS from the matrix and let MSBuild handle the combinations to build everything automatically.

How are IDE developers ensuring that all combinations of Target Framework + TargetOs are compiling before they commit? For example, if I run VSCode in Linux, I won't even see net462 as a target framework. I would have to create some sort of build configs - one for TargetOs Windows_NT and one for Unix I guess?

Default value: Debug
Allowed values: Debug, Release
-->
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure properties specified on the command line are read-only, so if someone says:

dotnet build build2.proj -p:Configuration=Blah

Then nothing in the project files can clobber that. The same goes for properties supplied via the <MSBuild> task AFAIK.

Since this is a top-level file that isn't included anywhere else, do we still need these conditions checking for empty values? It should be safe to just say this, I think?

<Configuration>Debug</Configuration>

Default value: [blank]
Example: C:\x86\
-->
<DotnetPath Condition="'$(DotnetPath)' == ''" />
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of defining this to be empty if it's already empty? Same for some of the properties below.

Allowed values: (time_expression|0)
-->
<TestBlameTimeout Condition="'$(TestBlameTimeout)' == ''">10m</TestBlameTimeout>
<TestBlameTimeout Condition="'$(TestBlameTimeout)' == '0'" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this has any effect if TestBlameTimeout is set to 0 on the command line.

"none" to disable filtering and run all tests in the target.
For more information see:
https://learn.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests
Default value: category!=failing&category!=flaky
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to add category!=interactive here.

<!--
TestFramework
Applies to: Test* targets
Description: Target framework moniker for the version of the .NET to use to execute the
Copy link
Contributor

Choose a reason for hiding this comment

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

of the .NET ?

specified test target. If not specified, this defaults to running tests for
*all* framework versions supported for the project.
Default value: [blank]
Example: net462
Copy link
Contributor

Choose a reason for hiding this comment

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

Can multiple monikers be speficied at once? net8.0;net9.0

Description: Absolute path to directory where any test results should be dumped. If not
specified, this path will default to test_results in the root of the
repository.
Default value: $(REPO_ROOT)\test_results
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if the existing pipelines set this, and I think they expect the test results in a different directory.

<MdsNuspecPath>$(RepoRoot)tools/specs/Microsoft.Data.SqlClient.nuspec</MdsNuspecPath>

<!-- Project Paths -->
<MdsFunctionalTestProjectPath>$(MdsRoot)tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj</MdsFunctionalTestProjectPath>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure alphabetical sorting makes the most sense here. I was expecting main project, ref project, test projects. I don't really care though.

</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
<DotnetCommand>$([System.Text.RegularExpressions.Regex]::Replace($(DotnetCommand), "\s+", " "))</DotnetCommand>
<!-- Convert more than one whitespace character into one space -->
Copy link
Contributor

Choose a reason for hiding this comment

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

Weird indentation here, and below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants