Skip to content

Conversation

peter-marcisovsky
Copy link
Collaborator

@peter-marcisovsky peter-marcisovsky commented Sep 25, 2025

Description

This MR runs IDF examples with all the components overriden.

Right now, only usb and esp_tinyusb Components are overriden in IDF examples, but class dirivers are still used from esp registry.

This would prevent us from breaking esp-idf CI before releasing any new component

Changes

Changes in the override_managed_component.py

  • all components used in all esp-idf examples are now overridden and current versions of those components from esp-usb are used
  • cherryUSB examples are excluded
  • usb_host_lib as it does not contain any idf_component.yml is treated differently. First a idf_component.yml is created by the python script and then, the usb component is used as overridden.

Related

  • Closes: IDF-14239 Build idf examples in CI with all components overridden

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Note

Enable overriding USB host class drivers in IDF examples CI, upgrade workflow tooling/flags, and enhance the override script with manifest handling and exclusions.

  • CI Workflow (.github/workflows/build_idf_examples.yml):
    • Override USB host class drivers (host/class) for all releases; override core usb (host/usb) only on maintenance releases (v5.4, v5.5, latest).
    • Set EXAMPLES_PATH, upgrade idf-build-apps to 2.12.2, disable fail-fast, and export stricter compiler flags with Werror.
  • Override Script (.github/ci/override_managed_component.py):
    • Add support to override esp_tinyusb, usb, and all class drivers; exclude CherryUSB examples.
    • Auto-create main/idf_component.yml for usb_host_lib when missing; improve app discovery and namespacing.
    • Special-case cdc_acm_vcp; add robust error handling, logging, and YAML IO.
  • Build Config (.github/ci/.idf_build_examples_config.toml):
    • Add ignore_warning_files (use IDF's tools/ci/ignore_build_warnings.txt); remove work_dir.
  • Build Rules (.github/ci/.idf-build-examples-rules.yml):
    • Tweak enable rules; add UVC gating for IDF_VERSION >= 5.5.

Written by Cursor Bugbot for commit aa22194. This will update automatically on new commits. Configure here.

@peter-marcisovsky peter-marcisovsky self-assigned this Sep 25, 2025
@peter-marcisovsky peter-marcisovsky added Status: In Progress Issue is being worked on Component: usb_host Issue affects usb_host component labels Sep 25, 2025
@peter-marcisovsky
Copy link
Collaborator Author

peter-marcisovsky commented Sep 25, 2025

The same build error as from esp-idf here, CI Job failed correctly.

@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch from 3f82051 to 4428739 Compare September 26, 2025 12:12
pip install idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade
- name: Build ESP-IDF ${{ matrix.idf_ver }} USB examples
shell: bash
pip install idf-component-manager>=2.1.2 idf-build-apps==2.12.2 pyyaml --upgrade
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To be able to threat the sdkconfig warning as an CI Build error, this one which recently broke the esp-idf CI:

Loading defaults file /opt/esp/idf/examples/peripherals/usb/host/uvc/sdkconfig.defaults...
warning: unknown kconfig symbol 'PRINTF_UVC_CONFIGURATION_DESCRIPTOR' assigned to 'y' in /opt/esp/idf/examples/peripherals/usb/host/uvc/sdkconfig.defaults
Loading defaults file /opt/esp/idf/examples/peripherals/usb/host/uvc/sdkconfig.defaults.esp32p4...
warning: unknown kconfig symbol 'PRINTF_UVC_CONFIGURATION_DESCRIPTOR' assigned to 'y' in /opt/esp/idf/examples/peripherals/usb/host/uvc/sdkconfig.defaults.esp32p4

I updated the idf-build-apps to the current latest version. It, by default, contains a post-build action, which treats any warnings which occurred during build (and even before build) as a CI Build error. The same setup is present in esp-idf build CI.

Otherwise, without updating the idf-build-apps to the latest version, the build would have normally passed in our CI.

@peter-marcisovsky peter-marcisovsky marked this pull request as ready for review September 26, 2025 12:56
cursor[bot]

This comment was marked as outdated.

@peter-marcisovsky peter-marcisovsky added the CI CI related PR label Sep 26, 2025
cursor[bot]

This comment was marked as outdated.

@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch from 5df8257 to 6188f04 Compare September 26, 2025 14:49
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch from 230b2f8 to cc13fa5 Compare September 29, 2025 14:30
@peter-marcisovsky peter-marcisovsky added Status: Reviewing Issue is being reviewed and removed Status: In Progress Issue is being worked on labels Sep 29, 2025
cursor[bot]

This comment was marked as outdated.

@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch 2 times, most recently from fc6bcde to aa22194 Compare September 30, 2025 10:35
@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch from aa22194 to 6c311ee Compare October 15, 2025 15:37
    - all component used in usb device and host examples are overridden
    - esp_tinyusb, usb and all class drivers
    - using ignore_build_warnings.txt from esp-idf to match the idf CI environment
@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch from 6c311ee to 19d38c1 Compare October 15, 2025 15:41
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

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

@peter-marcisovsky Thank you for the work on this.

The original purpose of override_managed_component.py was to enable testing of examples or tests for components that are located outside their original repositories. The intent was for the script to remain reusable across different repositories facing similar constraints.

The proposed changes introduce behavior that is specific to the esp-usb repository. We should clarify whether we want to:

  1. Redefine the scope of this script to be esp-usb-specific, or

  2. Improve its design to keep it reusable.

If we choose the second option, possible improvements include:

  • Invoking the script once for each overridden class driver, avoiding assumptions about component names derived from paths.

  • Removing special-case handling for components that already contain an idf_component.yml file (e.g., usb_host_lib).

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

Labels

CI CI related PR Component: usb_host Issue affects usb_host component Status: Reviewing Issue is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants