Commit 2f34c89
fix --free-up-disk action on windows
Summary:
X-link: facebook/watchman#1314
on windows git checkout sets some files in readonly mode, which can block the free up disk action.
Add a variant of rmtree that checks for this and clears the readonly flag
e.g. failure in https://github.com/facebook/watchman/actions/runs/19267503560/job/55086850056
```
File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\shutil.py", line 629, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\shutil.py", line 627, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'Z:\build\fbthrift\source\.git\objects\pack\pack-1e9bd81db474c833f5ee1eec341f0ae8f4c05a51.idx'
```
Reviewed By: bigfootjon
Differential Revision: D86773115
fbshipit-source-id: f665d43fb70dfe6ee1a8dc596f8cd09ac8a5bf7f1 parent 9212c20 commit 2f34c89
2 files changed
Lines changed: 31 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
0 commit comments