Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent failure to rename buildtrees results in build failure #8199

Closed
rleigh-codelibre opened this issue Sep 16, 2019 · 17 comments
Closed
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) requires:repro The issue is not currently repro-able

Comments

@rleigh-codelibre
Copy link
Contributor

rleigh-codelibre commented Sep 16, 2019

Vcpkg version: 2019.09.12-nohash

Describe the bug
Failed rename of buildtree causes build failure. I thought it might be similar to the docker-related rename failure filed previously, but that's at download time and in a container. This is after download on native Windows on NTFS on a fast NVMe drive, and the error is different. In fact, the error string is "No error". I have seen this failure a few times now.

There's the possibility that anti-virus scanning might be at play here, and I am re-testing with the vcpkg tree excluded explicitly. However, the ticket might be useful for anyone else experiencing the same failure scenario. If things outside the control of vcpkg are preventing simple filesystem operations from completing, it might be worth looking at a limited number of backoffs and retries as a mitigation. Or implementing the same directly in CMake.

Environment

  • OS: Windows 10 x64
  • Compiler: VS2019

To Reproduce
Steps to reproduce the behavior:

  1. .\vcpkg.exe install boost qt5 xerces-c xalan-c

Expected behavior
Successful build

Failure logs

Installing package double-conversion[core]:x86-windows... done
Elapsed time for package double-conversion:x86-windows: 1.03 min
Starting package 61/95: ragel:x86-windows
Building package ragel[core]:x86-windows...
-- Downloading http://www.colm.net/files/ragel/ragel-6.10.tar.gz...
-- Extracting source C:/Users/rleigh/code/vcpkg/downloads/ragel-6.10.tar.gz
-- Applying patch C:/Users/rleigh/code/vcpkg/ports/ragel/0001-Remove-unistd.h-include-1.patch
-- Applying patch C:/Users/rleigh/code/vcpkg/ports/ragel/0002-Remove-unistd.h-include-2.patch
-- Configuring x86-windows
-- Building x86-windows-dbg
-- Building x86-windows-rel
-- Performing post-build validation
-- Performing post-build validation done
Building package ragel[core]:x86-windows... done
Installing package ragel[core]:x86-windows...
Installing package ragel[core]:x86-windows... done
Elapsed time for package ragel:x86-windows: 40.22 s
Starting package 62/95: harfbuzz:x86-windows
Building package harfbuzz[core,ucdn]:x86-windows...
-- Downloading https://github.com/harfbuzz/harfbuzz/archive/2.5.3.tar.gz...
-- Extracting source C:/Users/rleigh/code/vcpkg/downloads/harfbuzz-harfbuzz-2.5.3.tar.gz
-- Applying patch 0001-fix-cmake-export.patch
-- Applying patch 0002-fix-uwp-build.patch
-- Applying patch 0003-remove-broken-test.patch
-- Applying patch find-package-freetype-2.patch
-- Applying patch glib-cmake.patch
CMake Error at scripts/cmake/vcpkg_extract_source_archive_ex.cmake:123 (file):
  file RENAME failed to rename

    C:/Users/rleigh/code/vcpkg/buildtrees/harfbuzz/src/TEMP/harfbuzz-2.5.3

  to

    C:/Users/rleigh/code/vcpkg/buildtrees/harfbuzz/src/2.5.3-984271955b

  because: No error

Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_github.cmake:114 (vcpkg_extract_source_archive_ex)
  ports/harfbuzz/portfile.cmake:3 (vcpkg_from_github)
  scripts/ports.cmake:91 (include)
@PhoebeHui PhoebeHui added the requires:repro The issue is not currently repro-able label Sep 18, 2019
@PhoebeHui
Copy link
Contributor

@rleigh-codelibre, I can't repro this issue, can you delete harfbuzz folder under buildtrees and try again? does it repro?

@rleigh-codelibre
Copy link
Contributor Author

