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

[filesystem] Make remove_all remove directories that aren't writable on POSIX. #227

Merged
merged 4 commits into from
Oct 21, 2021

Conversation

BillyONeal
Copy link
Member

Observe this before and after:

@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ./vcpkg install crossguid
Computing installation plan...
The following packages will be built and installed:
    crossguid[core]:x64-linux -> 0.2.2-2018-06-16#2
  * libuuid[core]:x64-linux -> 1.0.3#8
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Restored 2 packages from /home/codespace/.cache/vcpkg/archives in 5.092 ms. Use --debug to see more details.
Starting package 1/2: libuuid:x64-linux
Installing package libuuid[core]:x64-linux...
Elapsed time for package libuuid:x64-linux: 1.517 ms
Starting package 2/2: crossguid:x64-linux
Installing package crossguid[core]:x64-linux...
Elapsed time for package crossguid:x64-linux: 1.12 ms

Total elapsed time: 352.8 ms

The package crossguid provides CMake targets:

    find_package(crossguid CONFIG REQUIRED)
    target_link_libraries(main PRIVATE crossguid)

@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ./vcpkg remove crossguid
The following packages will be removed:
    crossguid:x64-linux
Removing package crossguid:x64-linux...
Failure to remove_all("/workspaces/vcpkg/packages/crossguid_x64-linux") due to file "/workspaces/vcpkg/packages/crossguid_x64-linux/include/crossguid/guid.hpp": Permission denied
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ../vcpkg-tool/build/vcpkg remove crossguid
The following packages are not installed, so not removed:
    crossguid:x64-linux
Package crossguid:x64-linux is not installed
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ../vcpkg-tool/build/vcpkg x-ci-clean
Starting vcpkg CI clean
Clearing contents of /workspaces/vcpkg/buildtrees
Clearing contents of /workspaces/vcpkg/installed
Clearing contents of /workspaces/vcpkg/packages
Completed vcpkg CI clean
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ./vcpkg install crossguid
Computing installation plan...
The following packages will be built and installed:
    crossguid[core]:x64-linux -> 0.2.2-2018-06-16#2
  * libuuid[core]:x64-linux -> 1.0.3#8
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Restored 2 packages from /home/codespace/.cache/vcpkg/archives in 5.771 ms. Use --debug to see more details.
Starting package 1/2: libuuid:x64-linux
Installing package libuuid[core]:x64-linux...
Elapsed time for package libuuid:x64-linux: 1.752 ms
Starting package 2/2: crossguid:x64-linux
Installing package crossguid[core]:x64-linux...
Elapsed time for package crossguid:x64-linux: 1.334 ms

Total elapsed time: 347.1 ms

The package crossguid provides CMake targets:

    find_package(crossguid CONFIG REQUIRED)
    target_link_libraries(main PRIVATE crossguid)

@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ../vcpkg-tool/build/vcpkg remove crossguid
The following packages will be removed:
    crossguid:x64-linux
Removing package crossguid:x64-linux...
@BillyONeal ➜ /workspaces/vcpkg (download-script) $

…on POSIX.

Observe this before and after:

```
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ./vcpkg install crossguid
Computing installation plan...
The following packages will be built and installed:
    crossguid[core]:x64-linux -> 0.2.2-2018-06-16#2
  * libuuid[core]:x64-linux -> 1.0.3#8
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Restored 2 packages from /home/codespace/.cache/vcpkg/archives in 5.092 ms. Use --debug to see more details.
Starting package 1/2: libuuid:x64-linux
Installing package libuuid[core]:x64-linux...
Elapsed time for package libuuid:x64-linux: 1.517 ms
Starting package 2/2: crossguid:x64-linux
Installing package crossguid[core]:x64-linux...
Elapsed time for package crossguid:x64-linux: 1.12 ms

Total elapsed time: 352.8 ms

The package crossguid provides CMake targets:

    find_package(crossguid CONFIG REQUIRED)
    target_link_libraries(main PRIVATE crossguid)

@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ./vcpkg remove crossguid
The following packages will be removed:
    crossguid:x64-linux
Removing package crossguid:x64-linux...
Failure to remove_all("/workspaces/vcpkg/packages/crossguid_x64-linux") due to file "/workspaces/vcpkg/packages/crossguid_x64-linux/include/crossguid/guid.hpp": Permission denied
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ../vcpkg-tool/build/vcpkg remove crossguid
The following packages are not installed, so not removed:
    crossguid:x64-linux
Package crossguid:x64-linux is not installed
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ../vcpkg-tool/build/vcpkg x-ci-clean
Starting vcpkg CI clean
Clearing contents of /workspaces/vcpkg/buildtrees
Clearing contents of /workspaces/vcpkg/installed
Clearing contents of /workspaces/vcpkg/packages
Completed vcpkg CI clean
@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ./vcpkg install crossguid
Computing installation plan...
The following packages will be built and installed:
    crossguid[core]:x64-linux -> 0.2.2-2018-06-16#2
  * libuuid[core]:x64-linux -> 1.0.3#8
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Restored 2 packages from /home/codespace/.cache/vcpkg/archives in 5.771 ms. Use --debug to see more details.
Starting package 1/2: libuuid:x64-linux
Installing package libuuid[core]:x64-linux...
Elapsed time for package libuuid:x64-linux: 1.752 ms
Starting package 2/2: crossguid:x64-linux
Installing package crossguid[core]:x64-linux...
Elapsed time for package crossguid:x64-linux: 1.334 ms

Total elapsed time: 347.1 ms

The package crossguid provides CMake targets:

    find_package(crossguid CONFIG REQUIRED)
    target_link_libraries(main PRIVATE crossguid)

@BillyONeal ➜ /workspaces/vcpkg (download-script) $ ../vcpkg-tool/build/vcpkg remove crossguid
The following packages will be removed:
    crossguid:x64-linux
Removing package crossguid:x64-linux...
@BillyONeal ➜ /workspaces/vcpkg (download-script) $
```
src/vcpkg/base/files.cpp Outdated Show resolved Hide resolved
@strega-nil-ms strega-nil-ms self-requested a review October 21, 2021 18:12
@BillyONeal BillyONeal merged commit 470ef33 into microsoft:main Oct 21, 2021
@BillyONeal BillyONeal deleted the make-directories-writable branch October 21, 2021 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants