Skip to content

TortoiseGit causes problems creating and deleting directories (Windows) #3398

@arthur-tacca

Description

@arthur-tacca

I had a very odd problem when using vcpkg, detailed below. It disappeared when I uninstalled TortoiseGit, so it seems to be a problem with that rather than vcpkg, but I thought I should make it known here. Perhaps it is worth noting in some vcpkg documentation.

Sometimes after running vcpkg remove <portname> there would still be a directory left behind in packages/, but in a very odd state. Attempting to access the contents of the directory (e.g. in explorer or command prompt) gives an "Access is Denied" error, and attempting to view the security permissions gives "Unable to display current owner.". Trying to take ownership also gives "Access is Denied" even though I have admin rights. Running vcpkg install <portname> afterwards gives error "file problem creating directory", but manually deleting the directory works fine and solves the vcpkg error. Here is an example output from the failed re-installation attempt:

-- CURRENT_PACKAGES_DIR=C:/src/vcpkg/packages/mypkg1_x64-windows-static
-- CURRENT_BUILDTREES_DIR=C:/src/vcpkg/buildtrees/mypkg1
-- CURRENT_PORT_DIR=c:/src/vcpkg/ports/mypkg1/.
CMake Error at scripts/ports.cmake:68 (file):
  file problem creating directory:
  C:/src/vcpkg/packages/mypkg1_x64-windows-static

I found it suggested in this StackOverflow answer that TortoiseGit could be the cause, and indeed since uninstalling it I have stopped having this problem. I had cloned vcpkg as a git repo rather than just downloading it as a zip, which would explain why TortoiseGit was interacting with it.

For the record, less commonly this problem happened to buildtrees/<portname>/<triplet>. In that case, the error would be inside the build log, and looked like this:

ninja: error: FindFirstFileExA(../../x64-windows-static-dbg): Access is denied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions