andrew-d / leveldb-rs

Bindings to LevelDB for Rust
6 stars 5 forks source link

leveldb-sys won’t compile on Windows #9

Open chris-morgan opened 8 years ago

chris-morgan commented 8 years ago

It’s depending on std::os::unix which isn’t available on Windows:

error[E0432]: unresolved import `std::os::unix::fs::PermissionsExt`
 --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\leveldb-sys-2.0.0\src/build.rs:6:5
  |
6 | use std::os::unix::fs::PermissionsExt;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not find `unix` in `std::os`

error: no method named `mode` found for type `std::fs::Permissions` in the current scope
   --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\leveldb-sys-2.0.0\src/build.rs:173:30
    |
173 |     let current_mode = perms.mode();
    |                              ^^^^

error: no method named `set_mode` found for type `std::fs::Permissions` in the current scope
   --> C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\leveldb-sys-2.0.0\src/build.rs:174:11
    |
174 |     perms.set_mode(0o100 | current_mode);
    |           ^^^^^^^^

error: aborting due to 2 previous errors

Setting +x isn’t relevant on Windows, so that can just be stubbed out on Windows. But then the dependence on make crops up:

error: failed to run custom build command for `leveldb-sys v0.0.3 (file:///C:/code/leveldb-rs/leveldb-sys)`
process didn't exit successfully: `C:\code\leveldb-rs\target\debug\build\leveldb-sys-6748e155eb840c8f\build-script-build` (exit code: 101)
--- stdout
[build] Started
[build] Patching the `build_detect_platform` template
[build] Patching complete
[leveldb] Cleaning

--- stderr
thread 'main' panicked at 'clean failed', ../src/libcore\option.rs:705
note: Run with `RUST_BACKTRACE=1` for a backtrace.

In short, more work is needed to make it run smoothly on Windows.

I think the gcc crate is all about this sort of thing?