a1ien / rusb

A safe Rust wrapper for libusb.
Other
382 stars 78 forks source link

Failing to build vendored on Windows 10 #183

Closed mcclure closed 9 months ago

mcclure commented 9 months ago

I check out this repo, check out tag v0.9.3-rusb, and run cargo.exe build --features vendored. It fails with

error: failed to run custom build command for `libusb1-sys v0.6.4 (C:\Users\Andi\work\f\other\rusb\libusb1-sys)`

Caused by:
  process didn't exit successfully: `C:\Users\Andi\work\f\other\rusb\target\debug\build\libusb1-sys-a251194c1ecaa461\build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBUSB_STATIC
  cargo:vendored=1
  cargo:static=1

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 3, kind: NotFound, message: "The system cannot find the path specified." }', libusb1-sys\build.rs:108:6
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I don't know how to interpret this. Line 108 is this unwrap

fs::copy(
        libusb_source.join("libusb/libusb.h"),
        include_dir.join("libusb.h"),
    )
    .unwrap();

There are no other errors or warnings other than a spurious looking warning: functionget_macos_major_versionis never used.

I am on Windows 10 Build 19045. I have Cargo 1.69.0. I was hoping to build vendored because I was having a problem with the vcpkg build (see #182)

a1ien commented 9 months ago

Please clone code with git submodule

mcclure commented 9 months ago

Worked, thanks