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
    • Improved framework detection so ESP-IDF projects are recognized more reliably.
    • Prevents unnecessary Arduino skeleton files from being added for esp32c2 and esp32c61 when ESP-IDF is the configured framework.
    • Disables custom sdkconfig handling for projects confirmed to use ESP-IDF to avoid incorrect build customization.
    • Ensures SDK config generation respects the original framework selection.

✏️ 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

Walkthrough

Reads the project's framework option into pio_orig_frwrk and uses it to disable custom sdkconfig handling when the framework contains "espidf", and to conditionally skip copying Arduino skeleton libs for MCUs esp32c2 and esp32c61 when "espidf" appears in the project framework. Also updates platform logic to pass mcu into Arduino framework configuration and toggle skeleton-lib optional flags based on MCU.

Changes

Cohort / File(s) Summary
ESP-IDF / Arduino integration logic
builder/frameworks/espidf.py
Adds pio_orig_frwrk = env.GetProjectOption("framework"); if pio_orig_frwrk contains "espidf", sets flag_custom_sdkconfig = False to disable custom sdkconfig handling; gates copying of Arduino skeleton libs for esp32c2 and esp32c61 to occur only when "espidf" is not present; adjusts conditional flows to consult pio_orig_frwrk.
Platform Arduino configuration
platform.py
Changes _configure_arduino_framework signature to accept mcu: str and updates all call sites; when Arduino framework is present, sets optional = False for framework-arduino-c2-skeleton-lib if mcu == "esp32c2" and for framework-arduino-c61-skeleton-lib if mcu == "esp32c61"; removes previously applied skeleton-lib toggles from ESP-IDF-specific path and passes mcu into _configure_arduino_framework from configure_default_packages.

Sequence Diagram(s)

sequenceDiagram
    participant Env as Project env
    participant Platform as platform.py
    participant Builder as builder/frameworks/espidf.py
    participant FS as Filesystem

    Env->>Builder: GetProjectOption("framework") -> pio_orig_frwrk
    note right of Builder `#DDEBF7`: pio_orig_frwrk used to control flows

    alt pio_orig_frwrk contains "espidf"
        Builder->>Builder: set flag_custom_sdkconfig = False
        note right of Builder `#FCE9D5`: disable custom sdkconfig handling
    else
        Builder->>Builder: leave flag_custom_sdkconfig as-is
    end

    Platform->>Platform: _configure_arduino_framework(frameworks, mcu)
    Platform->>Builder: pass mcu context for decisions

    Builder->>Builder: check MCU type (mcu)
    alt mcu is esp32c2 or esp32c61
        alt pio_orig_frwrk contains "espidf"
            Builder-->>FS: skip copying Arduino skeleton libs
        else
            Builder-->>FS: copy Arduino skeleton libs
        end
    else
        Builder-->>FS: existing copy/merge behavior
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify correct retrieval and usage of env.GetProjectOption("framework") and that pio_orig_frwrk is not None/empty.
  • Confirm flag_custom_sdkconfig is defined earlier in scope and disabling it doesn't regress other code paths.
  • Check all call sites updated to pass mcu into _configure_arduino_framework and ensure matching signature across the file.

Possibly related PRs

Poem

I nibble lines of config neat, 🐰
Found frameworks hidden, tidy and sweet,
"If espidf's named," I softly say,
"Keep sdkconfig and skeletons at bay,"
Hop, skip—builds now follow my beat. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and concisely summarizes the main change: enabling IDF compilation for MCUs without precompiled Arduino libraries, which matches the core objective of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch idf_c2

📜 Recent 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 5cb5422.

