Skip to content

Conversation

@00xc
Copy link
Contributor

@00xc 00xc commented Mar 26, 2025

Remove the need for the lazy_static dependency by using &'static str instead of String in globals, and fix some docs that were not properly picked up by rustdoc.

@isbm isbm requested a review from Ichmed March 26, 2025 11:03
@isbm isbm added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 26, 2025
@isbm
Copy link
Member

isbm commented Mar 26, 2025

@00xc Hi! Thanks for the PR which looks nice. Unfortunately I've just noticed that my workflows were broken. So I fixed them in #15, alongside the docstring part. But this effectively broke your PR (sorry for that).

Could you please rebase that again? 😉

The main use of lazy_static for microhop is to have global Strings to
represent mountpoints, but this can bee solved by using &'static str.
Some functions however dynamically construct different mountpoints, so
make mount_fs() generic, so it accepts both &str and String.

In order to further simplify things, introduce a new struct to represent
a system directory to be mounted instead of using 3-tuples.
@00xc
Copy link
Contributor Author

00xc commented Mar 26, 2025

@isbm sure. The docstring you've updated will not show up the generated docs though (it needs to start with //!, not /*), so I suggest you take my commit which properly generates the HTML documentation. Otherwise let me know and I can drop it.

Module-level documentation must start with "//!" and be present before
any actual code, even imports.
@isbm
Copy link
Member

isbm commented Mar 26, 2025

@00xc for whatever reasons clippy was upset on me, so I made it quick-n-dirty to just fix the workflow. 😉 As long as "insanity check" is through — I am fine with anything.

As of docs — I usually use readthedocs, but this project was a... hackweek-like quality, so give me some credit on its immaturity! 😆 Microhop was intended to run on embedded machines, where no automatic stuff needed, like typically we have on SUSE/Debians. But I am totally opened for the ideas, as long as it helps keeping initrd damn small and systemd-free 🤣

@00xc
Copy link
Contributor Author

00xc commented Mar 26, 2025

Sure, it's just that cargo doc will pick up the module documentation properly this way - it does not affect the size of the final binary.

@isbm
Copy link
Member

isbm commented Mar 26, 2025

@00xc my point is: microhop is really manual yet. It is best cooked with immutable images at the moment and used in Automotive. E.g. updating kernel is still not "automated" as one would e.g. "zypper up", because you would need to regenerate it.

But in case you want to add something else — np. 😉

@00xc
Copy link
Contributor Author

00xc commented Mar 26, 2025

@00xc my point is: microhop is really manual yet. It is best cooked with immutable images at the moment and used in Automotive. E.g. updating kernel is still not "automated" as one would e.g. "zypper up", because you would need to regenerate it.

But in case you want to add something else — np. 😉

I don't see what this has to do with rustdoc-generated documentation. My change is just an useful thing for developers running cargo doc.

@isbm isbm requested review from Ichmed and isbm March 26, 2025 13:30
Copy link
Member

@isbm isbm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM though. I would give it a go.

@isbm isbm merged commit 6af7b53 into tinythings:master Mar 26, 2025
2 checks passed
@isbm
Copy link
Member

isbm commented Mar 26, 2025

@00xc thanks! 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants