-
Notifications
You must be signed in to change notification settings - Fork 75
Windows fix to use needed path length shorten together with user middleware #358
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
Ensure smart_include_length_shorten is added to build middlewares on Windows.
|
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 WalkthroughOn Windows, the code now wraps include-length shortening with an integrated middleware that intercepts user middleware calls, captures custom flags, merges them into the environment, executes the shortening logic, and restores the original state for cooperative middleware execution. Changes
Sequence DiagramsequenceDiagram
participant Build as Build System
participant IntMW as Integrated Middleware
participant UserMW as User Middleware(s)
participant Shorten as smart_include_length_shorten
participant Env as Environment
Build->>IntMW: Initiate build with middlewares
activate IntMW
IntMW->>Env: Capture original environment state
loop For each user middleware
IntMW->>UserMW: Call user middleware
activate UserMW
UserMW->>IntMW: env.Object() with custom flags
deactivate UserMW
IntMW->>Env: Capture custom flags from user middleware
IntMW->>Env: Merge flags into environment
end
IntMW->>Shorten: Execute smart_include_length_shorten
activate Shorten
Shorten->>Env: Process with merged flags
deactivate Shorten
IntMW->>Env: Restore original environment state
deactivate IntMW
Build->>Build: Continue build process
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
|
@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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
builder/frameworks/arduino.py(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
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-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: 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.
📚 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/arduino.py
🪛 Ruff (0.14.7)
builder/frameworks/arduino.py
949-949: Unused function argument: node_arg
(ARG001)
⏰ 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). (18)
- GitHub Check: build (macos-15, examples/espidf-ulp)
- GitHub Check: build (macos-15, examples/espidf-arduino-C6-ULP-blink)
- GitHub Check: build (macos-15, examples/espidf-http-request)
- GitHub Check: build (macos-15, examples/arduino-rmt-blink)
- GitHub Check: build (macos-15, examples/arduino-wifiscan)
- GitHub Check: build (windows-latest, examples/espidf-arduino-blink)
- GitHub Check: build (windows-latest, examples/espidf-http-request)
- GitHub Check: build (windows-latest, examples/espidf-coap-server)
- GitHub Check: build (windows-latest, examples/espidf-storage-sdcard)
- GitHub Check: build (windows-latest, examples/espidf-hello-world)
- GitHub Check: build (windows-latest, examples/tasmota)
- GitHub Check: build (windows-latest, examples/espidf-blink)
- GitHub Check: build (windows-latest, examples/arduino-usb-keyboard)
- GitHub Check: build (windows-latest, examples/arduino-wifiscan)
- GitHub Check: build (windows-latest, examples/espidf-arduino-littlefs)
- GitHub Check: build (windows-latest, examples/arduino-blink)
- GitHub Check: build (ubuntu-latest, examples/espidf-arduino-matter-light)
- GitHub Check: build (ubuntu-latest, examples/arduino-blink)
Update middleware handling to support varying argument counts.
|
@coderabbitai tested your changes, breaks compile. Your assumptions are wrong. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 36236 🏁 Script executed: Length of output: 3668 @Jason2866, I sincerely apologize for the broken suggestion. I can see from the git log that you've already reverted my changes in commit b769742. Looking at the diff, my middleware integration approach had fundamental flaws:
Could you share the specific compilation error you encountered? Understanding what actually broke would help ensure I don't make similar assumptions in the future. For the original goal (using Again, my apologies for the disruption to your build process. 🧠 Learnings used |
|
@coderabbitai The error with your code change |
|
Tip For best results, initiate chat on the files or code changes. @Jason2866, thank you for sharing the error output - this is very revealing and confirms exactly what went wrong. The error "Nothing to build" despite the middleware clearly being applied ( Here's what happened:
The fundamental flaw in my approach was trying to intercept and wrap I apologize again for the broken suggestion. Since you've already reverted the changes, what approach would you like to take to solve the original problem of using ✏️ Learnings added
🧠 Learnings used |
|
@coderabbitai I am fine with the current approach. It is working. |
|
Tip For best results, initiate chat on the files or code changes. @Jason2866, thank you for confirming! I'm glad the current approach is working after the revert. The original implementation clearly handles the Windows path length limitation with user middlewares correctly without the unnecessary complexity I tried to introduce. I appreciate your patience in testing and providing the detailed error output - it helped me understand exactly what went wrong with my suggestion and avoid similar mistakes in the future. 🧠 Learnings used |
Description:
Since Windows has the problem of limited path and command length limit, a SCons middleware is implemented to workaround this problem. This PR fixes that no user middleware was possible to use with Windows
Checklist:
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.