-
Notifications
You must be signed in to change notification settings - Fork 226
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
Ensure the PAC crates and other private crates are never exposed publicly #2525
Comments
This is annoying because even if we newtyped the RegisterBlock, if third parties try to write a driver using the same I guess if we can live with multiple PACs in the same project, we can "just" expose the address, and make the user convert it to "a" PAC peripheral, but I'm worried this might cause problems. |
I think upstream rust would have a stroke at this comment, this completely eliminates pointer provenance :D. I think this is a use-case we want to support though, SCCB is the perfect example tbh. |
svd2rust does that already, we're casting a random number to a typed pointer in the PACs. |
True, it's no different. I guess it just feels less bad when machine-generated code is doing it 😅. |
Maybe just mark the PAC exposing APIs as unstable indefinitely? I feel like the moment one needs to write a 3rd party driver, they need to touch the PAC, period. Adding to the list of exposed PAC is https://github.com/esp-rs/esp-hal/blob/main/esp-hal/src/pcnt/channel.rs#L12 . (My IDE never seems to do the right thing with this, so I'll be happy to see it refactored) |
I think this issue needs to be expanded, as this is not specific only to the PACs. We additionally re-export |
Just because the list contains a |
I opened #2589. As far as I know, the rt crates aren't exposed in the public API (which is what this issue is tracking), but I agree there are some interactions we need to be aware of with these dependencies. |
|
I think we should formulate our stability guarantees before we invest much more time in the "Hide everything PAC-related" question. Every breaking PAC update will itself be a breaking HAL update as well, because there can only ever be one PAC version in a project. If someone is using PAC version 0.N, but we update the HAL in a minor release to PAC version 0.N+1, projects will stop to build, even while strictly speaking we can say we're semver compatible. In my mind this looks like the PAC is pretty much part of the API surface offered by esp-hal, even if in a somewhat roundabout way. Can we accept "semver-compatible update breaks something else" as part of our stability guarantees? |
I'm not sure I follow, we do not make any guarantees with regards to external dependencies. If users are relying on the PAC in addition to the HAL this does not impact semver guarantees of the HAL. |
The issue is that just changing the HAL might break things. |
I'll go through the items we're stabilizing just to take a look if there's something we reexport from pacs. Also, this will help me to double-check if we've marked everything what needs to be |
I'll just leave some notes here:
|
I agree with Jesse - as long as the user doesn't add the PAC as a dependency nothing can happen. If they add a dependency on the PAC they add a dependency on something unstable and have to deal with it |
This implies that we can - unstably - expose the PAC and that would even make users' lives simpler. |
Yes - I think so |
The PACs will probably never be 1.0, therefore we need to keep it out of the public API in esp-hal.
This is currently exposed in a few places
interrupt::enable*
takespac::Interrupt
Instance
traits expose* const peripheral::RegisterBlock
esp_hal::peripherals::*
implementDeref
, which deref to the pac typesThe text was updated successfully, but these errors were encountered: