Skip to content

fix(ci): fix math / st7123touch / meshtastic example builds on ESP-IDF v6 - #759

Merged
finger563 merged 2 commits into
mainfrom
fix/v6-example-build-failures
Sep 2, 2026
Merged

fix(ci): fix math / st7123touch / meshtastic example builds on ESP-IDF v6#759
finger563 merged 2 commits into
mainfrom
fix/v6-example-build-failures

Conversation

@finger563

Copy link
Copy Markdown
Contributor

After the CI bump to ESP-IDF v6 (#751), three example builds fail. v6 ships GCC 15.2 and compiles IDF’s own components with -Wall -Wextra -Werror, so warnings the older toolchain tolerated now break the build.

Fixes

  • math (esp32): the example applied -Wdouble-promotion project-wide (add_compile_options before project()), so it was also compiled into ESP-IDF — whose esp32 code (esp_hw_support/port/esp32/rtc_clk.c) trips it under the new GCC and fails IDF’s -Werror build. Scope the flag to the example’s own translation units via target_compile_options(${COMPONENT_LIB} PRIVATE -Wdouble-promotion) in main/CMakeLists.txt, keeping the float-only check without touching IDF. (The example is deliberately float-pure — all 0.05f literals — so it still passes.)
  • st7123touch (esp32s3) / meshtastic (esp32s3): -Werror=missing-field-initializers flagged the std::function Config members with no default member initializer (St7123Touch::Config::write/read, MeshtasticNode::Config::transmit) when a designated-initializer aggregate omits them. Give them a default {nullptr}, matching their sibling members (e.g. meshtastic’s on_text{nullptr}) — fixing it for every caller, not just these examples.

Verification (IDF v6.0.1 / GCC 15.2, local)

  • math (esp32) → Project build complete
  • st7123touch (esp32s3) → Project build complete
  • meshtastic (esp32s3): transmit was its sole missing-initializer error (identical pattern to st7123touch, which builds clean); it pulls in the large BSP/lvgl submodules, so it was not rebuilt locally.

🤖 Generated with Claude Code

…F v6

IDF v6 ships GCC 15.2 and compiles its own components with -Wall -Wextra -Werror,
so warnings the older toolchain tolerated now fail the build:

- math: the example applied -Wdouble-promotion PROJECT-WIDE (add_compile_options
  before project()), which also compiled it into ESP-IDF, whose esp32 code
  (esp_hw_support/port/esp32/rtc_clk.c) trips it under the new GCC and fails its
  -Werror build. Scope the flag to the example's own translation units via
  target_compile_options(${COMPONENT_LIB} PRIVATE -Wdouble-promotion) so the
  float-only check is kept without touching IDF.
- st7123touch / meshtastic: -Werror=missing-field-initializers flagged the
  std::function config members with no default member initializer
  (St7123Touch::Config::write/read, MeshtasticNode::Config::transmit) when a
  designated-initializer aggregate omits them. Give them a default {nullptr},
  matching their sibling members (e.g. meshtastic on_text{nullptr}); this fixes
  the warning for every caller, not just these examples.

Verified on IDF v6.0.1 (GCC 15.2): math (esp32) and st7123touch (esp32s3) build
clean. meshtastic (esp32s3) had transmit as its sole missing-initializer error
(same fix pattern) and pulls in large BSP/lvgl submodules, so it was not rebuilt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 2, 2026 18:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Fixes ESP-IDF v6 (GCC 15.2, -Wall -Wextra -Werror) example build failures by scoping a warning flag to the example component and providing default initializers for omitted std::function/callable config members.

Changes:

  • Scope -Wdouble-promotion to the math example component via target_compile_options() instead of applying it project-wide.
  • Add default {nullptr} initializers for config callables in st7123touch and meshtastic to avoid -Wmissing-field-initializers becoming an error under -Werror.
  • Document why the warning flag must not be applied globally in the math example’s top-level CMakeLists.txt.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
components/st7123touch/include/st7123touch.hpp Adds default initialization for config callable members to avoid missing-field-initializers errors.
components/meshtastic/include/meshtastic.hpp Adds default initialization for the transmit callback to avoid missing-field-initializers errors.
components/math/example/main/CMakeLists.txt Applies -Wdouble-promotion only to the example component target.
components/math/example/CMakeLists.txt Removes project-wide warning flag application and documents the rationale.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread components/meshtastic/include/meshtastic.hpp
Comment thread components/st7123touch/include/st7123touch.hpp
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

✅Static analysis result - no issues found! ✅

…moved to private

ESP-IDF v6 ships mbedtls 4.x, which moved the low-level AES API out of the public
<mbedtls/aes.h> (now gone) into <mbedtls/private/aes.h> as PSA Crypto became the
public interface. meshtastic_crypto.cpp uses mbedtls_aes_crypt_ctr for the
Meshtastic AES-256-CTR packet cipher, so it failed with "mbedtls/aes.h: No such
file or directory" on v6. Select the header by MBEDTLS_VERSION_MAJOR (from the
public <mbedtls/build_info.h>) so it keeps building on mbedtls 3.x (IDF v5) and
builds on 4.x (IDF v6); the mbedtls_aes_* functions themselves are unchanged.

This was the second v6 break in this example (after the transmit initializer);
meshtastic (esp32s3) now builds clean on IDF v6.0.1.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@finger563

Copy link
Copy Markdown
Contributor Author

Follow-up: meshtastic had a second v6 break beyond the transmit initializer (the build stops at the first error, so it was hidden). Now fully built locally.

  • mbedtls 4.x (fb0475655): ESP-IDF v6 ships mbedtls 4.x, which removed the public <mbedtls/aes.h> (the low-level AES API moved to <mbedtls/private/aes.h> as PSA Crypto became the public interface). meshtastic_crypto.cpp uses mbedtls_aes_crypt_ctr for the Meshtastic AES-256-CTR cipher, so it failed with mbedtls/aes.h: No such file. Selected the header by MBEDTLS_VERSION_MAJOR so it builds on both mbedtls 3.x (IDF v5) and 4.x (IDF v6); the mbedtls_aes_* calls are unchanged.

meshtastic (esp32s3) now builds clean on IDF v6.0.1 — so all three examples in this PR are verified end-to-end.

@finger563
finger563 merged commit 98a765a into main Sep 2, 2026
154 of 155 checks passed
@finger563
finger563 deleted the fix/v6-example-build-failures branch September 2, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants