-
Notifications
You must be signed in to change notification settings - Fork 82
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
kargs: Various cleanups #645
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Accept &str vs owned String, allowing dropping unnecessary `clone` - It isn't parsing a file necessarily, just a string buffer, so rename it - Drop unnecessary `pub` - Add doc comment - Add error context to callers to be clear *which* file we failed to parse Signed-off-by: Colin Walters <[email protected]>
Signed-off-by: Colin Walters <[email protected]>
liboverdrop isn't helpful here because I don't think we want or need right now to actually support things like having a file in `/etc` or `/run` override the kargs. Especially for `/run` there's no dynamic runtime state. It *might* in theory be useful for someone to have `/etc` overrides, but since we weren't actually doing that today, don't pretend we might by using liboverdrop but not passing `/etc` to it. Using cap-std here makes it easier to unit test safely. (Although, liboverdrop really should grow an optional feature to use cap-std) Signed-off-by: Colin Walters <[email protected]>
Since the function accepts a `&str`, drop the unnecessary cloning. Signed-off-by: Colin Walters <[email protected]>
By passing ownership of the vector here we don't need to make it `mut`able. Signed-off-by: Colin Walters <[email protected]>
We can just pass the iterator directly to `extend`. Signed-off-by: Colin Walters <[email protected]>
No functional changes, but it's clearer to have the `remote_kargs` definition below where we do the short-circuit. Signed-off-by: Colin Walters <[email protected]>
- Change filtering to use combinators which is a bit clearer I think - Rework to directly return the deserialized args from the toml file and avoid moving them into a new vector - Drop the now unnecessary `mut` Signed-off-by: Colin Walters <[email protected]>
lukewarmtemp
approved these changes
Jun 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Prep for more tests. Signed-off-by: Colin Walters <[email protected]>
Somehow, something else is leaking into `/tmp` at least in the GHA runs...remove it all. Signed-off-by: Colin Walters <[email protected]>
cgwalters
pushed a commit
to cgwalters/bootc
that referenced
this pull request
Nov 5, 2024
…-0.4.38 build(deps): bump chrono from 0.4.37 to 0.4.38
cgwalters
added a commit
to cgwalters/bootc
that referenced
this pull request
Nov 6, 2024
Fix deprecation warning with rust 1.79.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No functional changes intended; just prep for further work.
kargs: parser cleanups
clone
it
pub
to parse
Signed-off-by: Colin Walters [email protected]
kargs: Add a few more unit tests
Signed-off-by: Colin Walters [email protected]
kargs: Parse booted kargs via cap-std, not liboverdrop
liboverdrop isn't helpful here because I don't think we want
or need right now to actually support things like having a file
in
/etc
or/run
override the kargs. Especially for/run
there's no dynamic runtime state.
No functional changes intended, just prep for more work.
It might in theory be useful for someone to have
/etc
overrides, but since we weren't actually doing that today, don't
pretend we might by using liboverdrop but not passing
/etc
toit.
Using cap-std here makes it easier to unit test safely.
(Although, liboverdrop really should grow an optional feature
to use cap-std)
Signed-off-by: Colin Walters [email protected]
kargs: Drop unnecessary cloning for sys_arch
Since the function accepts a
&str
, drop the unnecessary cloning.Signed-off-by: Colin Walters [email protected]
kargs: Drop unnecessary
mut
By passing ownership of the vector here we don't need to make
it
mut
able.Signed-off-by: Colin Walters [email protected]
kargs: Drop unnecessary allocation and
mut
We can just pass the iterator directly to
extend
.Signed-off-by: Colin Walters [email protected]
kargs: Minor code reordering
No functional changes, but it's clearer to have the
remote_kargs
definition below where we do the short-circuit.
Signed-off-by: Colin Walters [email protected]