Skip to content

Conversation

@cgwalters
Copy link
Collaborator

No description provided.

In some cases we want to return the value exactly as it
was originally.

Also drop the test-only APIs, those were really never needed.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters requested a review from jeckersb August 5, 2025 22:12
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces several cleanups and API additions to the kernel_cmdline module. The main change is the introduction of ParameterStr and related functions (find_str, find_all_starting_with_str) to handle UTF-8 kernel arguments in a more type-safe way. The implementation is solid and the new tests cover the added functionality well. My review includes a few suggestions to refine function signatures for better clarity and idiomatic Rust, and to remove a lint suppression.

I don't think anything should use to_lossy() by default.
It's great to have a correct kernel argument parser that
doesn't bomb on non-UTF8 but at the same time in our code
we can just I think ignore kernel arguments which aren't UTF-8.

Maybe we should warn if e.g. we find a `root=<nonutf8` or
so but eh.

Everything else in the bootc codebase works in terms of
strings so let's just make it really easy to only
get strings out.

Implementation notes:

- I struggled with lifetimes in this one and couldn't
  get it to work to reuse the Parameter (byte oriented)
  parser and just reimplemented it in the str path
- When I tossed this problem at both Claude and Gemini
  they both gave up; and Gemini ended up deleting
  all the code and declaring success

Unit tests (after I manually fixed up all the lifetime
stuff in the core code) are
Assisted-by: Gemini-CLI

Signed-off-by: Colin Walters <[email protected]>
@cgwalters cgwalters enabled auto-merge August 6, 2025 17:20
@jeckersb
Copy link
Collaborator

jeckersb commented Aug 6, 2025

testing farm looks big stuck here, not sure how to unwedge it and retry...

@cgwalters
Copy link
Collaborator Author

testing farm looks big stuck here, not sure how to unwedge it and retry...

Yeah https://status.testing-farm.io/ is up to date, I am hopeful it'll just be another day

@cgwalters cgwalters merged commit 3758da2 into bootc-dev:main Aug 6, 2025
23 of 27 checks passed
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