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

Remove store! macro #202

Merged
merged 1 commit into from
Mar 7, 2025
Merged

Remove store! macro #202

merged 1 commit into from
Mar 7, 2025

Conversation

robin-nitrokey
Copy link
Member

This patch removes the store! macro. The macro was very complex, intransparent and hard to understand and contained lots of unsafe code and mutable statics. Software runners can instead just use virt::Store and virt::StoreConfig. Embedded runners typically have better means to safely implement the required statics and should create their own Store implementation. This is anyway necessary in most use cases as the runner will need more robust error handling than what was provided by the store! macro.

As a side effect, this allows us to make the littlefs2 dependency optional unless the virt feature is selected.

This patch removes the store! macro.  The macro was very complex,
intransparent and hard to understand and contained lots of unsafe code
and mutable statics.  Software runners can instead just use virt::Store
and virt::StoreConfig.  Embedded runners typically have better means to
safely implement the required statics and should create their own Store
implementation.  This is anyway necessary in most use cases as the
runner will need more robust error handling than what was provided by
the store! macro.

As a side effect, this allows us to make the littlefs2 dependency
optional unless the virt feature is selected.
@robin-nitrokey robin-nitrokey merged commit ec9bee8 into main Mar 7, 2025
2 checks passed
@robin-nitrokey robin-nitrokey deleted the store-macro branch March 7, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants