Skip to content

Pack RID-specific tool pointer packages with DotnetToolSettings.xml under tools/any/any#55107

Open
Copilot wants to merge 4 commits into
mainfrom
copilot/update-pointer-package-tfm
Open

Pack RID-specific tool pointer packages with DotnetToolSettings.xml under tools/any/any#55107
Copilot wants to merge 4 commits into
mainfrom
copilot/update-pointer-package-tfm

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

RID-specific tool packaging currently places the top-level pointer package's DotnetToolSettings.xml under a concrete TFM path. This change makes the pointer package emit the settings file under tools/any/any so the package remains TFM-agnostic while still pointing to the RID-specific payload packages.

  • Packaging layout

    • Update Microsoft.NET.PackTool.targets so the top-level RID-specific pointer package writes DotnetToolSettings.xml to tools/any/any/.
    • Leave implementation packages unchanged; they still use their existing TFM/RID-specific layout.
  • Pointer package behavior

    • Apply the any TFM path only when packing the RID-specific top-level package that contains metadata but no implementation files.
    • Preserve the existing settings generation and RID declarations inside the XML.
  • Coverage

    • Extend tool packaging end-to-end assertions to verify the pointer package contains exactly one DotnetToolSettings.xml and that its path is tools/any/any/DotnetToolSettings.xml.
    • Cover both standard RID-specific packages and the variant that also includes an any RID payload.
<!-- top-level pointer package -->
tools/any/any/DotnetToolSettings.xml

<!-- RID-specific implementation package -->
tools/net11.0/linux-x64/...

Copilot AI and others added 2 commits July 1, 2026 19:39
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Copilot AI changed the title [WIP] Update pointer package to use any TFM for compatibility Pack RID-specific tool pointer packages with DotnetToolSettings.xml under tools/any/any Jul 1, 2026
Copilot AI requested a review from baronfel July 1, 2026 19:40
Comment thread src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PackTool.targets Outdated
Co-authored-by: baronfel <573979+baronfel@users.noreply.github.com>
Copilot AI requested a review from baronfel July 1, 2026 19:59
@baronfel baronfel marked this pull request as ready for review July 1, 2026 20:00
@baronfel baronfel requested review from Copilot and dsplaisted July 1, 2026 20:00
@baronfel

baronfel commented Jul 1, 2026

Copy link
Copy Markdown
Member

When we merge this we should backport to 10.0.4xx as well.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the RID-specific pointer tool package layout so that DotnetToolSettings.xml is emitted under tools/any/any/, keeping the pointer package TFM-agnostic while still referencing RID-specific implementation packages.

Changes:

  • Adjust Microsoft.NET.PackTool.targets to place the pointer package’s DotnetToolSettings.xml under tools/any/any/ (while keeping implementation packages’ existing TFM/RID layout).
  • Extend end-to-end tool packaging assertions to validate the pointer package contains exactly one DotnetToolSettings.xml and that it lives at tools/any/any/DotnetToolSettings.xml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs Adds assertions to verify the pointer package has a single DotnetToolSettings.xml at tools/any/any/.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.PackTool.targets Updates packing logic to emit DotnetToolSettings.xml to a TFM-agnostic tools/any/any/ path for RID-specific pointer packages.

Comment thread test/Microsoft.DotNet.PackageInstall.Tests/EndToEndToolTests.cs
static ZipArchiveEntry GetToolSettingsFileEntry(ZipArchive zipArchive)
{
var settingsEntries = zipArchive.Entries.Where(e => e.Name == "DotnetToolSettings.xml").ToArray();
settingsEntries.Should().ContainSingle("tool packages should contain exactly one DotnetToolSettings.xml file");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think multi-targeted tool packages can contain more than one tool settings file. But this is probably fine for the scenarios we're testing.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RID-specific tool packaging should make the top-level pointer package use the any TFM for improved compatibility

4 participants