-
Notifications
You must be signed in to change notification settings - Fork 8.2k
west: blobs: list/clean --allow-regex filter
#99415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
west: blobs: list/clean --allow-regex filter
#99415
Conversation
Enable filtering the blobs selected by `west blobs list` and `west blobs clean` with a regex pattern, just like `west blobs fetch`. Support this when checking for blob existence in `drivers/wifi` for esp32, so now it's possible to build for a selected esp32 family SOC (for example `esp32c6`) with only the blobs for that chip downloaded: west blobs clean hal_espressif # delete all hal_espressif blobs west blobs fetch hal_espressif --allow-regex '.*esp32c6.*' west build -b esp32c6_devkitc/esp32c6/hpcore zephyr/samples/net/wifi/shell Signed-off-by: Noah Pendleton <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the --allow-regex filter option to west blobs list and west blobs clean commands, extending functionality that previously only existed for west blobs fetch. The changes enable users to selectively work with binary blobs based on regex patterns, particularly useful for Espressif ESP32 chips where users can download and verify only the blobs needed for their specific SOC variant.
Key changes:
- Moved
--allow-regexargument from fetch-specific to a global option available for all blob subcommands - Added regex filtering to the
list()function to filter displayed blobs by path pattern - Extended
zephyr_blobs_verify()CMake function to accept aREGEXparameter for filtered blob verification
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| scripts/west_commands/blobs.py | Moved --allow-regex from fetch-specific option to global option; implemented regex filtering in list() function |
| cmake/modules/extensions.cmake | Added REGEX parameter to zephyr_blobs_verify() function to pass regex filter to west blobs list command |
| drivers/wifi/CMakeLists.txt | Applied SOC-specific regex filtering when verifying Espressif ESP32 WiFi blobs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| help='''Regex pattern to apply to the blob local path. | ||
| Only local paths matching this regex will be listed/fetched. | ||
| Note that local paths are relative to the module directory''', |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The help text states "Only local paths matching this regex will be listed/fetched" but according to the PR title and description, the --allow-regex filter should also work with west blobs clean. Update the help text to include "cleaned":
help='''Regex pattern to apply to the blob local path.
Only local paths matching this regex will be listed/fetched/cleaned.
Note that local paths are relative to the module directory''',Additionally, the clean() function (lines 218-225) needs to be updated to actually apply this filter, similar to how list() and fetch() functions do (see lines 120-125 and 176-181 in the full file).
|
|
||
| if(CONFIG_DT_HAS_ESPRESSIF_ESP32_WIFI_ENABLED) | ||
| zephyr_blobs_verify(MODULE hal_espressif REQUIRED) | ||
| message(WARNING "Verifying presence of Espressif ESP32 Wi-Fi binary blobs.") |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This warning message appears to be informational rather than indicating a problem. Consider using message(STATUS ...) instead of message(WARNING ...) for informational messages, or remove this message entirely since the verification errors/warnings will be displayed by zephyr_blobs_verify() if there are actual issues.
| message(WARNING "Verifying presence of Espressif ESP32 Wi-Fi binary blobs.") | |
| message(STATUS "Verifying presence of Espressif ESP32 Wi-Fi binary blobs.") |
| # if REGEX is specified, add --allow-regex to the west command | ||
| if(BLOBS_VERIFY_REGEX) | ||
| list(APPEND west_args --allow-regex ${BLOBS_VERIFY_REGEX}) | ||
| endif() |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The REGEX parameter only makes sense when MODULE is specified, not when FILES is used. When FILES is specified, the function verifies specific file paths, so a regex filter on blob paths doesn't add value. Consider adding validation:
if(BLOBS_VERIFY_REGEX AND DEFINED BLOBS_VERIFY_FILES)
message(WARNING "REGEX parameter is ignored when FILES is specified in ${CMAKE_CURRENT_FUNCTION}")
endif()Co-authored-by: Copilot <[email protected]>
|



Enable filtering the blobs selected by
west blobs listandwest blobs cleanwith a regex pattern, just likewest blobs fetch.Support this when checking for blob existence in
drivers/wififor esp32, so now it's possible to build for a selected esp32 family SOC (for exampleesp32c6) with only the blobs for that chip downloaded: