Skip to content

Add context to functions called from build_ukify#1980

Draft
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb:build-uki-context
Draft

Add context to functions called from build_ukify#1980
jeckersb wants to merge 1 commit intobootc-dev:mainfrom
jeckersb:build-uki-context

Conversation

@jeckersb
Copy link
Collaborator

@jeckersb jeckersb commented Feb 4, 2026

Signed-off-by: John Eckersberg jeckersb@redhat.com

Signed-off-by: John Eckersberg <jeckersb@redhat.com>
@bootc-bot bootc-bot bot requested a review from henrywang February 4, 2026 22:07
@jeckersb
Copy link
Collaborator Author

jeckersb commented Feb 4, 2026

Draft for now but we'll use this to collect extra context used to track down what's going on in #1977

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 is a good step towards improving error handling by adding context to several functions using fn_error_context. This will make debugging failures much easier.

I've added one suggestion to make one of the context messages more descriptive.

To build on this, you might also consider extending this pattern to other fallible functions in the call stacks of the modified functions. For example, new_temp_composefs_repo in crates/lib/src/bootc_composefs/digest.rs and find_uki_path in crates/lib/src/kernel.rs could also benefit from a #[context(...)] attribute to provide even more granular error reporting.

Overall, this is a valuable change for maintainability.


/// Load and parse all bootc kargs.d files in the specified root, returning
/// a combined list.
#[context("Getting kargs in root")]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The context message "Getting kargs in root" is a bit generic. A more descriptive message that details what the function is doing would be more helpful in an error chain. Based on the function's documentation ("Load and parse all bootc kargs.d files in the specified root"), a more specific context would improve debuggability.

Suggested change
#[context("Getting kargs in root")]
#[context("Loading and parsing kargs.d files from root")]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes but these should be pretty terse since they get strung together into the final error message which can be pretty long by the end of it.

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