Skip to content
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

New release? #92

Closed
g0hl1n opened this issue Apr 5, 2023 · 8 comments
Closed

New release? #92

g0hl1n opened this issue Apr 5, 2023 · 8 comments

Comments

@g0hl1n
Copy link
Contributor

g0hl1n commented Apr 5, 2023

Hi @eldruin,
thanks for stepping up as maintainer.

Would you mind tagging a new release for serialport-rs?
My project is waiting for a tag containing the new nix version 😉

Thanks & regards

@eldruin
Copy link
Contributor

eldruin commented Apr 5, 2023

Sure, however, it seems no changes have been noted in the changelog since last release.
Would you mind going through PRs merged since then and adding short notes about them in the changelog?

@mlsvrts
Copy link
Contributor

mlsvrts commented Apr 5, 2023

Just a note that we have at least one (and sort-of two) breaking changes currently in the main branch:

  • The updated nix version is technically breaking, if unlikely to cause problems
  • There's a new member in a public struct (UsbPortInfo.interface)

We could target the master branch as 5.0.0-alpha and back port a 4.X release without breaking changes.

Note that we could probably feature-gate the UsbPortInfo change to make it non-breaking, but I don't know if we have an easy solution for the nix update...

@eldruin
Copy link
Contributor

eldruin commented Apr 5, 2023

Thanks for noticing that @mlsvrts.
Looking at the nix issue, I could not find any nix types in the library interface quickly skimming the docs (although I may have missed some).
If this is the case, I understand updating nix should not be a breaking change. Or has there been a behavioral change inside nix?

@mlsvrts
Copy link
Contributor

mlsvrts commented Apr 5, 2023

This is per @jannic (thanks!):

That's a limitation of semver-checks. See obi1kenobi/cargo-semver-checks#5, bullet point "upgrading to new major version of dependency while exporting a type that implements a trait from the dependency".

And yes, I think we are exporting such a type. impl From<nix::Error> for Error in error.rs.

Not literally a "trait from the dependency", but a trait which includes nix in its generic type.

I guess this won't cause any actual breakage in practice, though: I don't see any reason why external code should try to convert a nix::Error into a serialport::Error. This code is probably only used from inside the serialport crate.

This code works if the version of nix is identical:

fn main() {
    let nix_error: nix::Error = nix::Error::UnknownErrno;
    let serialport_error: serialport::Error = nix_error.into();
    println!("{serialport_error:?}");
}

However, if the binary crate and serialport use different versions of nix, compiling fails:

error[E0277]: the trait bound `serialport::Error: From<Errno>` is not satisfied
 --> src/main.rs:3:57
  |
3 |     let serialport_error: serialport::Error = nix_error.into();
  |                                                         ^^^^ the trait `From<Errno>` is not implemented for `serialport::Error`
  |
  = help: the following other types implement trait `From<T>`:
            <serialport::Error as From<libudev::error::Error>>
            <serialport::Error as From<nix::errno::consts::Errno>>
            <serialport::Error as From<std::io::Error>>
  = note: required for `Errno` to implement `Into<serialport::Error>`

So I'm quite sure this technically is a breaking change, but in practice it could be ignored.

@eldruin
Copy link
Contributor

eldruin commented Apr 5, 2023

Interesting! Thank you for looking into it.

@sirhcel
Copy link
Contributor

sirhcel commented May 10, 2023

What about a maintenance release with simply omitting the breaking changes to UsbPortInfo and ignoring the issue with nix as proposed in #92 (comment)?

I'm starting a release branch with #100.

@sirhcel
Copy link
Contributor

sirhcel commented May 21, 2023

Inching forward with #103.

@sirhcel
Copy link
Contributor

sirhcel commented May 22, 2023

4.2.1 got released on crates.io. A big thank you to all contributers and the fruitful discussions.

@sirhcel sirhcel closed this as completed May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants