Skip to content

Conversation

@Jason2866
Copy link

@Jason2866 Jason2866 commented Nov 23, 2025

without the need to use a extra boards manifest for idf

Checklist:

  • The pull request is done against the latest develop branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR, more changes are allowed when changing boards.json
  • I accept the CLA

Summary by CodeRabbit

  • Bug Fixes
    • Fixed build configuration handling for ESP-IDF framework projects by automatically adjusting build settings based on the detected framework type.

✏️ Tip: You can customize this high-level summary in your review settings.

Build bootloader even when custom_sdkconfig is set.
Use set frameworks as condition to check
check platform entry in platformio.ini 
If there is espidf it is not HybridCompile
@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The change adds a conditional check in the ESP-IDF builder that reads the framework setting from project configuration and disables custom sdkconfig generation if the framework identifier contains "espidf", effectively toggling HybridCompile behavior based on project-specific framework configuration.

Changes

Cohort / File(s) Summary
ESP-IDF framework configuration gate
builder/frameworks/espidf.py
Reads project framework option via env.GetProjectOption("framework"); conditionally disables custom sdkconfig generation by setting flag_custom_sdkconfig to False when framework string contains "espidf"; adds status messaging for HybridCompile state

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the framework option key name matches the project configuration structure
  • Confirm the string matching logic ("espidf" substring check) covers intended framework variants
  • Check whether flag_custom_sdkconfig variable is properly scoped and initialized before assignment

Possibly related PRs

Poem

A rabbit hops through config trees, 🐰
Reads frameworks dancing in the breeze,
"If espidf blooms," the builder cries,
"HybridCompile shall compromise!"
Custom sdkconfig takes its leave,
As project wishes we now believe. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Make idf compile possible for MCUs which have no precompiled Arduino libraries' directly describes the main purpose and motivation of the changeset—enabling ESP-IDF compilation for microcontrollers without precompiled Arduino libraries.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Jason2866
Copy link
Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Nov 23, 2025

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
builder/frameworks/espidf.py (1)

236-241: Consider removing debug print statements and adding error handling.

The implementation achieves the stated goal of disabling HybridCompile for pure ESP-IDF projects, but has a few refinements needed:

  1. Debug output: Lines 237 and 241 appear to be debug print statements that should be removed or gated behind the verbose flag check used elsewhere in the file.
  2. Exception handling: GetProjectOption("framework") could raise an exception if the framework option is not set in the project configuration.
  3. String comparison: The substring check "espidf" in pio_orig_frwrk is case-sensitive and could theoretically match unintended strings, though this is unlikely in practice.

Apply this diff to address these concerns:

-pio_orig_frwrk = env.GetProjectOption("framework")
-print("***** Framework read from Project Config:", pio_orig_frwrk)
-
-if "espidf" in pio_orig_frwrk:
+try:
+    pio_orig_frwrk = env.GetProjectOption("framework")
+    if int(ARGUMENTS.get("PIOVERBOSE", 0)):
+        print("Framework read from Project Config:", pio_orig_frwrk)
+except Exception:
+    pio_orig_frwrk = ""
+
+if "espidf" in pio_orig_frwrk.lower():
     flag_custom_sdkonfig = False
-    print("**** HybridCompile switched off ****")
+    if int(ARGUMENTS.get("PIOVERBOSE", 0)):
+        print("HybridCompile disabled for ESP-IDF-only framework")
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f58a6b and fe6719b.

📒 Files selected for processing (1)
  • builder/frameworks/espidf.py (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 0
File: :0-0
Timestamp: 2025-09-23T12:35:35.508Z
Learning: For the pioarduino/platform-espressif32 project, Jason2866 has explicitly instructed to NEVER create issues or PRs outside of his repositories (pioarduino/*). All issue and PR creation must be strictly limited to his own repositories only, never in upstream or other repositories.
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 0
File: :0-0
Timestamp: 2025-09-23T12:35:35.508Z
Learning: For the pioarduino/platform-espressif32 project, Jason2866 has explicitly instructed to NEVER create issues or PRs outside of his repositories (pioarduino/*). All issue and PR creation must be strictly limited to his own repositories only, never in upstream or other repositories.
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 263
File: platform.py:80-84
Timestamp: 2025-08-20T14:13:13.842Z
Learning: For the pioarduino/platform-espressif32 project, Jason2866 prefers to always override IDF_TOOLS_PATH environment variable with PlatformIO's core directory, rather than respecting any existing user-defined IDF_TOOLS_PATH values. This ensures consistent ESP32 tool management within PlatformIO.
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 281
File: builder/frameworks/component_manager.py:1047-1054
Timestamp: 2025-09-04T15:27:18.112Z
Learning: In the pioarduino/platform-espressif32 project, Jason2866 prefers not to add guard checks for missing arduino_libs_mcu in backup operations, preferring to let the operation proceed rather than silently skip when the directory might be missing.
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 268
File: builder/penv_setup.py:87-96
Timestamp: 2025-08-26T14:52:29.044Z
Learning: For the pioarduino/platform-espressif32 project, Jason2866 prefers to trust system executables when falling back to PATH-based command resolution (like "uv"), rather than implementing additional validation checks for security concerns.
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 0
File: :0-0
Timestamp: 2025-10-19T17:30:42.403Z
Learning: The tool-esp-rom-elfs package must remain in COMMON_IDF_PACKAGES in platform.py because espidf.py requires it to set the ESP_ROM_ELF_DIR environment variable for the ESP-IDF build system, independent of the exception decoder monitor filter usage.
📚 Learning: 2025-09-23T14:15:00.476Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 0
File: :0-0
Timestamp: 2025-09-23T14:15:00.476Z
Learning: In the pioarduino/platform-espressif32 project, espidf.py creates and manages its own separate IDF virtual environment (accessed via get_python_exe() from get_idf_venv_dir()). This IDF venv is completely isolated from the penv setup, so different cryptography versions between penv_setup.py and espidf.py don't cause conflicts as they exist in separate virtual environments.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-23T14:15:00.476Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 0
File: :0-0
Timestamp: 2025-09-23T14:15:00.476Z
Learning: In the pioarduino/platform-espressif32 project, espidf.py creates an extra/separate virtual environment from the penv setup, so cryptography version differences between penv_setup.py and espidf.py do not cause conflicts since they operate in isolated environments.

Applied to files:

  • builder/frameworks/espidf.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build (macos-15, examples/espidf-ulp-lp)
  • GitHub Check: build (macos-15, examples/espidf-ulp)
  • GitHub Check: build (macos-15, examples/arduino-blink)
  • GitHub Check: build (windows-latest, examples/tasmota)
  • GitHub Check: build (windows-latest, examples/espidf-arduino-blink)
  • GitHub Check: build (windows-latest, examples/arduino-blink)

Remove print statements related to framework configuration.
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