-
Notifications
You must be signed in to change notification settings - Fork 234
Major faux I2C interface incompatibility between 0.1.2 and 0.2.0 #81
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
Comments
That's expected. v0.1.x traits from v0.1.x are different from v0.2.x traits even if they have the exact same signature (the traits live in different crates -- v0.1.x and v0.2.x are different crates). This was mentioned in the announcement and in #72 (comment).
The problem affects all traits but it's only seen when a driver crate (generic over trait) and a HAL implementation (trait implementation) interact. You only see problems with I2C because probably you are using I2C drivers and not e.g. SPI or serial drivers. |
Nope, I'm only seeing it with I2C, not SPI, not Serial. Just verified again, cf. ssd1306 crate:
|
IDK if this is the issue here, but I remember a major crate ( If I remember correctly, there was a write-up about the solution they used. It was something like making a last release on the previous series which stripped out elements that were unchanged, and instead depended on those same elements from the next release version. There was a nice write-up about this -- I'm trying to find it, but haven't had much luck yet. I apologize if this is something you are aware of already that doesn't apply -- I'm fairly new to the wide world of rust library compatibility and versioning. |
Here's the writeup I was thinking of, at least: https://github.com/dtolnay/semver-trick |
@austinbes Thanks for the link. That's a clever trick. I think it can be applied in this case. I'll release v0.1.3 using the trick and we can see how it goes. |
embedded-hal v0.1.3 has been released. Experience reports using it in both sides HAL impl / drivers would be appreciated. |
Hm, it doesn't help in my specific |
Hah! I take it back, seems to work a treat on |
@therealprof the changes needed are described here: japaric/stm32f103xx-hal#50 (comment) |
@ilya-epifanov Yeah, I'm not so happy about using a crate from a forked github repository for examples anyway but it is what it is. |
For the record neither am I, but it means I/we can develop on actual
hardware which is a big plus.
…On Tue, 15 May 2018, 12:48 Daniel Egger, ***@***.***> wrote:
@ilya-epifanov <https://github.com/ilya-epifanov> Yeah, I'm not so happy
about using a crate from a forked github repository for examples anyway but
it is what it is.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#81 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAw4F-EbhTmhVdIZLn-pGufWZDqtwcgbks5tysCFgaJpZM4T89NT>
.
|
This can probably be closed? |
@dbrgn Yes, thanks for the reminder. |
81: Add features for spi and i2c r=eldruin a=zuckschwerdt Adds the features `i2c` and `spi` for an optional dependency on `i2cdev` and `spidev`. Discussion in rust-embedded#80. Closes rust-embedded#80 Co-authored-by: Christian W. Zuckschwerdt <[email protected]>
Even though the blocking I2C interface has not changed a bit between 0.1.2 and 0.2.0 Rust will not compile any application using I2C where one dependency is using version 0.1.2 and the other 0.2.0. I've only seen this for I2C so far, other interfaces (I've examples for serial, GPIO and SPI) do not exhibit this behaviour.
This issue has been reported in rust-embedded-community/ssd1306#66 but I've seen it myself in all of my crates now, too, e.g.
After matching the versions to either 0.1.2 or 0.2.0 (or dropping I2C use) the same code will compile just fine. I don't see any reason why it shouldn't continue working, especially since only I2C seems to be affected and it would be great if we could somehow ease the transition.
@japaric Any ideas?
The text was updated successfully, but these errors were encountered: