Skip to content

Bubble up child process errors in IndexCreationTool#6261

Open
pl4nty wants to merge 2 commits into
microsoft:masterfrom
devicie:bubble-IndexCreationTool-errors
Open

Bubble up child process errors in IndexCreationTool#6261
pl4nty wants to merge 2 commits into
microsoft:masterfrom
devicie:bubble-IndexCreationTool-errors

Conversation

@pl4nty

@pl4nty pl4nty commented May 31, 2026

Copy link
Copy Markdown

📖 Description

IndexCreationTool can run several child processes. If any of them fails, index creation has partially failed and I expect an exception, but IndexCreationTool exits 0. This PR throws an exception with the exit code and command/args to assist with debugging. I also updated makeappx unpack to use the shared RunCommand function.

I suspect IndexCreationTool isn't a stable/supported dependency, but thought this was worth submitting anyway.

🔗 References

Example SignTool error: https://github.com/pl4nty/winget-extras/actions/runs/26671649037/job/78615909376

🔍 Validation

I don't have a VS toolchain on hand, so I'd love if someone can run the ADO tests on this PR. Then I'll validate in my CI from the built IndexCreationTool.

✅ Checklist

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

@pl4nty pl4nty requested a review from a team as a code owner May 31, 2026 00:57
@pl4nty pl4nty marked this pull request as draft May 31, 2026 00:58
florelis
florelis previously approved these changes Jun 1, 2026
@florelis

florelis commented Jun 1, 2026

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pl4nty pl4nty marked this pull request as ready for review June 8, 2026 11:37
"Input": "%BUILD_SOURCESDIRECTORY%/src/AppInstallerCLIE2ETests/TestData/AppInstallerTestFont.ttf",
"HashToken": "<FONTHASH>"
"HashToken": "<FONTHASH>",
"SkipSignature": true

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.

Why skip the signature?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

signtool can't sign fonts without a SIP and font-specific key formats. my change bubbled up the error and caused test failures, but I believe this is the only one. couldn't get e2e tests fully working locally though

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Signed-off-by: Tom Plant <tom.plant@devicie.com>
@pl4nty pl4nty force-pushed the bubble-IndexCreationTool-errors branch from c9951d1 to 2dc8196 Compare June 12, 2026 11:37
Not supported by signtool without SIP etc
@JohnMcPMS

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@pl4nty

pl4nty commented Jul 7, 2026

Copy link
Copy Markdown
Author

I've spent a while trying to reproduce these E2E test failures locally, but haven't been able to. Could they just be flaky? They seem stable in the ADO reports, but I was surprised that x86 failed when x64 succeeded. Maybe it's worth retrying after #6354 is merged?

@JohnMcPMS

Copy link
Copy Markdown
Member

I've spent a while trying to reproduce these E2E test failures locally, but haven't been able to. Could they just be flaky? They seem stable in the ADO reports, but I was surprised that x86 failed when x64 succeeded. Maybe it's worth retrying after #6354 is merged?

It appears to be the ADO image version; x86 ran with the newer one and x64 the older one.

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 improves reliability of IndexCreationTool/WinGetSourceCreator by ensuring failures from invoked child processes (e.g., signtool, makeappx) propagate as exceptions instead of allowing a successful (0) exit after partial failure. It also updates E2E local source test data to avoid attempting to sign an installer type that should not be signed.

Changes:

  • Update WinGetSourceCreator’s shared RunCommand helper to throw when a child process exits non-zero.
  • Refactor makeappx unpack to use the shared RunCommand helper (so failures are surfaced consistently).
  • Update E2E localsource.json to set SkipSignature: true for the font installer.

Reviewed changes

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

File Description
src/WinGetSourceCreator/Helpers.cs Centralizes child process failure handling by throwing on non-zero exit codes (and refactors makeappx unpack to use the shared helper).
src/AppInstallerCLIE2ETests/TestData/localsource.json Prevents signing for the font test installer via SkipSignature, aligning test data with the tool’s signing behavior.

Comment on lines +137 to +140
if (p.ExitCode != 0)
{
throw new Exception($"Command failed with exit code {p.ExitCode}: {command} {args}");
}

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.

Maybe we could just include {command}.
In the pipelines this shouldn't be an issue, since Azure Pipelines automatically replaces any secret with ***, but still seems worth changing.

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.

4 participants