twitchyliquid64 / usbd-hid

MIT License
88 stars 37 forks source link

Old versions fail to build since 0.8 released [fixed] [readme] #73

Closed andrewdavidmackenzie closed 3 months ago

andrewdavidmackenzie commented 3 months ago

Getting this failure, via another dependency:

   Compiling usbd-hid-macros v0.6.0
   Compiling embedded-storage-async v0.4.1
error[E0277]: the trait bound `usbd_hid_descriptors::MainItemKind: From<std::string::String>` is not satisfied
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/usbd-hid-macros-0.6.0/src/spec.rs:512:43
    |
512 |             self.set_item(name, item_kind.into(), settings, bits, quirks);
    |                                           ^^^^ the trait `From<std::string::String>` is not implemented for `usbd_hid_descriptors::MainItemKind`, which is required by `std::string::String: Into<_>`
    |
    = help: the trait `From<&str>` is implemented for `usbd_hid_descriptors::MainItemKind`
    = help: for that trait implementation, expected `&str`, found `std::string::String`
    = note: required for `std::string::String` to implement `Into<usbd_hid_descriptors::MainItemKind>`

   Compiling service-manager v0.6.2
For more information about this error, try `rustc --explain E0277`.
error: could not compile `usbd-hid-macros` (lib) due to 1 previous error

in my daily GH Action:

https://github.com/andrewdavidmackenzie/pingr/actions/runs/9961190117/job/27522157317#step:6:491

twitchyliquid64 commented 3 months ago

I wrote the first version of this in 2020, in the first few months of writing Rust, and foolishly put the >= specifier on the inter-crate version specifiers. This exploded a few days ago when the macros crate was no longer compatible with all older versions.

I don't really know a way to fix this without everyone upgrading to usbd-hid 0.8 :(

If anyone has any ideas for how to fix this for the 0.6 or 0.7 series please let me know. Sorry again.

andrewdavidmackenzie commented 3 months ago

My particular problem will be solved by a.version update "upstream" in embasy-usb-logger.....

twitchyliquid64 commented 3 months ago

To everyone following along, heres how to fix your build:

  1. If you can, use the 0.8 series. 0.8.2 specifically at time of writing.
  2. If you can't, use a patch for the 0.6 or 0.7 series. Those are either: 0.6.2 or 0.7.1.

Sorry about this.