dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.27k stars 4.73k forks source link

Intermittent build break: "Failed to write the updated manifest to the resource of file..." #83346

Open jkotas opened 1 year ago

jkotas commented 1 year ago

Repro

git clean -x -d -f .
build -s clr -c Release

Result

Intermittently fails with

 cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMa
  ke\CMake\bin\cmake.exe" -E vs_link_exe --intdir=test-watchdog\CMakeFiles\watchdog.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bi
  n\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MIB055~1\2
  022\Preview\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo test-watchdog\CMakeFiles\watchdog.dir\watchdog.
  cpp.obj  /out:test-watchdog\watchdog.exe /implib:test-watchdog\watchdog.lib /pdb:test-watchdog\watchdog.pdb /version:
  0.0 /machine:x64 /guard:cf /DEBUG /PDBCOMPRESS /STACK:1572864 /guard:ehcont /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF /
  INCREMENTAL:NO /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib /subsystem:console   && cd ."
  MT: command "C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe /nologo /manifest test-watchdog\watchdog.exe.manifest
  /outputresource:test-watchdog\watchdog.exe;#1" failed (exit code 0x1f) with the following output:

  mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "test-watchdog\watchdog
  .exe". Access is denied.
ghost commented 1 year ago

Tagging subscribers to this area: @hoyosjs See info in area-owners.md if you want to be subscribed.

Issue Details
Repro: ``` git clean -x -d -f . build -s clr -c Release ``` Result: Intermittently fails with ``` cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMa ke\CMake\bin\cmake.exe" -E vs_link_exe --intdir=test-watchdog\CMakeFiles\watchdog.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bi n\100226~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MIB055~1\2 022\Preview\VC\Tools\MSVC\1436~1.325\bin\Hostx64\x64\link.exe /nologo test-watchdog\CMakeFiles\watchdog.dir\watchdog. cpp.obj /out:test-watchdog\watchdog.exe /implib:test-watchdog\watchdog.lib /pdb:test-watchdog\watchdog.pdb /version: 0.0 /machine:x64 /guard:cf /DEBUG /PDBCOMPRESS /STACK:1572864 /guard:ehcont /INCREMENTAL:NO /LTCG /OPT:REF /OPT:ICF / INCREMENTAL:NO /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib /subsystem:console && cd ." MT: command "C:\PROGRA~2\WI3CF2~1\10\bin\100226~1.0\x64\mt.exe /nologo /manifest test-watchdog\watchdog.exe.manifest /outputresource:test-watchdog\watchdog.exe;#1" failed (exit code 0x1f) with the following output: mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "test-watchdog\watchdog .exe". Access is denied. ```
Author: jkotas
Assignees: -
Labels: `area-Infrastructure-coreclr`
Milestone: -
jkotas commented 1 year ago

cc @ivdiazsa

BruceForstall commented 1 year ago

I'm seeing this locally starting today. I haven't seen it before.

Is it widespread?

@dotnet/runtime-infrastructure

hoyosjs commented 1 year ago

It's been reported in the repo lately, but it's been all over and not just the watchdog. Something changed in how mt updates resources that makes this fail more often lately.

BruceForstall commented 1 year ago

Or maybe our (internal?) anti-virus program is getting in the way more frequently?

janvorli commented 1 year ago

I've been hitting this issue locally quite often recently.

leculver commented 1 year ago

Is there any way to get past this build issue? I after coming back from leave I did a git clean -xdf and now I can't successfully build the repo. Subsequent builds just fail over and over no matter if I try to do an incremental build or if I clean the repo again and try fresh. It's blocking my ability to get any work done.

Edit: Adding an anti-virus exemption to the artifacts folder got me unstuck.

janvorli commented 1 year ago

Edit: Adding an anti-virus exemption to the artifacts folder got me unstuck.

I am still getting this issue even after adding antivirus exemption to the folder, mt.exe or mt.exe directory. It seemed it has fixed it, but then it came back.

leculver commented 1 year ago

Ah, to be clear: It's still happening for me, each incremental build takes about 2-4 attempts to finish.

Adding the exemption meant I can now eventually finish a build. Without the exemption it would happen 100% of the time and the build would never complete.