cotton
cotton copied to clipboard
feat: Windows Support
It would be nice to see this running on Windows as well.
It seems to stuck on some unix permission handling, which is obviously not available in Windows. The following errors occur during compilation:
error[E0433]: failed to resolve: could not find `unix` in `os`
--> src\plan.rs:16:9
|
16 | os::unix::prelude::PermissionsExt,
| ^^^^ could not find `unix` in `os`
error[E0432]: unresolved import `tokio::fs::symlink`
--> src\plan.rs:22:91
|
22 | create_dir_all, metadata, read_dir, remove_dir_all, remove_file, set_permissions, symlink,
| ^^^^^^^ no `symlink` in `fs`
error[E0433]: failed to resolve: could not find `sys` in `nix`
--> src\main.rs:18:10
|
18 | use nix::sys::signal::{self, Signal};
| ^^^ could not find `sys` in `nix`
error[E0432]: unresolved import `nix::sys`
--> src\main.rs:18:10
|
18 | use nix::sys::signal::{self, Signal};
| ^^^ could not find `sys` in `nix`
error[E0432]: unresolved import `nix::unistd`
--> src\main.rs:19:10
|
19 | use nix::unistd::Pid;
| ^^^^^^ could not find `unistd` in `nix`
error[E0599]: no function or associated item named `from_mode` found for struct `std::fs::Permissions` in the current scope
--> src\plan.rs:261:60
|
261 | if set_permissions(&bin_path, Permissions::from_mode(0o755))
| ^^^^^^^^^ function or associated item not found in `std::fs::Permissions`
Windows support is a planned feature. Unfortunately, I do not have access to a development environment on Windows at this moment. In the meantime, using WSL (Windows Subsystem for Linux) should work.
I'd love to use this in a Python project my team works on (PythonMonkey) which uses NPM during pip install. Replacing NPM with a binary would mean we wouldn't require npm to be installed to use our library
However we'd need Windows support
I'll see if I can take a look and submit a patch to get this working - but no promises 😃