rleigh-codelibre commented Sep 23, 2019

The failure occurs fairly randomly. I can reproduce consistently with antivirus enabled (Kaspersky). This is the most recent failure:

vcpkg.exe install boost:x64-windows qt5:x64-windows xalan-c:x64-windows
[...]
Building package libpq[core]:x64-windows...
-- Downloading https://ftp.postgresql.org/pub/source/v9.6.3/postgresql-9.6.3.tar.bz2...
-- Extracting source C:/Users/rleigh/code/vcpkg-test/downloads/postgresql-9.6.3.tar.bz2
CMake Error at scripts/cmake/vcpkg_extract_source_archive_ex.cmake:123 (file):
  file RENAME failed to rename

    C:/Users/rleigh/code/vcpkg-test/buildtrees/libpq/src/TEMP/postgresql-9.6.3

  to

    C:/Users/rleigh/code/vcpkg-test/buildtrees/libpq/src/stgresql-9-d40671c654

  because: No such file or directory

Call Stack (most recent call first):
  ports/libpq/portfile.cmake:13 (vcpkg_extract_source_archive_ex)
  scripts/ports.cmake:91 (include)

additional repeat:

Building package boost-multiprecision[core]:x64-windows... done
Installing package boost-multiprecision[core]:x64-windows...
Installing package boost-multiprecision[core]:x64-windows... done
Elapsed time for package boost-multiprecision:x64-windows: 6.578 s
Starting package 59/190: boost-math:x64-windows
Building package boost-math[core]:x64-windows...
-- Using cached C:/Users/rleigh/code/vcpkg-test/downloads/boostorg-math-boost-1.70.0.tar.gz
-- Extracting source C:/Users/rleigh/code/vcpkg-test/downloads/boostorg-math-boost-1.70.0.tar.gz
CMake Error at scripts/cmake/vcpkg_extract_source_archive_ex.cmake:123 (file):
  file RENAME failed to rename

    C:/Users/rleigh/code/vcpkg-test/buildtrees/boost-math/src/TEMP/math-boost-1.70.0

  to

    C:/Users/rleigh/code/vcpkg-test/buildtrees/boost-math/src/ost-1.70.0-c9d9eb13aa

  because: No such file or directory

Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_github.cmake:114 (vcpkg_extract_source_archive_ex)
  ports/boost-math/portfile.cmake:5 (vcpkg_from_github)
  scripts/ports.cmake:91 (include)

and

Installing package boost-multiprecision[core]:x64-windows... done
Elapsed time for package boost-multiprecision:x64-windows: 5.94 s
Starting package 59/190: boost-math:x64-windows
Building package boost-math[core]:x64-windows...
-- Using cached C:/Users/rleigh/code/vcpkg-test/downloads/boostorg-math-boost-1.70.0.tar.gz
-- Extracting source C:/Users/rleigh/code/vcpkg-test/downloads/boostorg-math-boost-1.70.0.tar.gz
CMake Error at scripts/cmake/vcpkg_extract_source_archive_ex.cmake:123 (file):
  file RENAME failed to rename

    C:/Users/rleigh/code/vcpkg-test/buildtrees/boost-math/src/TEMP/math-boost-1.70.0

  to

    C:/Users/rleigh/code/vcpkg-test/buildtrees/boost-math/src/ost-1.70.0-c9d9eb13aa

  because: No such file or directory

Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_github.cmake:114 (vcpkg_extract_source_archive_ex)
  ports/boost-math/portfile.cmake:5 (vcpkg_from_github)
  scripts/ports.cmake:91 (include)


Error: Building package boost-math:x64-windows failed with: BUILD_FAILED

With antivirus disabled, the rename failures seem to stop. However, I've not repeated the test enough times to be certain that it never occurs.

@PhoebeHui
Copy link
Contributor

This issue seems to happen more and more frequently. However, I still not repro this issue on my local machine.

