-
Notifications
You must be signed in to change notification settings - Fork 51
install pioarduino core in penv #254
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
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe update modifies how the "platformio" dependency is specified and installed. Instead of using a version constraint, it now references a direct GitHub archive URL. The installation logic is adjusted to bypass version checks for "platformio" and to handle direct URL or VCS package specifications correctly when constructing the pip install list. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Builder
participant Pip
User->>Builder: Run dependency installation
Builder->>Builder: Check installed packages
alt platformio present
Builder->>Builder: Skip version check for platformio
else platformio not present
Builder->>Builder: Add platformio (from URL) to install list
end
Builder->>Builder: Process other dependencies
alt Dependency is URL/VCS
Builder->>Builder: Add URL/VCS spec directly to install list
else
Builder->>Builder: Add "name+version" to install list
end
Builder->>Pip: Install all packages from constructed list
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
builder/main.py (1)
248-255
: Good: direct URL/VCS specs handled; generalize earlier to avoid future crashesThe install list logic correctly passes direct specs (http/https/git+/file) straight to pip. However, get_packages_to_install still assumes all non-platformio specs are semver constraints. If another dep later uses a direct URL/VCS, semantic_version.Spec(spec) will raise.
Recommended:
- Add a small helper is_direct_spec(spec) and use it both in get_packages_to_install and here.
- In get_packages_to_install: if is_direct_spec(spec), either (a) always reinstall only when missing, or (b) parse an expected version (when possible) similarly to platformio; otherwise skip version checks.
Example helper (outside these lines):
def is_direct_spec(spec: str) -> bool: return isinstance(spec, str) and spec.startswith(("http://", "https://", "git+", "file://"))Then in get_packages_to_install:
for package, spec in deps.items(): if package not in installed_packages: yield package elif is_direct_spec(spec): # Consider extracting/validating version when possible, else accept installed continue # ... existing semver Spec logic ...This keeps behavior consistent and future-proof.
Please confirm that uv pip list reports the package name as "platformio" when installing from the given GitHub zip (to ensure installed_packages reflects it correctly).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
builder/main.py
(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#237
File: platform.py:200-201
Timestamp: 2025-07-29T11:35:26.182Z
Learning: In platform.py, the `tool-esp_install` package intentionally transitions from mandatory to optional status after successful installation. Initially it's needed and mandatory for installation, but becomes optional once installed since it's no longer required for subsequent operations. Setting `self.packages[tl_install_name]["optional"] = True` after version verification is the intended design pattern.
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#252
File: builder/frameworks/espidf.py:1382-1388
Timestamp: 2025-08-08T09:50:01.956Z
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.
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#199
File: examples/arduino-blink/platformio.ini:81-83
Timestamp: 2025-06-26T09:56:30.658Z
Learning: In examples/arduino-blink/platformio.ini, the different lib_ignore configurations across environments (some including wifi, some not, different syntax styles) are intentional test cases, not inconsistencies that need to be fixed.
📚 Learning: 2025-07-29T11:35:26.182Z
Learnt from: Jason2866
PR: pioarduino/platform-espressif32#237
File: platform.py:200-201
Timestamp: 2025-07-29T11:35:26.182Z
Learning: In platform.py, the `tool-esp_install` package intentionally transitions from mandatory to optional status after successful installation. Initially it's needed and mandatory for installation, but becomes optional once installed since it's no longer required for subsequent operations. Setting `self.packages[tl_install_name]["optional"] = True` after version verification is the intended design pattern.
Applied to files:
builder/main.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/arduino-NimBLE-ext_client)
- GitHub Check: build (windows-latest, examples/espidf-http-request)
- GitHub Check: build (macos-15, examples/arduino-blink)
- GitHub Check: build (macos-15, examples/arduino-zigbee-light)
- GitHub Check: build (windows-latest, examples/espidf-storage-sdcard)
- GitHub Check: build (windows-latest, examples/espidf-coap-server)
- GitHub Check: build (ubuntu-latest, examples/espidf-ulp)
- GitHub Check: build (windows-latest, examples/espidf-exceptions)
- GitHub Check: build (windows-latest, examples/arduino-matter-light)
- GitHub Check: build (windows-latest, examples/arduino-zigbee-switch)
- GitHub Check: build (ubuntu-latest, examples/espidf-storage-sdcard)
- GitHub Check: build (ubuntu-latest, examples/espidf-ulp-lp)
- GitHub Check: build (windows-latest, examples/arduino-wifiscan)
- GitHub Check: build (ubuntu-latest, examples/espidf-arduino-blink)
- GitHub Check: build (ubuntu-latest, examples/tasmota)
- GitHub Check: build (ubuntu-latest, examples/espidf-arduino-matter-light)
- GitHub Check: build (ubuntu-latest, examples/espidf-arduino-C6-ULP-blink)
- GitHub Check: build (ubuntu-latest, examples/arduino-NimBLE-ext_client)
- GitHub Check: build (ubuntu-latest, examples/arduino-wifiscan)
- GitHub Check: build (ubuntu-latest, examples/arduino-blink)
🔇 Additional comments (1)
builder/main.py (1)
52-52
: Inconsistent Enforcement of Pinned PlatformIO VersionYou’ve pinned PlatformIO in
python_deps
to the v6.1.18 archive URL, but inget_packages_to_install
(builder/main.py:152–155) you skip re-installing “platformio” if any version is already present. This allows an out-of-sync core to persist despite your URL pin.Please clarify your intended behavior and adjust accordingly:
- Enforce the exact v6.1.18 core by parsing the URL version and yielding
platformio
when the installed version doesn’t match.- Always reinstall from the URL (remove or rethink the
elif package == "platformio": continue
branch).- Or accept any installed PlatformIO version (in which case the URL pin should be documented as “initial bootstrap only”).
Files/Lines to Review:
- builder/main.py: python_deps entry at line 52
- builder/main.py:
get_packages_to_install
branch at lines 152–155
Checklist:
Summary by CodeRabbit