-
Notifications
You must be signed in to change notification settings - Fork 229
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
macros: Add #[main]
macro
#2920
Comments
I want to discuss it a little bit more. From my point of view and understanding of a comment (linked in an initial issue comment) the suggestion is to "hide" and mask those runtime crates/macros. Again, just my point of view for now (which might be wrong though 😄 ) and I'm looking forward to get some feedback! <3 |
Good question, thanks for asking! I addressed this a bit in this point:
but I'll expand a bit further why I think it's okay to do this. API stability is about "can a user upgrade from 1.x to 1.y without having to make code changes?". Whilst we may depend on fundamentally unstable crates to create the
Further more, there is some precedence for this both in the embedded space, and in rust generally. Precedence 1: RTIC - rtic currently has support for two major versions, and has had stability for a number of years. However, the underlying crates, namely cortex-m-rt for ARM users, are still not stable. The code generation backends for the esp32c3/c6 are also built on unstable PAC crates, but through careful use and an internal API for macros they can achieve stability. Precedence 2: Rust its self does this all the time, async itself depends (internally) on unstable features of the compiler, but to give a more accurate example the core library |
On the other hand, the only option that I see is making users export So, from this point of view, adding Other words, I'm a bit confused 😆. |
Thanks for clarifying, agreed, it's probably the best way how to keep things user-friendly, others (which I described above) are really, really ugly 😄 |
So this is the third issue we have that is related to unstable crate dependencies in some way.
What counts as code change? PACs, RT crates are "singleton crates", i.e. a single version can exist in a project. If we release a breaking change to them, and hide that breaking change behind a semver-compatible HAL change, users that directly depend on those crates will need to make code changes. In the best case, that code change is just a version bump in
If we are talking about std-related precedence, we should bring up the |
This is exactly what I want to explore in the first linked issue - do they need to be "singletons"? What happens when two semver compatible, but different with rt crates, esp-hal versions are in the same dependency tree?
Good point, we shouldn't follow them blindly, but in general they have good stability guarantees. Imo that was a process failure on their end, and they should learn from that. The fact the PR got merged before everyone pinged replied was not only strange, but at that point they were asking for breaking changes. |
Description of work required is available here: #2900 (comment)
The text was updated successfully, but these errors were encountered: