Repository navigation
fix(bloat): make measure_esp32s3_opt_ins.py work on Windows - #2936
Conversation
When running on Windows via `uv run python tests/measure_esp32s3_opt_ins.py`,
the previous `subprocess.run(["bash", "compile", ...])` failed with:
WSL ERROR: CreateProcessCommon:818: execvpe(/bin/bash) failed:
No such file or directory
`bash` is not on PATH in a non-WSL Windows Python (the WSL relay-only
bash on the default PATH does not provide `/bin/bash`). The project
ships a `compile.bat` Windows wrapper for the same reason
`ci/bloat.py` uses it. Mirror that pattern.
For `bash bloat`, there is no `bloat.bat` shim — the bash wrapper is
a one-line `uv run ci/bloat.py "$@"`, so we invoke the Python entry
point directly on Windows.
Both branches use absolute paths via `PROJECT_ROOT` because Windows
`subprocess.run` does not auto-resolve `.bat` files relative to the
`cwd` argument.
## Files
- tests/measure_esp32s3_opt_ins.py:
- New `_run_compile_cmd(example)` helper picks bash compile (Linux)
or absolute-path compile.bat (Windows).
- New `_run_bloat_cmd()` helper picks bash bloat (Linux) or
`uv run ci/bloat.py` (Windows).
- `run_compile` / `run_bloat` use the helpers.
## Verification
- `uv run python tests/measure_esp32s3_opt_ins.py --config baseline`
on Windows: succeeded; produced `total_flash = 339,962 B` (matches
the current pinned baseline).
- bash lint -> all linters pass.
Refs #2886, #2935, #2906, #2934.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds dynamic OS-based command selection to the measurement script. New helper functions return Windows-compatible command lists ( ChangesCross-platform compile and bloat command selection
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Smoke-tested:
--config baselineon Windows succeeds and produces 339,962 B matching the pinned baseline. Refs #2886, #2935.Summary by CodeRabbit