Repository navigation
Add ESP-IDF runtime dependencies and gate publishing on a compile test - #162
Merged
Merged
Conversation
ESPHome's ESP-IDF toolchain installer validates the openocd-esp32 tool by executing it, and that binary dynamically links libusb-1.0.so.0, which the final image did not carry, so every ESP-IDF build failed. Add libusb-1.0-0, plus ccache, which ESPHome enables automatically whenever the binary is on PATH. A build-only smoke cannot see this class of break: the toolchains that link against the missing library are downloaded on first compile, so nothing fails until firmware is actually built. Add a compile-test job to the validation gate that builds the image and compiles checked-in configurations inside it as a non-root user, covering the Xtensa ESP-IDF, RISC-V ESP-IDF, wired Ethernet, and PlatformIO build paths. The publisher always runs it, so a firmware break blocks the push and the release; push CI runs it only when an inline change-gate sees the image or the upstream pin move, so the tracker's daily bump is verified before it auto-merges. Add a daily upstream-dependency watcher that snapshots the package list ESPHome's own base image installs and opens a review pull request when that list changes, so the next dependency addition is caught before a user reports it.
validate-task was lint-only and needed no secrets, so neither caller inherited them. Its compile-test job logs in to Docker Hub for higher pull and cache-read limits, which failed the gate on the first run.
Diffing only the push let a later docs-only commit skip the compile test on a branch that had already changed the image, so a pull request could pass its gate without ever compiling its own change. Diff a feature branch against its merge-base with develop instead; main and develop keep push-diff semantics, which is what catches the change after a squash-merge.
There was a problem hiding this comment.
Pull request overview
This PR fixes ESP-IDF firmware compile failures in the published Docker image by adding required runtime packages, and strengthens the release gate by compiling real firmware configs inside the built image before pushing/publishing. It also adds an automated watcher to track upstream base-image apt package changes and bumps the repo version/doc release notes to 1.9.
Changes:
- Add
libusb-1.0-0(foropenocd-esp32validation) andccacheto the runtime image. - Add an opt-in
compile-testjob to the validation gate, enabled for publishing and change-gated on CI pushes. - Add a daily upstream dependency snapshot workflow and introduce
upstream-dependency.jsonas a review signal.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| WORKFLOW.md | Documents the new compile-test gate and upstream dependency watcher; updates CI/publish contract text and diagrams. |
| version.json | Bumps version floor from 1.8 to 1.9. |
| upstream-dependency.json | Introduces the tracked snapshot of upstream base-image apt package names. |
| README.md | Updates release notes to 1.9 and refreshes related links. |
| HISTORY.md | Adds 1.9 release notes and supporting link references. |
| Docker/Dockerfile | Adds libusb-1.0-0 and ccache to final-stage runtime dependencies. |
| cspell.json | Adds new domain words (libusb, openocd, Xtensa) to spelling allowlist. |
| AGENTS.md | Updates repo structure docs and removes template-lineage wording in favor of shared-contract phrasing. |
| .github/workflows/validate-task.yml | Adds reusable, opt-in compile-test job (build image + run esphome config/compile in-container). |
| .github/workflows/test-pull-request.yml | Adds a change-detection job to gate whether compile-test runs on push CI. |
| .github/workflows/check-upstream-dependency.yml | Adds daily workflow to snapshot upstream base-image apt package names and open a PR when they change. |
| .github/workflows/build-release-task.yml | Ensures publishing runs validation with compile-test enabled. |
| .github/copilot-instructions.md | Updates shared-contract guidance wording. |
| .github/compile-test/esp8266-d1-mini.yaml | Adds PlatformIO/Arduino fixture for compile testing. |
| .github/compile-test/esp32c6-bluetooth-proxy.yaml | Adds RISC-V ESP-IDF fixture for compile testing. |
| .github/compile-test/esp32-ethernet.yaml | Adds Ethernet (LAN8720) ESP-IDF fixture for compile testing. |
| .github/compile-test/esp32-bluetooth-proxy.yaml | Adds Xtensa ESP-IDF + BLE fixture for compile testing. |
| .editorconfig | Minor comment wording tweak in the shared config section. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
WORKFLOW.md:663
- The scenario table numbering is out of order (S17 appears before S16 and S15), which makes it harder to scan and reference scenarios consistently.
| S17 | the tracker opens an upstream pin bump PR that breaks compiles | the change-gate sees `upstream-version.json`, the compile test runs and fails, the required check blocks auto-merge before the pin reaches `main` | D1.1, D8.3, D11.1 |
| S16 | a runtime dependency is missing for RISC-V but not Xtensa | the Xtensa fixtures pass and `esp32c6-bluetooth-proxy.yaml` fails, isolating it to that toolchain | D11.3 |
| S15 | an ESPHome release changes a schema a fixture uses | `esphome config` fails before `esphome compile`, naming the fixture to update | D11.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ESPHome's ESP-IDF toolchain installer validates the
openocd-esp32tool by executing it, and that binary dynamically linkslibusb-1.0.so.0. The final image did not carry it, so every ESP-IDF build failed with an ESP-IDF framework installation failure (reported in #161 - the closing keyword is held for thedevelop -> mainpromotion, since a keyword in a PR targetingdevelopnever fires).What
The fix.
libusb-1.0-0for the openocd tool check, andccache, which ESPHome enables automatically whenever the binary is on PATH and whose cache lands in the/cachevolume.Upstream's base image also adds
build-essential,libcairo2,libmagic1t64, andpatch. Those are deliberately not copied: this image splits builder from final, andcairosvg/magicare not installed. Verified rather than assumed - the Bluetooth proxy fixture (1429 build targets, BLE stack, TLS,esp_http_client) compiles with no missing-tool errors.Compile test. A build-only smoke cannot see this class of break, because the toolchains that link against the missing library are downloaded on first compile.
validate-taskgains acompile-testjob that builds the image and compiles the checked-in.github/compile-test/configurations inside it as uid 1000. Fixtures span the distinct execution environments rather than enumerating boards:esp32-bluetooth-proxy.yamlesp32c6-bluetooth-proxy.yamlesp32-ethernet.yamlesp8266-d1-mini.yamlThe publisher always runs it, so
build-docker(which already needsvalidate) blocks the push and the release on a firmware break. Push CI runs it only when an inline change-gate seesDocker/**,.github/compile-test/**, orupstream-version.jsonmove - so the tracker's daily pin bump is compile-tested before the merge-bot auto-merges it, while a doc-only push pays nothing.Upstream-dependency watcher. A daily job snapshots the apt package list ESPHome's own base image installs into
upstream-dependency.jsonand opens a PR when it changes. Its head ref is outside the merge-bot'supstream-version-*pattern, so it waits for triage - deciding whether a package upstream adds belongs here is a judgement call. The file is not a shipped input, so committing it never fires the publisher.Also included.
version.jsonfloor to 1.9 with README and HISTORY release notes, and removal of the abandoned template-lineage references fromAGENTS.mdand.github/copilot-instructions.md.Verification
Executed, not inspected:
esphome configcaught a genuine defect in a fixture during development (apirequires a network component), which is why it runs as a distinct step beforecompile.Notes for review
WORKFLOW.mdgains D11 plus scenarios S13-S17 and the matching 5A audit rows..editorconfighas a one-word comment change ("every derived repo" -> "every repo"). It is a converged file, so the same edit is needed in the other repos to avoid drift.