Commit 49a3b9e
committed
fix(ffi): Handle PermissionDenied error in copy_with_cp fallback on Windows
The copy_with_cp function in build.rs attempts to use `cp -R` which fails on
Windows, then falls back to `std::fs::copy()`. However, `fs::copy()` cannot
copy directories and throws PermissionDenied on Windows instead of InvalidInput.
This commit extends the error handling to catch both InvalidInput and
PermissionDenied error kinds, routing both to copy_dir_all which properly
handles directory copying across all platforms.
Fixes: Windows builds panicking with PermissionDenied (OS Error 5)1 parent e4beaca commit 49a3b9e
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
93 | 98 | | |
94 | 99 | | |
95 | 100 | | |
| |||
0 commit comments