Skip to content

Publish patched rules_dotnet as 0.21.5-codeql.2 - #22550

Open
redsun82 wants to merge 1 commit into
mainfrom
redsun82-rules-dotnet-rid-gating-fix
Open

Publish patched rules_dotnet as 0.21.5-codeql.2#22550
redsun82 wants to merge 1 commit into
mainfrom
redsun82-rules-dotnet-rid-gating-fix

Conversation

@redsun82

@redsun82 redsun82 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Patches rules_dotnet's tfm_filegroup, which binds a target framework to a RID without gating on that RID in two cases:

  1. Single-RID TFMs are never gated. The len(rids) == 1 branch aliases straight at that RID's files with no select, so a package whose only key is e.g. netstandard1.6_unix gets published for every RID. Its PascalCase Microsoft.Management.Infrastructure.dll then collides with the lowercase microsoft.management.infrastructure.dll from the matching .Runtime.Win package, which is the same path on a case-insensitive filesystem: unzip of the Windows CLI zip prompts, gets EOF, and exits 1.
  2. RID-only TFMs get no //conditions:default, failing analysis on every other platform. rid_filegroup already resolves to an empty list there.

Both are still present in v0.21.5, v0.22.2 and master, so upgrading does not remove the need for the patch.

Developed and validated in microsoft#398, where the collision actually breaks the powershell extractor zip. It lands here so to avoid any future conflicts on this change. This has no actual impact on any of our own builds.

Notes

  • 0.21.5-codeql.1 is kept until consumers of this registry bump their pin, then it can go.

`tfm_filegroup` binds a TFM to a RID without gating on it when the TFM maps to a
single RID, so a package shipping only e.g. `netstandard1.6_unix` is published for
every RID. Its PascalCase DLL then collides with the lowercase one from the
matching `.Runtime.Win` package on case-insensitive filesystems, breaking `unzip`
of the Windows CLI zip. The same function also omits `//conditions:default` for
TFMs that only have RIDs, which fails analysis on every other platform.

No-op for this repo: all 7 RID-bound TFM groups here have a `default` sibling and
already take the gated multi-RID path. Landing it in the shared registry so
consumers of that registry pick it up.

`codeql.1` stays until those consumers bump their pin.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@redsun82

redsun82 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author
Rerun has been triggered: 3 restarted 🚀

@redsun82
redsun82 marked this pull request as ready for review September 11, 2026 11:47
Copilot AI balanced review requested due to automatic review settings September 11, 2026 11:47
@redsun82
redsun82 requested review from a team as code owners September 11, 2026 11:47

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.

Copilot review overview

🟡 Changes recommended

The public PR description references an organization-protected internal repository and should use generic wording instead.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Balanced
Findings: None

What changed in this PR

Publishes and adopts a patched rules_dotnet release that correctly gates RID-specific target framework groups.

Changes:

  • Adds RID gating and empty fallback behavior.
  • Preserves the existing NuGet archive patch.
  • Registers and adopts version 0.21.5-codeql.2.
File Description
MODULE.bazel Bumps rules_dotnet.
misc/​bazel/​registry/​modules/​rules_dotnet/​metadata.json Registers the release.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.21.5-codeql.2/​source.json Defines source and patches.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.21.5-codeql.2/​patches/​revert_additional_files_in_nuget_archive.patch Preserves the prior patch.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.21.5-codeql.2/​patches/​gate_rid_specific_tfm_groups.patch Fixes RID-specific selection.
misc/​bazel/​registry/​modules/​rules_dotnet/​0.21.5-codeql.2/​MODULE.bazel Defines module metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@redsun82

Copy link
Copy Markdown
Contributor Author

Copilot review overview

🟡 Changes recommended

The public PR description references an organization-protected internal repository and should use generic wording instead.

Nope, microsoft/codeql is a public fork.

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.

2 participants