@PhoebeHui PhoebeHui added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Mar 27, 2020
@dhalucario
Copy link

I have the same problem here with Kaspersky and Windows 10.

@AjitDingankar
Copy link

Re #10218 mentioned above, I have McAfee on my work laptop and can't turn it off to test whether the problem is due to antivirus.

@theidexisted
Copy link
Contributor

theidexisted commented Apr 28, 2020

I have reproduced a similar issue on my VMware hosts Windows server 2008

 Failed to do post-extract rename-in-place

This may be caused by the virtual machine's file system. And manually rename the folder can work around it.

@charliekang
Copy link

charliekang commented May 2, 2020

https://gitlab.kitware.com/cmake/cmake/commit/7b1f966a6c456270004a2aec2c53057ca8efbac9

Can try registry keys
For cmake 3.17, had to up to 120 & 1000 (from 60,500)

@palmada
Copy link

palmada commented May 18, 2020

Getting the same error on Windows 10, no anti-virus.

CMake Error at scripts/cmake/vcpkg_extract_source_archive_ex.cmake:140 (file):
  file RENAME failed to rename

    D:/Code/VCPKG/buildtrees/boost-math/src/TEMP/math-boost-1.73.0

  to

    D:/Code/VCPKG/buildtrees/boost-math/src/ost-1.73.0-0b998d205c

  because: No such file or directory

Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_github.cmake:139 (vcpkg_extract_source_archive_ex)
  ports/boost-math/portfile.cmake:3 (vcpkg_from_github)
  scripts/ports.cmake:90 (include)


Error: Building package boost-math:x64-windows failed with: BUILD_FAILED

@senevoldsen
Copy link

I am getting the exact same error as @palmada . Vcpkg excluded from anti-virus scanning.

@MSUNDGR1
Copy link

MSUNDGR1 commented Jul 7, 2020

I am also getting the same error as @palmada

@HLXEasy
Copy link

HLXEasy commented Aug 30, 2020

Any news on this? Tried to update Boost to 1.73 but this build issue is still the same. :-(

@Benjamin-Miller1
Copy link

Benjamin-Miller1 commented Aug 31, 2020

I can't install protobuf at all when this issue exists. What can i do next?

I use the latest version of master.

the error message:
CMake Error at scripts/cmake/vcpkg_extract_source_archive_ex.cmake:147 (file):
file RENAME failed to rename

F:/vcpkg/buildtrees/protobuf/src/a5c431386a-c9deea9e31.tmp/protobuf-fde7cf7358ec7cd69e8db9be4f1fa6a5c431386a

to

F:/vcpkg/buildtrees/protobuf/src/a5c431386a-c9deea9e31.clean

because: No error

Call Stack (most recent call first):
scripts/cmake/vcpkg_from_github.cmake:139 (vcpkg_extract_source_archive_ex)
ports/protobuf/portfile.cmake:1 (vcpkg_from_github)
scripts/ports.cmake:79 (include)

@dhalucario
Copy link

So far the problem fix was always to TEMPORARILY disable your anti-virus. I know it's not a permanent solution but that's the only solution we have so far I guess.

@HLXEasy
Copy link

HLXEasy commented Aug 31, 2020

Indeed, that's working as a quick fix. Thx!

@rafalsk
Copy link

rafalsk commented Mar 24, 2021

seems like in the end it got me also:
https://stackoverflow.com/questions/66779031/vcpkg-auto-generated-patch-fails-to-apply-wrong-paths

No anti-virus.

Confirmed that this occurs RANDOMLY.

@Cheney-W
Copy link
Contributor

I can't reproduce this issue with the latest vcpkg(2021-08-03-1a6d67b8150e94b7f473c6ab1c0cfd) and VS2019 16.10.4,

@Cheney-W
Copy link
Contributor

Thanks for posting this issue. This issue hasn’t been updated in five months. Please reopen this issue if this is still a problem for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests