a1ien / rusb

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

"vendored" Feature feature is not clearly documented #184

Closed mcclure closed 9 months ago

mcclure commented 9 months ago

The README for this project contains some build documentation.

To use rusb no extra setup is required as rusb will automatically download the source for libusb and build it.

In my testing, at least on Windows (Windows 10, Rust 1.69.0), this does not seem to be true. Rather, the default seems to be that it pulls libusb from vcpkg; and in order to make rusb download the source for libusb and build it, the "vendored" feature must be specified in cargo. As far as vcpkg goes, the next line of the README does say:

However if building libusb fails you can also try setting up the native libusb library where it can be found by pkg-config or vcpkg.

Which is helpful, but it doesn't clearly explain the conditions under which this fallback is used/needed (anytime the "vendored" feature is not present)

"Expected behavior"

Assuming the behavior I'm seeing is intended, the docs should make it clear that "rusb will automatically download the source for libusb and build it" is a behavior exclusive to the "vendored" feature configuration and that "set… up the native libusb library where it can be found by pkg-config or vcpkg" is the default case.

a1ien commented 9 months ago

Documentation is correct you can see that from CI build. https://github.com/a1ien/rusb/actions/runs/5978637711/job/16221135465#step:6:1 https://github.com/a1ien/rusb/actions/runs/5978637711/job/16221135465#step:6:88