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 version? #92

Closed
little-arhat opened this issue Jul 31, 2018 · 41 comments
Closed

New version? #92

little-arhat opened this issue Jul 31, 2018 · 41 comments
Assignees
Labels
needs-decision S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label).

Comments

@little-arhat
Copy link
Contributor

Hi,

Number of features have been added since 0.2.1 -- should there be another release? I can't use git dependency if I want to publish hal-impl to crates.io.

Are there any guildelines regarding versioning? Seems like any new feature merged to master should bump patch level, otherwise hal-impl can't really use them.

@therealprof
Copy link
Contributor

I agree both with the idea of bumping the version with each change and to have a new release soon.

@little-arhat
Copy link
Contributor Author

What about releasing new version with revised list of unproven features?

@ryankurte
Copy link
Contributor

I'd like to push a new version once we've landed #101, #102 and #105 (hopefully shortly), which will be an 0.X release (specifically 0.3.0) due to breaking changes, any comments @rust-embedded/hal ?

@ryankurte ryankurte self-assigned this Oct 16, 2018
@ryankurte ryankurte added the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Oct 16, 2018
@therealprof
Copy link
Contributor

@ryankurte Which change is do you see as breaking?

@ryankurte
Copy link
Contributor

The falible digital traits PR (#105) is breaking

@therealprof
Copy link
Contributor

Right, but I was hoping we would release a non-breaking 0.2.2 before pulling that in.

@ryankurte
Copy link
Contributor

Fine by me, we need more reviews on all the linked PRs so once 101 and 102 are reviewed and merged we can release an 0.2.3 then land 105 and 0.3.0.

@hannobraun
Copy link
Member

@therealprof
Copy link
Contributor

I can see people wanting to stay on 0.2.x until all crates are ready for 0.3 which will take a while and the request to prove traits has been an elephant in the room for quite a while even longer than this ticket which is also is a few months old now.

@hannobraun
Copy link
Member

I understand that people want proven traits, but I question the point of declaring traits with known issues proven, then breaking them due to those known issues.

Yes, it sucks that those traits have known issues, and that we have to make breaking changes to fix those known issues. I don't see how declaring those traits proven right before making those breaking changes benefits anyone.

I understand that those users who want the traits proven might stay on 0.2.x for a while. I don't see how not having to enable the unproven feature during this time benefits them. They'll have to fix their implementations when upgrading to 0.3 in any case. Declaring those traits proven will remove a minimal obstacle to using them (enabling a feature) at the cost at confusing people about the future stability of those traits.

But as I said previously: I'm not making a stand here. It's not what I would do, but if you want to merge #102, go ahead.

@therealprof
Copy link
Contributor

I understand that people want proven traits, but I question the point of declaring traits with known issues proven, then breaking them due to those known issues.

I'd like to see that we're sticking to the rules which were once decided (or change them).

Regarding the "issues" and breaking the traits in the next version: When the "digital" traits were conceived they were meant to cover regular GPIOs and operations on those usually can not fail so it didn't make sense to have them fallible. In hindsight it should have been clear that IO expanders and multiplexers exist (especially since people including me have used them in the past) and that someone will eventually come up with a driver.

I am no and (most likely never will be) a fan of replacing the previous digital traits with fallible versions of it under the same name because the old traits are widely used and the fallible ones are really only required for a few new and special use cases. This change will split the whole Rust "full-stack" embedded ecosystem in two and I have serious doubts that it'll quickly recover. This is a huge risk and could potentially cause a lot of harm. Hence I really prefer a separate set of traits which would be non-breaking and allow fallible and non-fallible versions to co-exist (and even better to be used at the same time) and phase out the old traits much later.

@hannobraun
Copy link
Member

I understand that people want proven traits, but I question the point of declaring traits with known issues proven, then breaking them due to those known issues.

I'd like to see that we're sticking to the rules which were once decided (or change them).

Let me take a step back here, because I think it's important we're all on the same page:

  1. Remove InputPin unproven flag per #41 #102 proposes to mark InputPin proven, with 2 participating team members being in favor, 1 (me) arguing against.
  2. In [RFC] Managing breaking changes to existing traits #100, I proposed making the digital trait changes a clean break, which has been met with +1's and no opposition.

The combination of those two things is what I'm arguing against, because I think it makes no sense. But I don't think the combination of these two things is what you're arguing for. You want to go forward with #102, but you don't want to break the digital traits.

Let's revisit my proposal to make the digital changes a clean break. I proposed this because I started feeling bad about that pull request, and didn't want it turning into one of these months-long affairs, where the contributor is changing stuff again and again, due to changing reviews with ever new insights. Due to the response there (+1's, no opposition), I assumed that we'd be doing this.

I think I was wrong in at least one, possibly two ways. First, your comment has almost got me convinced that my proposal was wrong, and that we shouldn't do a clean break here. Second, even if I was right, it was wrong of me to assume we were going with this proposal after just a few days without opposition. I should have given you and others more time to respond.

So, if we won't break the digital traits, #102 makes a lot more sense. The digital traits can become proven (and possibly, at the same time, deprecated), while we go forward with a second set of traits. That's something I can get behind.

The question remains is how exactly we're going to transition (or whether we're going to transition at all). I think you're saying you might want to have two sets of traits in perpetuity, but I think that is not a workable solution, as I've previously explained.

I am no and (most likely never will be) a fan of replacing the previous digital traits with fallible versions of it under the same name because the old traits are widely used and the fallible ones are really only required for a few new and special use cases. This change will split the whole Rust "full-stack" embedded ecosystem in two and I have serious doubts that it'll quickly recover. This is a huge risk and could potentially cause a lot of harm. Hence I really prefer a separate set of traits which would be non-breaking and allow fallible and non-fallible versions to co-exist (and even better to be used at the same time) and phase out the old traits much later.

As I said, I don't think keeping two sets of traits in perpetuity is a workable solution (again, my explanation), but a slow transition phase is perfectly fine. I still think my proposal ([1], [2]), which is possibly the same as your proposal, is the best way to go here. @ryankurte is not convinced, though :)

@therealprof
Copy link
Contributor

I'm definitely less thinking of "in perpetuity" than a couple of months or a year. Having both traits side by side would allow for a smooth transition (and as mentioned previously it's even possible to bridge between the fallible and non-fallible interfaces even without losing anything in the common case of MCU GPIOs) and then we can easily phase out the old traits. New drivers for multiplexers etc. could easily offer just the new traits thus softly nudging users to change the HAL impls and their software...

In cases like this (where I have two dozens of affected published crates and many more unpublished) I'm always considering how much pain it would cause me to have such breakage (and it would be immense!) and then I also have to consider when to make the change and how much pain it would cause to all users (or how many would then rather not take the new version and stay with the old one...). I'm not even sure how many GPIO examples we have in official documentation which would all require changing and big fat disclaimers and explanation of the two alternatives and how to choose...

@hannobraun
Copy link
Member

I'm definitely less thinking of "in perpetuity" than a couple of months or a year.

Great, that's totally in line with what I'm thinking. I think our next step should be to reach consensus on a transition strategy in #100. I've gone ahead and blocked #102 and #105 until then.

@ryankurte
Copy link
Contributor

In that case, what would y'all think of a 0.2.2 release from the current master?

@ryankurte
Copy link
Contributor

(sorry, after landing 101)

@therealprof
Copy link
Contributor

@ryankurte +1

@hannobraun
Copy link
Member

@ryankurte Fine by me.

@thenewwazoo
Copy link
Contributor

Now that 101 has landed, I'd love to get a new version published. :)

@ryankurte
Copy link
Contributor

Looks to me like we need a PR with an updated changelog including all the changes introduced since v0.2.1 (looks like we need to be better at merging those as part of PRs) and a version bump in Cargo.toml. If you'd like to do that, it might speed up the process, otherwise one of us will hopefully have some time soon ^_^

@therealprof this action is exactly equivalent to my proposal in #100, see how it goes I guess?

@japaric
Copy link
Member

japaric commented Oct 25, 2018

Operational comment: dont forget to do the semver trick to allow interoperation between 0.2.2 hal-impls / drivers and 0.3.0 drivers / hal-impls, at least for the traits that didn't change between the two versions.

@hannobraun
Copy link
Member

Operational comment: dont forget to do the semver trick to allow interoperation between 0.2.2 hal-impls / drivers and 0.3.0 drivers / hal-impls, at least for the traits that didn't change between the two versions.

Thank you, @japaric. The release we currently agreed on will be a non-breaking patch release. We're aware of the semver trick and have been writing whole books worth of discussion about how specifically to employ it over in #100 :)

bors bot added a commit that referenced this issue Mar 21, 2019
127: Digital v1 <-> v2 compatibility wrappers and shims r=japaric a=ryankurte

This PR introduces implicit  v1 -> v2 (forward) compatibility, and explicit wrapper types for v2 -> v1 (reverse) compatibility between digital trait versions as a final step for #95, as well as moving the deprecated v1 traits to a re-exported module for clarity.

As @japaric pointed out, it is not feasible to have implicit compatibility in both directions, so it seemed reasonable to make regression explicit as it hides an `.unwrap()` on failure.

@therealprof, @hannobraun, @eldruin what do you think of this approach?
I think it probably needs more documentation, though I am definitely open to suggestions as to what / where.

See also: #100, #92, #102.



Co-authored-by: Ryan Kurte <[email protected]>
Co-authored-by: Diego Barrios Romero <[email protected]>
Co-authored-by: Daniel Egger <[email protected]>
@ryankurte
Copy link
Contributor

hi folks,

we've landed all the changes for fallible pins, which as far as i can see is currently non-breaking and only adds to the API (v1 is re-exported by default but marked depricated, v2 must be explicitly selected), which i think means we can consider this a minor release?

as an aside, running cargo semver over master highlights a set of errors on the serial module that i'm not sure about / probably need to be resolved prior to shipping anything, any ideas what this means?

error: breaking changes in `read`
  --> /home/ryan/projects/embedded-hal/src/serial.rs:14:5
   |
