microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.26k stars 6.17k forks source link

[llvm] Build error "LINK : fatal error LNK1168: cannot open bin\llvm-cxxfilt.exe for writing" #33029

Open npeteti555 opened 11 months ago

npeteti555 commented 11 months ago

Operating system

windows

Build system:-

cmake,ninja

Steps to reproduce the behavior

Host Environment:
  Windows
  Compiler: Visual Studio 2022

Build system :- cmake with Ninja generator.

I am facing below issue on windows host intermittently. 

Command:-
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\llvm-cxxfilt\CMakeFiles\llvm-cxxfilt.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1433~1.316\bin\HostX64\x64\link.exe /nologo tools\llvm-cxxfilt\CMakeFiles\llvm-cxxfilt.dir\llvm-cxxfilt.cpp.obj tools\llvm-cxxfilt\CMakeFiles\llvm-cxxfilt.dir\llvm-cxxfilt-driver.cpp.obj tools\llvm-cxxfilt\CMakeFiles\llvm-cxxfilt.dir\__\__\resources\windows_version_resource.rc.res  /out:bin\llvm-cxxfilt.exe /implib:lib\llvm-cxxfilt.lib /pdb:bin\llvm-cxxfilt.pdb /version:0.0 /machine:x64 /STACK:10000000 /debug /INCREMENTAL /subsystem:console  lib\LLVMDemangle.lib  lib\LLVMOption.lib  lib\LLVMSupport.lib  lib\LLVMTargetParser.lib  lib\LLVMSupport.lib  lib\LLVMDemangle.lib  psapi.lib  shell32.lib  ole32.lib  uuid.lib  advapi32.lib  delayimp.lib  -delayload:shell32.dll  -delayload:ole32.dll  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." 

I am running build in parallel mode. I found the same question being asked by someone here:- https://github.com/microsoft/vcpkg/issues/22972

I can run the build w.o any issues with non-parallel mode. Buts its taking very long time to complete the build. So it won't help us running build in non-parallel mode. 
I want to run in parallel mode and get around this issue. 

I want to understand something here:- So above command basically creates 'bin\llvm-cxxfilt.exe' followed by updating/creating respective manifest files. Question is after executable creation and manifest file creation would run as a separate process? 

Note:- Not all the time i hit the issue with same .exe file. Next run might hit the issue with different .exe file. And also it's intermittent issue.

Failure logs

Issue:- LINK : fatal error LNK1168: cannot open bin\llvm-cxxfilt.exe for writing

Additional context

No response

Adela0814 commented 11 months ago

Could you please close your anti-virus and try again?

npeteti555 commented 11 months ago

yes, I don't have any anti virus on my host. I have added my build output folders to exclusion list for security scan.

Just a note that it is highly intermittent. out of 10 runs, i see 4 runs fails with this issue. Is it something to do with manifest file updates?

github-actions[bot] commented 10 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

github-actions[bot] commented 9 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

github-actions[bot] commented 8 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

MonicaLiu0311 commented 1 month ago

yes, I don't have any anti virus on my host. I have added my build output folders to exclusion list for security scan.

Just a note that it is highly intermittent. out of 10 runs, i see 4 runs fails with this issue. Is it something to do with manifest file updates?

Sorry for the late reply, does this problem still exist? If so, could you please provide the manifest file?