Skip to content

[release/10.0] Add managed FileCatalog MSBuild task - #17133

Merged
akoeplinger merged 4 commits into
release/10.0from
dev/akoeplinger/backport-filecatalog-10.0
Jul 17, 2026
Merged

akoeplinger merged 4 commits into
release/10.0from
dev/akoeplinger/backport-filecatalog-10.0

Conversation

@akoeplinger

Copy link
Copy Markdown
Member

Backport of #17098. Adapted to the requirements of release/10.0

akoeplinger and others added 2 commits July 16, 2026 21:07
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit 3169db0)
Target $(NetToolCurrent);$(NetFrameworkToolCurrent) so the task loads under
both Core and desktop MSBuild (matching other Arcade build tasks), adding the
out-of-band System.Formats.Asn1 reference for net472 and a cross-framework hash
helper in place of the net5.0+ SHA*.HashData APIs. Test project multitargets to
exercise the net472 path, with net472-compatible hex/hash helpers, and uses
FluentAssertions / $(NetToolCurrent) conventions from this branch.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d4e0f156-2249-4165-96fb-c348b532a48b
Copilot AI review requested due to automatic review settings July 16, 2026 20:33
@akoeplinger
akoeplinger requested a review from ViktorHofer July 16, 2026 20:35

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

Adds a new managed MSBuild task/package to generate unsigned Windows catalog (.cat) files in a deterministic, cross-platform way (removing the makecat.exe/Windows SDK dependency), along with unit tests and solution wiring.

Changes:

  • Introduces Microsoft.DotNet.Build.Tasks.FileCatalog with GenerateFileCatalog task and supporting catalog-building implementation.
  • Adds a golden/byte-for-byte test suite validating parity with makecat.exe output and task behavior.
  • Wires the new projects into Arcade.slnx and packages the task via a build/*.props auto-import.

Reviewed changes

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

Show a summary per file
File Description
src/Microsoft.DotNet.Build.Tasks.FileCatalog/README.md Documents purpose and usage of the new task/package.
src/Microsoft.DotNet.Build.Tasks.FileCatalog/Microsoft.DotNet.Build.Tasks.FileCatalog.csproj New build-task project configuration and packaging metadata.
src/Microsoft.DotNet.Build.Tasks.FileCatalog/GenerateFileCatalog.cs MSBuild task entrypoint for generating catalogs from item inputs.
src/Microsoft.DotNet.Build.Tasks.FileCatalog/CatalogOids.cs OID constants used when encoding catalog ASN.1.
src/Microsoft.DotNet.Build.Tasks.FileCatalog/CatalogMemberEncoder.cs ASN.1 DER encoding for per-member catalog structures.
src/Microsoft.DotNet.Build.Tasks.FileCatalog/CatalogEntry.cs Represents catalog entries (hash computation/storage).
src/Microsoft.DotNet.Build.Tasks.FileCatalog/CatalogBuilder.cs Builds deterministic unsigned PKCS#7/CTL catalog bytes.
src/Microsoft.DotNet.Build.Tasks.FileCatalog/build/Microsoft.DotNet.Build.Tasks.FileCatalog.props Auto-imports UsingTask for consuming projects.
src/Microsoft.DotNet.Build.Tasks.FileCatalog.Tests/Microsoft.DotNet.Build.Tasks.FileCatalog.Tests.csproj New unit test project for the catalog builder/task.
src/Microsoft.DotNet.Build.Tasks.FileCatalog.Tests/CatalogTests.cs Golden fixtures + behavioral tests for determinism and task output.
Arcade.slnx Adds the new project + tests to the solution.

Copilot AI review requested due to automatic review settings July 17, 2026 08:23
Switch the list-identifier derivation from the legacy HashAlgorithm
TransformBlock streaming API to IncrementalHash, matching the rest of the
FileCatalog code (CatalogEntry.FromFile and the net472 hash fallback). Output
is byte-for-byte identical (same SHA-256 over the same concatenation), as
verified by the catalog fixture tests.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d4e0f156-2249-4165-96fb-c348b532a48b
@akoeplinger
akoeplinger force-pushed the dev/akoeplinger/backport-filecatalog-10.0 branch from b495bda to 5b557d6 Compare July 17, 2026 08:26

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

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

Copilot AI review requested due to automatic review settings July 17, 2026 08:26

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

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

Replace the manual byte-by-byte comparison loop with the built-in
allocation-free ReadOnlySpan<byte>.SequenceCompareTo, which yields the same
lexicographic ordering used for sorting and dedup. Available on both net472
(via System.Memory) and modern .NET.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: d4e0f156-2249-4165-96fb-c348b532a48b
Copilot AI review requested due to automatic review settings July 17, 2026 08:43

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

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

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.

3 participants