14 |     fn read(&mut self) -> nb::Result<Word, Self::Error>;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: type error: expected enum `nb::Error`, found a different enum `nb::Error` (breaking)

@therealprof
Copy link
Contributor

@ryankurte Definitely a minor release since we're not at 1.0 yet. However I have a feeling you have a slightly different understanding of minor. This is going to be 0.3.0 and we should revisit anything that should be added for that.

as an aside, running cargo semver over master highlights a set of errors on the serial module that i'm not sure about / probably need to be resolved prior to shipping anything, any ideas what this means?

Who knows? 😅

@ryankurte
Copy link
Contributor

@therealprof ahh good catch, s/minor/patch/g in my previous post, are there outstanding changes that require the planned minor bump over a patch release given the digital::* stuff is no longer breaking afaik?

Seems to me we only have additions so far, though we could switch the default pin implementation to v2.

also are there any other things we particularly want to land before a release?

@therealprof
Copy link
Contributor

Good question. But due to the intrusive nature of this chance I'd probably rather make it a minor release instead, even if not technically necessary.

@hannobraun
Copy link
Member

@therealprof

Good question. But due to the intrusive nature of this chance I'd probably rather make it a minor release instead, even if not technically necessary.

That doesn't seem like a good reason enough to me. Incrementing the minor version will split the ecosystem, unless we do the manual work required to do the semver trick.

I mean, if you volunteer to do that work, then I don't mind, I guess. Still, there'd be a chance of you missing something and causing breakage. Seems like an unnecessary risk to me.

@therealprof
Copy link
Contributor

@hannobraun If you say so. My worry is more on the side of accidentally breaking existing applications than requiring an explicit opt-in to a new version.

@hannobraun
Copy link
Member

Well, I think both ways have a risk of accidentally breaking applications. My way could introduce an unintended breaking change, your way could accidentally split the ecosystem. In both cases, the solution would be to release a fix and yank the offending crate. I prefer my way because it's simpler and less work.

But if we're going to release a new minor version anyway, I think we should switch the default gpio implementation to v2, as @ryankurte suggested.

In any case, I don't feel very strongly about this right now, so feel free to go ahead in whichever manner you think is best :-)

@ryankurte
Copy link
Contributor

ryankurte commented Mar 26, 2019

-wonders whether we could convince crater to regression test hal changes-

seems like it should be possible / could be valuable for us longer term, but, documentation seems lacking / i can't see how

[edit] opened an issue: rust-lang/crater#407

@ryankurte
Copy link
Contributor

ooh, what about a patch pre-release as a reasonably low effort middle ground? no changes by us (and thus a decreased chance of Maintenance Induced Failures), opt-in testing, and if we haven't had any reports of failures after a while we could then push a normal release.

@therealprof
Copy link
Contributor

@ryankurte Is there a mechanism for that?

@ryankurte
Copy link
Contributor

ryankurte commented Apr 6, 2019

i've definitely seen prereleases in use and on further research it's supported by semver but i can't parse from this issue or seem to find any docs about how cargo handles it ¯\(ツ)

@therealprof
Copy link
Contributor

I'm fine with playing guinea pig here to unblock this.

@ryankurte
Copy link
Contributor

a quick test with this suggests that cargo won't auto-update from 0.1.0 to 0.1.1-alpha.1, which seems okay.

just to be clear, is that an ack on publishing a pre-release? (also any thoughts about calling it an -rc release so it's easy with cargo-release?)

@therealprof
Copy link
Contributor

therealprof commented Apr 7, 2019

@rust-embedded/hal

Do we want to test the waters of the new version with a pre-release of the crate?

Ticky-boxes for the win:

@hannobraun
Copy link
Member

Please do whatever you think is best. As I already stated, I'd just do a patch release, but I didn't mean to block any decision here, and I apologize if I gave that impression.

bors bot added a commit that referenced this issue Apr 10, 2019
131: Release version 0.2.3-rc.1 r=therealprof a=ryankurte

hmm so cargo-release failed at pushing to master, but still pushed to [crates.io](https://crates.io/crates/embedded-hal/0.2.3-rc.1), might have to open a bug report there 😅

see also: #92 (comment)

Co-authored-by: Ryan Kurte <[email protected]>
@therealprof
Copy link
Contributor

@ryankurte Are we happy with this now?

@ryankurte
Copy link
Contributor

i've been using 2.3-rc.1 for a while, but, turns out the -rc.X releases are not considered compatible by cargo so i haven't managed to test interop in a meaningful way :-(

that said, i think i'd be happy to release it and yank/fix if anything unforeseen crops up (partly because i'm not really seeing another option).

@therealprof
Copy link
Contributor

@ryankurte Let's release it.

bors bot added a commit that referenced this issue May 8, 2019
133: Release v0.2.3 r=therealprof a=ryankurte

Updated cargo version and changelog, see also #92

Co-authored-by: Ryan Kurte <[email protected]>
@ryankurte
Copy link
Contributor

aand 0.2.3 is published and released. thanks for all your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label).
Projects
None yet
Development

No branches or pull requests

6 participants