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 accidentally breaking esp-idf CI before releasing any new component

Changes

  • override_managed_component.py: is modified in a flexible way, so it can also be used in different repositories with little to no modification
  • 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 from build
  • usb_host_lib as it does not contain any component manifest file in IDF < 6.0, idf_component.yml is created in a CI job step, and then, the usb component is used as overridden.

Related

  • Closes: 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

Build ESP-IDF USB examples with strict flags and locally overridden esp_tinyusb, usb, and all USB host class drivers, excluding CherryUSB and adding UVC/manifest rules.

  • CI workflow (.github/workflows/build_idf_examples.yml):
    • Build ESP-IDF USB examples across expanded IDF matrix (v5.1–latest).
    • Override components: esp_tinyusb (IDF ≥ 6.0), usb (service releases), and all host class drivers (usb_host_* for CDC/HID/MSC/UVC) for all releases.
    • Auto-create idf_component.yml for host/usb_host_lib on IDF < 6.0 to enable usb override.
    • Add strict compiler flags (-Werror variants) and use centralized config/manifest paths.
  • Override helper (.github/ci/override_managed_component.py):
    • Add docstrings, UTF-8 I/O, clearer default namespace handling, and specific exceptions.
    • Improve app discovery, logging, and return codes for batch overriding.
  • Configs:
    • .idf_build_examples_config.toml: exclude CherryUSB examples; use ignore_build_warnings.txt.
    • .idf-build-examples-rules.yml: adjust USB host rules; enable host/uvc only on IDF ≥ 6.0; keep USB support guards.

Written by Cursor Bugbot for commit a0b7f49. 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
@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
@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).

@peter-marcisovsky
Copy link
Collaborator Author

Thanks for the review. It would make more sense to keep the override_managed_component.py more general, so it can be possibly deployed to other repositories with minimal change.

I will modify it in a way, so the script would override each component separately.

@peter-marcisovsky peter-marcisovsky marked this pull request as draft October 22, 2025 12:00
@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch 3 times, most recently from f42a9d0 to 1746fa2 Compare October 27, 2025 10:16
@peter-marcisovsky peter-marcisovsky force-pushed the ci/build_idf_examples_with_overriden_class_drivers branch from 1746fa2 to 1195396 Compare October 27, 2025 10:21
@peter-marcisovsky peter-marcisovsky marked this pull request as ready for review October 28, 2025 01:09
@peter-marcisovsky
Copy link
Collaborator Author

@tore-espressif I updated according to what we discussed, PTAL

The override_managed_component.py is left reusable for other repos and is called for each component separately.

    - all component used in usb device and host examples are overridden
    - 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 505f90b to a0b7f49 Compare November 1, 2025 04:50
@tore-espressif tore-espressif merged commit e3f9f1f into master Nov 3, 2025
100 of 118 checks passed
@tore-espressif tore-espressif deleted the ci/build_idf_examples_with_overriden_class_drivers branch November 3, 2025 10:39
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.

3 participants