This is happening in Zig.Sdk, so this is easiest to reproduce if you're willing to install the .NET SDK.
Basically, do this:
$ git clone git@github.com:alexrp/zig-msbuild-sdk.git
$ dotnet build src/sdk
$ dotnet build src/samples -v:n -p:BuildInParallel=true
That last dotnet build invocation will sometimes hang. So far, it always seems to happen either when building two executables or two dynamic libraries at the same time; building an executable and a dynamic library at the same time appears to be fine. But this might be a red herring.
Attempting to cancel the build...
5>C:\Users\alex\source\repos\zig-msbuild-sdk\pkg\cache\zig.sdk\1.0.1-dev.g5da2354e66\build\Zig.Sdk.Build.targets(7,9): warning MSB5021: Terminating the task executable "zig" and its child processes because the build was canceled. [C:\Users\alex\source\repos\zig-msbuild-sdk\src\samples\clib\clib.cproj]
3>C:\Users\alex\source\repos\zig-msbuild-sdk\pkg\cache\zig.sdk\1.0.1-dev.g5da2354e66\build\Zig.Sdk.Build.targets(7,9): warning MSB5021: Terminating the task executable "zig" and its child processes because the build was canceled. [C:\Users\alex\source\repos\zig-msbuild-sdk\src\samples\cxxlib\cxxlib.cxxproj]
Attempting to cancel the build...
5>C:\Users\alex\source\repos\zig-msbuild-sdk\pkg\cache\zig.sdk\1.0.1-dev.g5da2354e66\build\Zig.Sdk.Build.targets(7,9): warning MSB5021: Terminating the task executable "zig" and its child processes because the build was canceled. [C:\Users\alex\source\repos\zig-msbuild-sdk\src\samples\cxxlib\cxxlib.cxxproj]
7>C:\Users\alex\source\repos\zig-msbuild-sdk\pkg\cache\zig.sdk\1.0.1-dev.g5da2354e66\build\Zig.Sdk.Build.targets(7,9): warning MSB5021: Terminating the task executable "zig" and its child processes because the build was canceled. [C:\Users\alex\source\repos\zig-msbuild-sdk\src\samples\clib\clib.cproj]
Attempting to cancel the build...
2>C:\Users\alex\source\repos\zig-msbuild-sdk\pkg\cache\zig.sdk\1.0.1-dev.g5da2354e66\build\Zig.Sdk.Build.targets(7,9): warning MSB5021: Terminating the task executable "zig" and its child processes because the build was canceled. [C:\Users\alex\source\repos\zig-msbuild-sdk\src\samples\cexe\cexe.cproj]
3>C:\Users\alex\source\repos\zig-msbuild-sdk\pkg\cache\zig.sdk\1.0.1-dev.g5da2354e66\build\Zig.Sdk.Build.targets(7,9): warning MSB5021: Terminating the task executable "zig" and its child processes because the build was canceled. [C:\Users\alex\source\repos\zig-msbuild-sdk\src\samples\cxxexe\cxxexe.cxxproj]
Note: Zig.Sdk normally fetches the Zig compiler (0.8.0) from NuGet but it can be overridden to use a local build by doing dotnet build src/samples -v:n -p:BuildInParallel -p:ZigExePath="path/to/zig". Also, I've seen this happen on all platforms (not just Windows) in CI.
This is happening in
Zig.Sdk, so this is easiest to reproduce if you're willing to install the .NET SDK.Basically, do this:
That last
dotnet buildinvocation will sometimes hang. So far, it always seems to happen either when building two executables or two dynamic libraries at the same time; building an executable and a dynamic library at the same time appears to be fine. But this might be a red herring.Note:
Zig.Sdknormally fetches the Zig compiler (0.8.0) from NuGet but it can be overridden to use a local build by doingdotnet build src/samples -v:n -p:BuildInParallel -p:ZigExePath="path/to/zig". Also, I've seen this happen on all platforms (not just Windows) in CI.