-
Notifications
You must be signed in to change notification settings - Fork 25
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
Make this crate compatible with embedded-hal master #1
Comments
Hi. I'm just back from vacations. I need a few days to clear my backlog and will revisit this issue later on. At first glance, the problem is that your project depends on embedded-hal@master while the mock crate depends on embedded-hal@0.2. Even if the traits are compatible feature-wise, different versions are incompatible by design. I think a feature flag that uses master instead of a released version would help, although I'm not sure if that can be released to crates.io. |
I don't think crates with dependency to non-published crates can be published. I'm not sure what the best way to implement this would be. Maybe I'll maintain a |
Will this still be an issue when we've released embedded-hal v0.3.0 and updated this to point at it? |
As long as people use the The dependency tree looks like this:
This means that there are two versions of embedded-hal. The traits implemented by embedded-hal-mock for embedded-hal@0.3.0 are not compatible with the traits provided by embedded-hal@master, even if their source code is identical. Of course if both @eldruin and we use the released embedded-hal 0.3.0, then it's going to work. |
This is quite unfortunate and I did not know about it, although I can understand the reasoning now. |
That's the plan of course - we track embedded-hal releases 🙂 For development, would it help you if we had a branch called "next" that has a dependency on embedded-hal@master? |
I think it would. At least I would have a better alternative to test something in embedded-hal@master than to clone this crate locally, modify it and use that. |
@eldruin can you use a patch in your top level [patch.crates-io]
embedded-hal-mock = { git = https://github.com/dbrgn/embedded-hal-mock } If that / something similar works maybe we could document it for others too. |
Actually I created a branch, see d1c7248! |
Oops, sorry, that should be: [patch.crates-io]
embedded-hal = { git = "https://github.com/rust-embedded/embedded-hal" } @dbrgn the branch works too, I was recently introduced to this / thought I would share the cargo way. |
Ahh I see, I didn't realize that it was in a patch section 🙂 Yes, that should work, and it's probably a better solution than the branch - as long as there are no breaking changes in embedded-hal 🙂 |
Hi,
I ran into a compilation problem when using this crate with the
embedded-hal
master version.In my pcf857x crate, if changing the
embedded-hal
dependency in theCargo.toml
file to:The tests cannot be run as the compiler complains that the
prelude::Read
andprelude::Write
trait bounds were not satisfied.Am I doing something wrong or is this crate incompatible with
embedded-hal
master?There were some changes to
embedded-hal
's prelude. Could this be the cause?PS: Thanks for this crate! I use it all the time :)
The text was updated successfully, but these errors were encountered: