Vcpkg: Failed to rename files using fs.rename

Created on 28 Nov 2019  Â·  28Comments  Â·  Source: microsoft/vcpkg

Dear developers,

I have cloned a repo today and built+configured vcpkg according to the doc of the README provided, which went fine. The problem is that this command vcpkg install giflib:x86-windows-static (I launched it from powershell as well as all the prior commands) fails with the following output:

Failed to do post-extract rename-in-place.
fs.rename(C:\tools\vcpkg\downloads\tools\powershell-core-6.2.1-windows.partial.2044, C:\tools\vcpkg\downloads\tools\powershell-core-6.2.1-windows, operation not permitted)

No additional information about any crashlog is specified.
I'm using Windows 10 Pro 1803, locale: ru_RU

How can I get over this?
Best regards

vcpkg-bug repro

All 28 comments

Installation of other libs also fails. The errors resemble each other and all point at fs.rename.

@james-frezz seems like a permissions issue, does the userid/login being used have rights to rename files/folders in the vcpkg folder(s)?

@timautry, sure. I run as admin. I checked all the permessions twice or thrice.

I should mention that I actually needed to build tesseract. At first, I tried to do this according to this man. This didn't go smooth and I got the error like the above. So, I went for this and chose the way "For visual studio project using tesseract". It also gave me errors, but I've managed to circumvent them, following these steps:
1) During installation process I had to delete some folders, which couldn't be renamed by fs.rename – the function kept throwing operation not permitted error.
2) I had to delete PREFER NINJA directive manually from each and every portfile.cmake (as advised here)
3) I had to replace vcpkg_get_windows_sdk(WINDOWS_SDK) with set(WINDOWS_SDK "<I opened up one of my Visual Studio solutions and pasted the target SDK-version here>") for OpenGL package portfile. Probably, not the wisest thing to do but it worked still.

These steps helped me to apply vcpkg install tesseract:x64-windows.

On my another machine it works like a charm without these steps, though... I should mention some differences (machine where it works / faulty one):

  1. Windows 10: Home 1903 / Pro 1803
  2. Visual Studio 2017: Community / Professional (Community Edition is also a bit newer)

If you have Visual Studio 2017, consider updating it. As of build 15.9.17 the problems (2) and (3) were gone, but problem (1) persists - fs.rename keeps throwing errors. What are the prerequisities for vcpkg, conisdering folder rights?

@vicroms Can you have a look?

Thanks.

Is there any progress/update on this bug?

@strega-nil Could you have a look?

I have no idea where to even start; could you put in the ACLs for C:\tools\vcpkg?

I'm still getting this, and it basically makes vcpkg useless. It previously worked fine. This seems to have started happening after updating to the latest version, but unfortunately I don't know what version I had previously that was working. Suggestions for manual renaming are not sufficient, as they void the entire purpose for vcpkg in the first place.

The reason is that the function fs.rename seems to have a bug, temporary workaround is to manually rename the file or folder and try again.

That's not a practical work-around. In my case that's happening for basically every package, which, when you are trying to install openimageio, is too many to reasonably do manually.

Ping @dan-shaw.

I've run into this problem a number of times and have always been able to rename the file and restart. However, now I'm trying to run: vcpkg upgrade --no-dry-run. After renaming the file I again try to run upgrade, but I get the following response: All installed packages are up-to-date with the local portfiles.

It's unclear to me how I can proceed....

Most likely it isn't a permissions issue but the target file being locked/open

@swilson314

I've run into this problem a number of times [,,,]

That report sounds more like https://github.com/microsoft/vcpkg/issues/11457 -- vcpkg probably tried to install those prerequisite tools before even determining that changes needed to be applied.

From a fresh install of vcpkg today, this is STILL happening. How long is it going to take before vcpkg is actually usable? Is anyone even actually able to use vcpkg? And no, renaming manually is totally not an acceptable solution.

@etheory I confirm that's a std experimental filesystem bug.

@etheory I confirm that's a std experimental filesystem bug.

Is someone looking at fixing it? I'm quite surprised that it was on the 24th of March that I first reported this and I've come back to see if I can finally use vcpkg, and it still doesn't work :stuck_out_tongue_winking_eye:. Quite honestly though, is EVERYONE out there having to manually rename files to work around this bug, or is it just me?

@etheory I confirm that's a std experimental filesystem bug.

I'm not sure what you mean by this.... if it were a std::experimental::filesystem bug we would be having all users seeing it rather than the small minority in this issue.

Is someone looking at fixing it?

std::experimental::filesystem will not ever be changed, it will be left in a bug for bug compatible state until it is removed. vcpkg should not be trying to use std::experimental::filesystem unless it is built with VS2015.

@BillyONeal I believe we use experimental::filesystem for all bootstraps; this is the problem with building with MSBuild.

I really really want to be able to use vcpkg, but it quite simply doesn't work.

Can I please just get a clear answer as to what the timeframe is for someone to fix this?
I don't accept that it can't be worked around at the code level.
If there really is some issue with std::experimental::filesystem then don't use it.
If someone can show me the part of the code that fails, I'll fix it myself if I have to.

I'm just looking for a clear answer as to how to get this to work.
It's very frustrating waiting for a clear answer and a fix.

Again, are people actually able to use vcpkg, or is it literally broken for everyone?

@etheory I will fix this bug as soon as possible.

@etheory Could you please test #12774?
Thanks.

@etheory Yes, people are able to use it. The problem hasn't been fixed because we have had difficulty reproing it

@etheory Could you please test #12774?
Thanks.

Thanks @JackBoosY I'm testing it now....

It doesn't compile unfortunately.

@etheory it should compile now.

Thanks, it's compiling ;-). I'm adding notes here: https://github.com/microsoft/vcpkg/pull/12774.
Really really appreciate it! Testing now if it can install something. Fingers crossed!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pakdel picture pakdel  Â·  3Comments

oahzuw picture oahzuw  Â·  3Comments

PhilLab picture PhilLab  Â·  3Comments

cjvaijo picture cjvaijo  Â·  3Comments

spindensity picture spindensity  Â·  3Comments