cholcombe973 / block-utils

Rust utilities for working with block devices
MIT License
22 stars 17 forks source link

Does not compile on Windows #13

Open ChrisGreenaway opened 4 years ago

ChrisGreenaway commented 4 years ago

I understand that this is clearly not designed to work on Windows, but it would be good to at least have this library compile on Windows, even if it just gives Err() when invoked.

We have a mixture of development environments (although all deployment is Linux) and I don't want to break the Windows based workflow by introducing this as a dependency.

BTW - the project looks really nice - I don't understand why your recent download stats are so low: https://crates.io/crates/block-utils

cholcombe973 commented 4 years ago

Yeah I understand where you're coming from. I develop on a mac locally but deploy into production linux environments and it's not great when the libraries won't compile locally. I don't have a windows environment to test on. Would it be possible for you to setup a PR for this? Hard to say why the download stats are low. Maybe I didn't do a great job explaining the libraries purpose in the readme.

ChrisGreenaway commented 4 years ago

I'm sorry, but I don't have enough invested in this library to make a PR for you. This was just an obvious blocker to adoption for us. However, I can give you the errors that I get when trying to compile:

$ cargo build
   Compiling block-utils v0.8.2
error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\CGRE\.cargo\registry\src\github.com-1ecc6299db9ec823\block-utils-0.8.2\src\lib.rs:24:14
   |
24 | use std::os::unix::fs::MetadataExt;
   |              ^^^^ could not find `unix` in `os`

error[E0599]: no method named `dev` found for struct `std::fs::Metadata` in the current scope
    --> C:\Users\CGRE\.cargo\registry\src\github.com-1ecc6299db9ec823\block-utils-0.8.2\src\lib.rs:1062:28
     |
1062 |         if parent_metadata.dev() != dir_metadata.dev() {
     |                            ^^^ method not found in `std::fs::Metadata`

error[E0599]: no method named `dev` found for struct `std::fs::Metadata` in the current scope
    --> C:\Users\CGRE\.cargo\registry\src\github.com-1ecc6299db9ec823\block-utils-0.8.2\src\lib.rs:1062:50
     |
1062 |         if parent_metadata.dev() != dir_metadata.dev() {
     |                                                  ^^^ method not found in `std::fs::Metadata`

error: aborting due to 3 previous errors