Skip to content

Resolve Vcpkg manifest mappings in nested install roots - #1915

Open
J.s Ibitoye (jsibitoye) wants to merge 1 commit into
microsoft:mainfrom
jsibitoye:jsibitoye/vcpkg-nested-manifest-attribution
Open

J.s Ibitoye (jsibitoye) wants to merge 1 commit into
microsoft:mainfrom
jsibitoye:jsibitoye/vcpkg-nested-manifest-attribution

Conversation

@jsibitoye

Copy link
Copy Markdown

Problem

In #1865, derekpiasecki reported that the Vcpkg detector discovers manifest-info.json in MSBuild's triplet-specific install root but still looks for the mapping only directly under vcpkg_installed. Components consequently retain their generated SPDX file location instead of the source manifest.

Change

Resolve the nearest valid manifest mapping while walking from the SPDX file's directory to the containing vcpkg_installed directory. Each level retains the preference for vcpkg/manifest-info.json over manifest-info.json. The search stays within the nearest installed tree and cannot select a sibling tree's mapping.

The change includes regression tests, updated detector documentation, and a detector version increment. It addresses the source-manifest association portion of #1865; the separate question about explicitly referenced dependencies remains open.

Validation

  • Test-first reproduction: six new cases fail against the original implementation; four additional cases are passing controls. All 20 Vcpkg cases pass with the fix.
  • Debug solution build and analyzers: zero warnings or errors.
  • Linux .NET 10 tests: detector suite 1,416 passed and two existing Windows-only skips; Contracts 132 passed; Orchestrator 170 passed.
  • Real CLI scan of standard, nested, and unlinked on-disk fixtures: all three component locations and dependency-graph locations match the expected source manifest or original SPDX file.

The Common suite has 226 passes, 13 platform skips, and five Docker-dependent failures in this environment. An untouched-base worktree produces the same result for every test. Tests used the standalone Microsoft.Testing.Platform executable because the dotnet test launcher's local IPC is unavailable here. Integration, Windows, and snapshot verification were not run locally.

AI assistance: ChatGPT was used to develop the patch and regression tests.

Use the nearest valid source manifest mapping within the containing
vcpkg_installed tree, including MSBuild triplet-specific install roots.
Preserve preferred and fallback ordering and unmapped SPDX locations.

Addresses source attribution in microsoft#1865.

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.

🟢 Approval recommended

No active review issues are recorded for the nested-root Vcpkg source-manifest attribution changes.

No open issues 🎉

What changed in this PR

Fixes Vcpkg source-manifest attribution for nested MSBuild install roots, addressing the mapping portion of #1865. Explicit dependency classification remains out of scope.

Changes:

  • Finds the nearest valid mapping within the containing installed tree.
  • Adds regression coverage for layouts, mapping precedence, and tree boundaries.
  • Updates documentation and increments the detector version.
File Description
test/​Microsoft.ComponentDetection.Detectors.Tests/​VcpkgComponentDetectorTests.cs Adds manifest-attribution regression tests.
src/​Microsoft.ComponentDetection.Detectors/​vcpkg/​VcpkgComponentDetector.cs Searches ancestor mappings within tree boundaries; increments version.
docs/​detectors/​vcpkg.md Documents mapping precedence and nested-root support.

Review effort: Balanced

@derekpiasecki

derekpiasecki commented Dec 4, 2026 •

Copy link
Copy Markdown

I have only had a chance to review the changes to the code and tests, but they look good. Thanks!

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