Skip to content

Fix NTVS insertion SignCheck: resolve makecat.exe from the Windows SDK - #2556

Merged
lucygramley merged 5 commits into
mainfrom
lucygramley/fix-2982241-makecat-sdk-path
Jul 10, 2026
Merged

Fix NTVS insertion SignCheck: resolve makecat.exe from the Windows SDK#2556
lucygramley merged 5 commits into
mainfrom
lucygramley/fix-2982241-makecat-sdk-path

Conversation

@lucygramley

@lucygramley lucygramley commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

VS insertions of Node.js Tools are rejected by the Insertion Sign Check with 33 unsigned .js/.xml files

Fix

In Nodejs/Product/ProjectAfter.targets:

  • Resolve makecat.exe explicitly from the Windows 10 SDK

The catalog target only runs for signed builds (SignType != ''), so local/dev builds are unaffected.

Verification

  • Property-function resolution validated with MSBuild 17/18: resolves to ...\Windows Kits\10\bin\10.0.26100.0\x64\makecat.exe (exists). The CI agent has the same SDK (it resolves resgen.exe from the Windows SDK in the same build).
  • Full validation: after merge, re-run the NTVS main - nodejstools insertion pipeline (def 20713) to produce a fresh insertion; the new PR's Insertion Sign Check should pass.

Bug: 2982241

lucygramley and others added 5 commits July 9, 2026 09:59
The GenerateContentCatalog target invoked a bare `makecat.exe`, which is not
on PATH on the official build agents. It failed with exit code 9009 and, because
the Exec used IgnoreExitCode=true, the .cat was silently never produced, signed,
or bundled into the VSIX. Insertions therefore shipped 33 unsigned .js/.xml
template files and were rejected by the VS insertion SignCheck.

Resolve makecat.exe explicitly from the Windows 10 SDK (ToolLocationHelper with
a registry fallback) and fail the build loudly if the catalog cannot be produced,
so an unsigned payload can never ship silently again.

Bug: 2982241

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2
makecat.exe cannot hash a 0-byte file: it aborts with 'NOT processed:
calculating the indirect data' / 'Errors found in parsing the CDF file'
and produces no catalog. EmptyJs.js is a 0-byte placeholder template, so
it broke catalog generation once the makecat.exe exit code was no longer
ignored. Filter zero-byte files out of the catalog source list via a
RoslynCodeTaskFactory inline task before writing the CDF.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2
Two bugs prevented the content catalog from actually protecting the
template files, so the build went green while still shipping 32 unsigned
.js/.xml files:

1. _CatalogSourceDir used '..\Nodejs\...' / '..\..\Extras' /
   '..\TestAdapter\...', which resolve one level too high from
   Nodejs\Product\ and do not exist, so zero files were collected and
   makecat never ran (guarded on count > 0).

2. IncludeCatalogInVsix hooked BeforeTargets=CreateVsixContainer, but
   CreateVsixContainer depends on GetVsixSourceItems, which had already
   enumerated the package contents - so the signed .cat was never added
   to the VSIX. Hook BeforeTargets=GetVsixSourceItems instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2
makecat keeps only one entry per member name, so template files that share
a basename across directories (the five UnitTest.js item templates and the
six roletemplatedata.xml cloud-role templates) collided under a single
'<hash>UnitTest.js' / '<hash>roletemplatedata.xml' tag - only the first
was cataloged and the other 9 shipped unsigned. Assign a unique CatTag
(index_filename) per file in the CDF. Verified locally: NodejsToolsVsix
26/26 and TestAdapterVsix 12/12 non-empty js/xml now covered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2
The 0-byte EmptyJs.js template cannot be hashed by makecat, leaving it
uncovered by the content catalog and flagged by the VS Insertion Sign
Check. Add a minimal newline so all 33 shipped template files are
catalog-signed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2
@lucygramley
lucygramley merged commit fdef5bb into main Jul 10, 2026
5 checks passed
lucygramley added a commit that referenced this pull request Aug 19, 2026
#2556)

* Fix content catalog signing: resolve makecat.exe from Windows SDK

The GenerateContentCatalog target invoked a bare `makecat.exe`, which is not
on PATH on the official build agents. It failed with exit code 9009 and, because
the Exec used IgnoreExitCode=true, the .cat was silently never produced, signed,
or bundled into the VSIX. Insertions therefore shipped 33 unsigned .js/.xml
template files and were rejected by the VS insertion SignCheck.

Resolve makecat.exe explicitly from the Windows 10 SDK (ToolLocationHelper with
a registry fallback) and fail the build loudly if the catalog cannot be produced,
so an unsigned payload can never ship silently again.

Bug: 2982241

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Exclude zero-byte files from content catalog

