microsoft / vcpkg

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

[vcpkg] install <port> --clean-after-build bug deletes all files in vcpkg-root/downloads #11528

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug [vcpkg] install --clean-after-build bug files deletes all files in vcpkg-root/downloads folder. Reference: at end of issue discussion between @Neumann-A and @timautry about --clean-after-build option

Environment

To Reproduce Steps to reproduce the behavior:

  1. /vcpkg install <port> --clean-after-build /vcpkg install <port> <port> <port> --clean-after-build
  2. No errors

Expected behavior --clean-after-build should only delete current downloaded ports in /downloads folder

Failure logs

Additional context

  1. vcpkg install bzip2:x64-windows installs port
  2. /buildtrees, /downloads and /packages all have folders with contents relating to bzip2. good
  3. The /downloads folder also has the appropriate downloaded tools needed by vcpkg. good
  4. vcpkg install zlib:x64-windows --clean-after-build installs port
  5. /buildtrees has both bzip2 and zlib folders, bzip2 has all the original contents, zlib only has the logs created during the build, no source, debug or release folders. good
  6. /packages still has the bzip2 folder but as expected no zlib folder. good
  7. /downloads was completely clean except /tools and /temp folders? question at hand
  8. Question/discussion should --clean-after-build option only delete the ports on the command line or all ports and tools sources from the /downloads folder?
Neumann-A commented 4 years ago

The important point missing here is that it also cleans everything in the download folder if environment variable VCPKG_DOWNLOADS ist set. This is a issue because this is most likely pointing to a common folder between different vcpkg instances. --clean-after-build should probably be split into --clean-buildfiles-after-build, and --clean-downloads-after-build (should probably be a separate command instead?)

ghost commented 4 years ago

The important point missing here is that it also cleans everything in the download folder if environment variable VCPKG_DOWNLOADS ist set. This is a issue because this is most likely pointing to a common folder between different vcpkg instances. --clean-after-build should probably be split into --clean-buildfiles-after-build, and --clean-downloads-after-build (should probably be a separate command instead?)

ghost commented 4 years ago

I close, I no long use product.