📒 Files selected for processing (2)
  • builder/frameworks/espidf.py (4 hunks)
  • platform.py (3 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
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: 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: 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: 285
File: platform.py:670-683
Timestamp: 2025-09-09T18:07:14.583Z
Learning: In the pioarduino/platform-espressif32 project, when tools.json exists in mklittlefs tool directories, it triggers a reinstall via install_tool(). This is intentional behavior to convert tools installed via idf_tools.py method into the platform's tool management system, rather than a redundant check that should be avoided.
📚 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
📚 Learning: 2025-08-20T14:13:13.842Z
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.

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 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-11-14T14:46:51.257Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 338
File: builder/frameworks/component_manager.py:1312-1380
Timestamp: 2025-11-14T14:46:51.257Z
Learning: In the pioarduino/platform-espressif32 project, the `pioarduino-build.py` file has a fixed format that does not change, so exact string matching (e.g., `'CCFLAGS=['`) is acceptable and regex-based flexible matching is not necessary when modifying this file.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-08-10T19:12:17.988Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 255
File: builder/penv_setup.py:19-19
Timestamp: 2025-08-10T19:12:17.988Z
Learning: In PlatformIO ESP32 platform builds, `semantic_version` is a dependency provided by PlatformIO itself and is guaranteed to be available when the build scripts run. The module is already imported at the top level in existing files like `builder/frameworks/espidf.py`, so lazy-loading it is unnecessary.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-09T18:07:14.583Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 285
File: platform.py:670-683
Timestamp: 2025-09-09T18:07:14.583Z
Learning: In the pioarduino/platform-espressif32 project, when tools.json exists in mklittlefs tool directories, it triggers a reinstall via install_tool(). This is intentional behavior to convert tools installed via idf_tools.py method into the platform's tool management system, rather than a redundant check that should be avoided.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-23T16:55:39.788Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 296
File: builder/penv_setup.py:612-647
Timestamp: 2025-09-23T16:55:39.788Z
Learning: In the pioarduino/platform-espressif32 project, Jason2866 prefers no fallback mechanisms in penv setup functions. The penv virtual environment setup must work properly and should crash immediately rather than falling back to host Python environments, to avoid using "unknown env" configurations.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-05T11:58:49.681Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 281
File: builder/frameworks/ulp.py:165-178
Timestamp: 2025-09-05T11:58:49.681Z
Learning: In the pioarduino/platform-espressif32 project, cmake executable paths in build scripts (like ulp.py) are provided as paths to the build engine (SCons/PlatformIO) rather than direct executable calls. The build engine handles cross-platform executable resolution automatically, so there's no need to add Windows .exe suffixes or special quoting - the current approach with str(Path(...) / "bin" / "cmake") works correctly across platforms.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-04T15:27:18.112Z
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.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-07-13T20:03:29.695Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 225
File: builder/main.py:99-108
Timestamp: 2025-07-13T20:03:29.695Z
Learning: In the ESP32 platform builder, the subprocess call to get site-packages directory in setup_python_paths() function is intentionally left without error handling because if this basic Python operation fails, it indicates a fundamental system issue that would cause the entire build process to fail anyway.

Applied to files:

  • platform.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). (20)
  • GitHub Check: build (macos-15, examples/espidf-ulp)
  • GitHub Check: build (macos-15, examples/espidf-hello-world)
  • GitHub Check: build (macos-15, examples/espidf-blink)
  • GitHub Check: build (windows-latest, examples/espidf-coap-server)
  • GitHub Check: build (macos-15, examples/arduino-blink)
  • GitHub Check: build (macos-15, examples/tasmota)
  • GitHub Check: build (windows-latest, examples/espidf-hello-world)
  • GitHub Check: build (windows-latest, examples/espidf-arduino-littlefs)
  • GitHub Check: build (windows-latest, examples/espidf-peripherals-usb)
  • GitHub Check: build (windows-latest, examples/espidf-peripherals-uart)
  • GitHub Check: build (windows-latest, examples/espidf-blink)
  • GitHub Check: build (windows-latest, examples/espidf-arduino-blink)
  • GitHub Check: build (windows-latest, examples/espidf-http-request)
  • GitHub Check: build (windows-latest, examples/arduino-zigbee-switch)
  • GitHub Check: build (windows-latest, examples/tasmota)
  • GitHub Check: build (windows-latest, examples/arduino-rmt-blink)
  • GitHub Check: build (windows-latest, examples/arduino-wifiscan)
  • GitHub Check: build (ubuntu-latest, examples/espidf-ulp)
  • GitHub Check: build (ubuntu-latest, examples/arduino-zigbee-light)
  • GitHub Check: build (ubuntu-latest, examples/arduino-blink)
🔇 Additional comments (5)
builder/frameworks/espidf.py (3)

79-79: Using pio_orig_frwrk to capture original framework selection looks correct

Storing the unmodified framework option up front is a good way to distinguish true espidf/arduino, espidf projects from the Arduino-only HybridCompile case later in the file; the subsequent checks against pio_orig_frwrk are consistent with that intent.


185-205: C2/C61 skeleton-lib copy is correctly skipped for espidf-based projects

Conditioning the Arduino C2/C61 skeleton-lib copy on mcu == "esp32c2"/"esp32c61" and "espidf" not in pio_orig_frwrk aligns with the goal of allowing pure ESP-IDF (or espidf+arduino) builds to run without requiring precompiled Arduino libs for these MCUs, while still preparing the skeleton tree for Arduino-only flows.


237-240: Custom sdkconfig correctly disabled for espidf / espidf+arduino projects

For environments where the original framework setting already included espidf, forcing flag_custom_sdkonfig = False prevents the HybridCompile-specific HandleArduinoIDFsettings path from running and keeps bootloader/partition generation on the normal ESP‑IDF track. This matches the comment about HybridCompile being strictly a framework = arduino feature.

platform.py (2)

560-582: MCU-aware Arduino skeleton-lib enabling is consistent with the espidf-side changes

Passing mcu in and only forcing framework-arduino-c2-skeleton-lib / framework-arduino-c61-skeleton-lib to optional = False when the target MCU is esp32c2 / esp32c61 cleanly scopes these extra packages to boards that actually need them and only when arduino is part of the framework set. That pairs well with the espidf.py gating so pure ESP‑IDF builds for these MCUs aren’t forced to pull or use the Arduino skeleton libs.

Assuming the platform manifest defines both skeleton-lib packages for all relevant versions, this looks good.


833-833: No issues found – all call sites already updated

The ripgrep search confirms there are only two occurrences of _configure_arduino_framework in the codebase:

  1. The method definition at line 560 with the new signature (self, frameworks: List[str], mcu: str)
  2. The call site at line 833, which is already correctly passing both frameworks and mcu arguments

No call sites using the old single-argument form exist.


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)

@Jason2866
Copy link
Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 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 (2)
builder/frameworks/espidf.py (2)

185-185: Use more Pythonic membership test.

The condition not ("espidf" in pio_orig_frwrk) should be rewritten as "espidf" not in pio_orig_frwrk for better readability and to follow Python style conventions.

Apply this diff:

-    if mcu == "esp32c2" and not ("espidf" in pio_orig_frwrk):
+    if mcu == "esp32c2" and "espidf" not in pio_orig_frwrk:

196-196: Use more Pythonic membership test.

The condition not ("espidf" in pio_orig_frwrk) should be rewritten as "espidf" not in pio_orig_frwrk for better readability and to follow Python style conventions.

Apply this diff:

-    if mcu == "esp32c61" and not ("espidf" in pio_orig_frwrk):
+    if mcu == "esp32c61" and "espidf" not in pio_orig_frwrk:
📜 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 0a6cf98.

