dotnet / dotnet/msbuild

MSB6006 should special case STATUS_CONTROL_C_EXIT

Open
#4,832 0 comments 0 reactions 0 assignees View on GitHub
Area: Debuggability Area: Tasks help wanted triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

When hitting Ctrl-C during a build, if a child tool was terminated by MSBuild as part of cancelation, you will get something like
```
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1235,5): error MSB6006: "Lib.exe" exited with code -1073741510. [C:\git\coreclr\bin\obj\Windows_NT.x64.Release\src\vm
\crossgen\cee_crossgen.vcxproj]
```
-1073741510. of course is 0xC000013A: STATUS_CONTROL_C_EXIT

Since this is "by design" (MSBuild working properly) perhaps this code could special case it and give a message like `error MSB6006: "Lib.exe" exited because it was canceled` which looks less like something different went wrong during cancelation.

https://github.com/microsoft/msbuild/blob/b2db71bebaae4f54f7236ca303e2b0a14aca1a0d/src/Utilities/ToolTask.cs#L383-L386

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/Utilities/ToolTask.cs at the referenced handling around lines 383-386, and trace how the child process exit code is turned into MSB6006 output. Treat 0xC000013A (STATUS_CONTROL_C_EXIT) as cancellation and confirm the resulting message describes cancellation rather than a generic tool failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.