makecat.exe cannot hash a 0-byte file: it aborts with 'NOT processed:
calculating the indirect data' / 'Errors found in parsing the CDF file'
and produces no catalog. EmptyJs.js is a 0-byte placeholder template, so
it broke catalog generation once the makecat.exe exit code was no longer
ignored. Filter zero-byte files out of the catalog source list via a
RoslynCodeTaskFactory inline task before writing the CDF.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Fix catalog source paths and VSIX embedding hook

Two bugs prevented the content catalog from actually protecting the
template files, so the build went green while still shipping 32 unsigned
.js/.xml files:

1. _CatalogSourceDir used '..\Nodejs\...' / '..\..\Extras' /
   '..\TestAdapter\...', which resolve one level too high from
   Nodejs\Product\ and do not exist, so zero files were collected and
   makecat never ran (guarded on count > 0).

2. IncludeCatalogInVsix hooked BeforeTargets=CreateVsixContainer, but
   CreateVsixContainer depends on GetVsixSourceItems, which had already
   enumerated the package contents - so the signed .cat was never added
   to the VSIX. Hook BeforeTargets=GetVsixSourceItems instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Give each catalog member a unique tag to prevent hash drop-out

makecat keeps only one entry per member name, so template files that share
a basename across directories (the five UnitTest.js item templates and the
six roletemplatedata.xml cloud-role templates) collided under a single
'<hash>UnitTest.js' / '<hash>roletemplatedata.xml' tag - only the first
was cataloged and the other 9 shipped unsigned. Assign a unique CatTag
(index_filename) per file in the CDF. Verified locally: NodejsToolsVsix
26/26 and TestAdapterVsix 12/12 non-empty js/xml now covered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Make EmptyJs.js template non-empty so it can be catalog-signed

The 0-byte EmptyJs.js template cannot be hashed by makecat, leaving it
uncovered by the content catalog and flagged by the VS Insertion Sign
Check. Add a minimal newline so all 33 shipped template files are
catalog-signed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Joaquin Jares (joj) pushed a commit that referenced this pull request Aug 24, 2026
#2556)

* Fix content catalog signing: resolve makecat.exe from Windows SDK

The GenerateContentCatalog target invoked a bare `makecat.exe`, which is not
on PATH on the official build agents. It failed with exit code 9009 and, because
the Exec used IgnoreExitCode=true, the .cat was silently never produced, signed,
or bundled into the VSIX. Insertions therefore shipped 33 unsigned .js/.xml
template files and were rejected by the VS insertion SignCheck.

Resolve makecat.exe explicitly from the Windows 10 SDK (ToolLocationHelper with
a registry fallback) and fail the build loudly if the catalog cannot be produced,
so an unsigned payload can never ship silently again.

Bug: 2982241

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Exclude zero-byte files from content catalog

makecat.exe cannot hash a 0-byte file: it aborts with 'NOT processed:
calculating the indirect data' / 'Errors found in parsing the CDF file'
and produces no catalog. EmptyJs.js is a 0-byte placeholder template, so
it broke catalog generation once the makecat.exe exit code was no longer
ignored. Filter zero-byte files out of the catalog source list via a
RoslynCodeTaskFactory inline task before writing the CDF.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Fix catalog source paths and VSIX embedding hook

Two bugs prevented the content catalog from actually protecting the
template files, so the build went green while still shipping 32 unsigned
.js/.xml files:

1. _CatalogSourceDir used '..\Nodejs\...' / '..\..\Extras' /
   '..\TestAdapter\...', which resolve one level too high from
   Nodejs\Product\ and do not exist, so zero files were collected and
   makecat never ran (guarded on count > 0).

2. IncludeCatalogInVsix hooked BeforeTargets=CreateVsixContainer, but
   CreateVsixContainer depends on GetVsixSourceItems, which had already
   enumerated the package contents - so the signed .cat was never added
   to the VSIX. Hook BeforeTargets=GetVsixSourceItems instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Give each catalog member a unique tag to prevent hash drop-out

makecat keeps only one entry per member name, so template files that share
a basename across directories (the five UnitTest.js item templates and the
six roletemplatedata.xml cloud-role templates) collided under a single
'<hash>UnitTest.js' / '<hash>roletemplatedata.xml' tag - only the first
was cataloged and the other 9 shipped unsigned. Assign a unique CatTag
(index_filename) per file in the CDF. Verified locally: NodejsToolsVsix
26/26 and TestAdapterVsix 12/12 non-empty js/xml now covered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

* Make EmptyJs.js template non-empty so it can be catalog-signed

The 0-byte EmptyJs.js template cannot be hashed by makecat, leaving it
uncovered by the content catalog and flagged by the VS Insertion Sign
Check. Add a minimal newline so all 33 shipped template files are
catalog-signed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2f944511-9280-4ed2-aa0c-045bd63b66f2

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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