Skip to content

Error creating directory downloads/temp (Windows) #3399

@arthur-tacca

Description

@arthur-tacca

Very often while installing a package that requires a download, the installation will fail with an error about creation of downloads/temp:

CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:72 (file):
  file problem creating directory: C:/src/vcpkg/downloads/temp
Call Stack (most recent call first):
  scripts/cmake/vcpkg_from_github.cmake:106 (vcpkg_download_distfile)
  ports/mypkg1/portfile.cmake:15 (vcpkg_from_github)
  scripts/ports.cmake:72 (include)

After such a failure, downloads/temp does not exist. Running the same command again succeeds, but leaves an empty temp directory behind, ready to trip over the next run of the command. Often runs of vcpkg end up alternating between working and erroring as they alternate between deleting and recreating the directory.

This has been reported before in #3057. That user said the problem mysteriously cleared up for them, but they didn't say they deleted their downloads so I suspect that these were cached and so vcpkg just never attempted to recreate downloads/temp.

I suspected maybe my virus scanner was causing the directory to linger but I tried disabling it and running on another machine with a different virus scanner, but I still had the same problem in both cases. TortoiseGit was not installed (I mention this because of the confusingly similar #3398 I had also been having).

In vcpkg_download_distfile.cmake, perhaps it would be a good idea to insert a short sleep, like 200ms, between the calls to file(REMOVE_RECURSE "${DOWNLOADS}/temp") and file(MAKE_DIRECTORY "${DOWNLOADS}/temp"). I would give that a go on my machines and see if it fixes it for me, but I don't know how to make cmake do a sleep.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions