retep998 / winapi-rs

Rust bindings to Windows API
https://crates.io/crates/winapi
Apache License 2.0
1.85k stars 392 forks source link

[Help] crate winapi 0.28 cannot be found #1037

Open StEvUgnIn opened 1 year ago

StEvUgnIn commented 1 year ago

Hello, I am trying to build a repository with dependencies to winapi and kernel32-sys.

I am using a script which calls cargo build.

I added dependencies to my Cargo.toml and to the dependency.

I choose to run cargo build against the dependency, it runs fine.

But it breaks when I am compiling from the repository.

+ RUSTFLAGS='--print native-static-libs -C target-feature=+sse4.1'
+ cargo +nightly-2022-05-09-x86_64-pc-windows-gnu build --release --offline --no-default-features --features multicore-sdr,opencl
+ tee /tmp/tmp.ei5M7SZbOg
   Compiling storage-proofs-porep v12.0.0
error[E0463]: can't find crate for `winapi`
  --> C:\Users\stevu\.cargo\registry\src\github.com-1ecc6299db9ec823\storage-proofs-porep-12.0.0\src\stacked\vanilla\cores.rs:10:1
   |
10 | extern crate winapi;
   | ^^^^^^^^^^^^^^^^^^^^ can't find crate

error[E0463]: can't find crate for `kernel32`
  --> C:\Users\stevu\.cargo\registry\src\github.com-1ecc6299db9ec823\storage-proofs-porep-12.0.0\src\stacked\vanilla\cores.rs:11:1
   |
11 | extern crate kernel32;
   | ^^^^^^^^^^^^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `storage-proofs-porep` due to 2 previous errors
+ rm -f /tmp/tmp.ei5M7SZbOg
make[1]: *** [Makefile:14: .install-filcrypto] Error 101
make[1]: Leaving directory '/c/Users/stevu/lotus-local-net/extern/filecoin-ffi'
make: *** [Makefile:41: build/.filecoin-install] Error 2

The repository I am trying to compile is here: https://github.com/filecoin-project/lotus/tree/ntwk/wallaby

StEvUgnIn commented 1 year ago

Tried running cargo add winapi@0.3 --target "cfg(windows)" --features winuser but fails.