Skip to content

Conversation

@Javagedes
Copy link
Collaborator

Description

This change updates the logic of component initialization to track a component that failed to initialize, and log it towards the end of boot, rather than panic on debug builds or possibly have UB on release builds.

Example output:

INFO - WARN - Components not dispatched:
INFO - WARN - ------------------------------- -------------------------------------------------
INFO - WARN - name                            error message
INFO - WARN - qemu_q35_dxe_core::BadComponent ConflictingParam Param Conflicts with everything.

Note: While tests still need to be written, this is ready for review.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  1. CI passes
  2. Created a test parameter that alwys fails to initialize. Ensured it was logged during boot
  3. Q35 continues to boot.

Integration Instructions

N/A

@github-actions github-actions bot added the impact:non-functional Does not have a functional impact label Dec 3, 2025
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 96.39640% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/patina/src/component/struct_component.rs 66.67% 3 Missing ⚠️
patina_dxe_core/src/component_dispatcher.rs 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

This commit updates the Component state use Cow<'static, str> rather
than directly a &'static str for component state (including the name
and param error message"). This greatly improves the API available to us
when working with these fields, while ensuring we only allocate a new
instance of the string if we absolutely have to. As a side note, no
allocation is made if creatining a Cow from an already static string, so
there is no negative impact to this change.
This commit updates the Param trait's `init_state` method to return an
result, where the error is a string explaining why the parameter could
not be initialized.

This error is ultimetly bubbled up to the to the component where the
component_dispatcher will place the component in a separate list of
components that failed initialization. The component is eventually logged
with the reasoning why it failed to initialize.
@Javagedes Javagedes force-pushed the personal/joeyvagedes/name-cow branch from 2ef7e59 to e2ba725 Compare December 8, 2025 16:51
@Javagedes Javagedes merged commit 0f7e82f into OpenDevicePartnership:main Dec 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants