-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer manufacturer and model information from device over udev database #137
Prefer manufacturer and model information from device over udev database #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I would see a problem with this released in a patch release but I think it is fine for a minor release. The API does not break in the sense that it continues to compile, it just provides different strings. I would not see that information as SemVer-breaking.
I would like to avoid the unscape
dependency, though. That crate seems rather abandoned.
Thanks for your feedback and starting the discussion @eldruin!
If a minor release prevents automatic updates by If minor updates would happen automatically by Cargo, I would prefer, postponing this change to the next major release and put it behind a feature gate until then.
It definitely looks like being abandoned. Do you know of a worthy alternative? I've seen unescape-rs/#8 recommending unescaper, but it is released only under GPLv3 and therefor not compatible with the licensing of serialport-rs. Started the discussion for dual-licensing unescape-rs with hack-ink/unescaper#26. On the other hand is the code from unescape sufficiently simple and according to the stats on crates.io it is still well used today. If there is serious trouble with this unescape, I would espect it to pop up as a RUSTSEC advisory which will show in CI. Maintaining our own unescape code and tests does not seem worth it to me in the first place. And as unescape as a dependency is used only internally, we could switch to another crate or own implementation at any time. With that said, how would you prefer to continue with unescaping? I have no strong opinion yet. |
Hi, you can now use https://github.com/hack-ink/unescaper/releases/tag/v0.1.3. :) |
Thank you very much @AurevoirXavier for your quick response and action! Now reality kicks in and I see that should have spent some thoughts on the compatibility of Rust versions and Cargo features beforehand. But I just built with the latest release of Rust locally and did not spot this incompatibility in the first place. 🤦 I will think about how we could get this resolved ... |
It's already 2023, almost 2024. I highly recommend that you all upgrade to at least the 2021 edition. |
This is indeed a good point @AurevoirXavier. One (if not the only) reason for sticking to this old MSRV is the support or the latest Yocto LTS (Kirkstone) release for being able to build serialport-rs in this environment. And to disclose my affiliation with it: I'm doing this at my day job and I am therefor opinionated on this. While writing this comment, I saw that the next LTS (Nanbield) is out since some days and ships with Rust 1.70. So a bigger bump is within reach. But back to business: Our current MSRV already allows using the 2021 edition and I don't know for which reason (if any) we are still using the 2018 edition. If I had to guess I would assume that there was no focus on the edition when bumping MSRV in the past. To my understanding, the Rust edition is a choice which just affects how serialport-rs is build and is independent of the edition chosen by its dependencies. What actually matters is the Version of Cargo we are using and its feature named-profiles got stabilized with 1.57. And now the good news: Yocto Kirkstone's Rust support has been bumped to 1.59.0 this spring and updating our MSRV to this release would buy us out in the sort term. See this test and its build. |
What's your opinion on bumping our MSRV to 1.59.0 with a minor release @jessebraham and @eldruin. I'm asking because during my testing I figure out that our examples no longer build with 1.56.1 due to an MSRV upgrade from a dev sub-dependency. Its serialport > clap > clap_lex > os_str_bytes which bumped its MSRV with the release 6.6.0 to 1.60.1 with a minor release. I learned that the resolver automatically increases minor releases for versions 1.0.0 and above ( I also learned today that our MSRV is even behind the Rust release shipped with Debian stable. 😂 So I bet bumping our MSRV to 1.59.0 likely only affects people building our crate in a well aged Yocto environment and I'm inclined to being fine with bumping our MSRV with a minor release. In the lesson above I also learned that our examples don't build with 1.56.1/1.59.0 because |
Would you be fine with using unescaper @eldruin? |
I think that's reasonable. I had actually bumped this library to |
We have stuck to Rust 1.56.1 for a while for supporting the oldest LTS release of Yocto (Kirkstone). This release bumped its Rust support to 1.59.0 in March 2023. Let's take this to our advantage and gain the option to allow for example dependencies using Cargos named-profiles (which got stabilized with Cargo 1.57).
Previously the information taken from libudev's database based on vendor and product ID was given priority over the actual info from the device descriptor. This information is often less accurate for specialized devices and makes selecting them based on this information harder. We'll do it the other way around now and also restore spaces previously replaced with underscores by libudev.
A big shoutout to AurevoirXavier for dual-licensing this crate on request!
Let's be nice and check the MSRV (at least once) for each supported platform according to `README.md`. We differentiate Linux further with respect to udev/musl, so it gets a special treatment. Our examples currently do not build with MSRV. Let's work around this by not building them for the new MSRV check msrv-x86_64-unknown-linux-musl for now.
aaed851
to
22d628b
Compare
Updated MSRV and docs as well. Also extended the MSRV checks in CI to all platforms mentioned in README (with Linux getting some special treatment with respect to udev and Sysfs/musl). Any objections against merging @eldruin and @jessebraham? And since we've accumulated some fixes since 4.2.2: Any objections with cutting a new release 4.3.0 then? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was unexpectedly out for a few days.
Thank you for all your work and for going through all of this.
Bumping the MSRV to 1.59.0 sounds fine to me since we keep kirkstone working.
Using unscaper
is fine since the license is now compatible. Thank you both for that!
About whether this crate would be updated by cargo update
or not in some client code: it depends on their dependency specification. For example, if we release this in 4.3.0, if their Cargo.toml
says serialport = "4"
or serialport = "4.2"
, it will be updated. If it says serialport = "4.2.0"
it will not be, for example. That is all documented here.
I would favor a 4.3.0 release indeed.
22d628b
to
44fad30
Compare
Had a quick and dirty check on our reverse dependencies on crates.io with this gist and it looks like there are only some pretty old versions of
and there are no reverse dependencies to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!
Yes, a new release with #141 as well sounds good.
serialport::available_ports()
returns generic USB strings instead of actual descriptor values #134 and likely Wrong informations with Com port #129cargo update
by releasing this change with a minor release?