📒 Files selected for processing (1)
  • builder/frameworks/espidf.py (4 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
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: 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: 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: 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.
📚 Learning: 2025-08-20T14:13:13.842Z
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.

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
📚 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-09T18:07:14.583Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 285
File: platform.py:670-683
Timestamp: 2025-09-09T18:07:14.583Z
Learning: In the pioarduino/platform-espressif32 project, when tools.json exists in mklittlefs tool directories, it triggers a reinstall via install_tool(). This is intentional behavior to convert tools installed via idf_tools.py method into the platform's tool management system, rather than a redundant check that should be avoided.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-08-08T09:50:01.969Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 252
File: builder/frameworks/espidf.py:1382-1388
Timestamp: 2025-08-08T09:50:01.969Z
Learning: Preference in pioarduino/platform-espressif32 (builder/frameworks/espidf.py): Avoid using {"name": "boot"} as a sentinel when resolving the default app partition offset. Instead, call parttool.py with --partition-boot-default directly (and optionally fall back to factory/ota_0) to prevent confusion with non-existent CSV names.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-10-19T17:30:42.403Z
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.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-04T15:27:18.112Z
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.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-08-10T19:12:17.988Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 255
File: builder/penv_setup.py:19-19
Timestamp: 2025-08-10T19:12:17.988Z
Learning: In PlatformIO ESP32 platform builds, `semantic_version` is a dependency provided by PlatformIO itself and is guaranteed to be available when the build scripts run. The module is already imported at the top level in existing files like `builder/frameworks/espidf.py`, so lazy-loading it is unnecessary.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-23T16:55:39.788Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 296
File: builder/penv_setup.py:612-647
Timestamp: 2025-09-23T16:55:39.788Z
Learning: In the pioarduino/platform-espressif32 project, Jason2866 prefers no fallback mechanisms in penv setup functions. The penv virtual environment setup must work properly and should crash immediately rather than falling back to host Python environments, to avoid using "unknown env" configurations.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-09-05T11:58:49.681Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 281
File: builder/frameworks/ulp.py:165-178
Timestamp: 2025-09-05T11:58:49.681Z
Learning: In the pioarduino/platform-espressif32 project, cmake executable paths in build scripts (like ulp.py) are provided as paths to the build engine (SCons/PlatformIO) rather than direct executable calls. The build engine handles cross-platform executable resolution automatically, so there's no need to add Windows .exe suffixes or special quoting - the current approach with str(Path(...) / "bin" / "cmake") works correctly across platforms.

Applied to files:

  • builder/frameworks/espidf.py
📚 Learning: 2025-11-14T14:46:51.257Z
Learnt from: Jason2866
Repo: pioarduino/platform-espressif32 PR: 338
File: builder/frameworks/component_manager.py:1312-1380
Timestamp: 2025-11-14T14:46:51.257Z
Learning: In the pioarduino/platform-espressif32 project, the `pioarduino-build.py` file has a fixed format that does not change, so exact string matching (e.g., `'CCFLAGS=['`) is acceptable and regex-based flexible matching is not necessary when modifying this file.

Applied to files:

  • builder/frameworks/espidf.py
🪛 Ruff (0.14.5)
builder/frameworks/espidf.py

185-185: Test for membership should be not in

Convert to not in

(E713)


196-196: Test for membership should be not in

Convert to not in

(E713)

⏰ 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). (20)
  • GitHub Check: build (macos-15, examples/espidf-arduino-blink)
  • GitHub Check: build (windows-latest, examples/arduino-zigbee-switch)
  • GitHub Check: build (windows-latest, examples/espidf-storage-sdcard)
  • GitHub Check: build (windows-latest, examples/espidf-http-request)
  • GitHub Check: build (windows-latest, examples/espidf-hello-world)
  • GitHub Check: build (windows-latest, examples/espidf-exceptions)
  • GitHub Check: build (windows-latest, examples/arduino-usb-keyboard)
  • GitHub Check: build (windows-latest, examples/espidf-blink)
  • GitHub Check: build (windows-latest, examples/arduino-zigbee-light)
  • GitHub Check: build (windows-latest, examples/tasmota)
  • GitHub Check: build (windows-latest, examples/arduino-wifiscan)
  • GitHub Check: build (windows-latest, examples/arduino-rmt-blink)
  • GitHub Check: build (ubuntu-latest, examples/espidf-arduino-blink)
  • GitHub Check: build (windows-latest, examples/espidf-arduino-blink)
  • GitHub Check: build (windows-latest, examples/arduino-matter-light)
  • GitHub Check: build (ubuntu-latest, examples/espidf-ulp-riscv)
  • GitHub Check: build (ubuntu-latest, examples/espidf-ulp-lp)
  • GitHub Check: build (ubuntu-latest, examples/espidf-hello-world)
  • GitHub Check: build (ubuntu-latest, examples/espidf-ulp)
  • GitHub Check: build (ubuntu-latest, examples/arduino-wifiscan)
🔇 Additional comments (1)
builder/frameworks/espidf.py (1)

237-240: Verify the logic correctly disables Arduino IDF settings for pure ESP-IDF projects.

The code disables custom sdkconfig handling when "espidf" appears in the framework string. This achieves the PR goal of allowing IDF compilation without Arduino-specific processing. The logic will affect:

  1. Pure framework = espidf projects
  2. Hybrid framework = arduino, espidf projects

Combined with the guard at line 799 (which requires arduino in framework AND espidf not in framework), this ensures HandleArduinoIDFsettings is only called for pure Arduino framework builds, which is correct.

@Jason2866
Copy link
Author

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Nov 24, 2025

✅ Actions performed

Full review triggered.

@Jason2866 Jason2866 merged commit f33de21 into develop Nov 24, 2025
68 checks passed
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