Skip to content

fix(bloat): make measure_esp32s3_opt_ins.py work on Windows - #2936

Merged
zackees merged 1 commit into
masterfrom
fix/2935-measure-windows-compat
Jun 7, 2026
Merged

zackees merged 1 commit into
masterfrom
fix/2935-measure-windows-compat

Conversation

@zackees

@zackees zackees commented Jun 7, 2026 •

Copy link
Copy Markdown
Member

Smoke-tested: --config baseline on Windows succeeds and produces 339,962 B matching the pinned baseline. Refs #2886, #2935.

Summary by CodeRabbit

  • Chores
    • Enhanced test infrastructure to support cross-platform execution on Windows, Linux, and macOS, improving build reliability and consistency during development and testing across different operating systems.

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.
@zackees
zackees merged commit fd5641d into master Jun 7, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Done to Triage in FastLED Tracker Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f32a4ae6-b1a7-4fcb-b40a-4f166808f0e4

📥 Commits

Reviewing files that changed from the base of the PR and between f43f767 and 7654279.

📒 Files selected for processing (1)
  • tests/measure_esp32s3_opt_ins.py

📝 Walkthrough

Walkthrough

This PR adds dynamic OS-based command selection to the measurement script. New helper functions return Windows-compatible command lists (compile.bat and uv run ci/bloat.py) on Windows and bash-wrapper commands (bash compile and bash bloat) on other platforms. The existing run_compile() and run_bloat() functions are refactored to use these helpers instead of hardcoding bash commands.

Changes

Cross-platform compile and bloat command selection

Layer / File(s) Summary
OS-specific command builder functions
tests/measure_esp32s3_opt_ins.py
Adds _run_compile_cmd(example) to return Windows compile.bat or non-Windows bash compile with preserved flags, and _run_bloat_cmd() to return Windows uv run ci/bloat.py or non-Windows bash bloat with preserved arguments.
Integration with run_compile and run_bloat
tests/measure_esp32s3_opt_ins.py
Updates run_compile() and run_bloat() to obtain OS-specific command lists from the new helper functions and execute them, preserving existing subprocess logic and success criteria.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#2906: Both PRs modify tests/measure_esp32s3_opt_ins.py's compile and bloat invocation—the retrieved PR introduced the initial bash compile/bash bloat pipeline, and this PR makes it OS-aware to support Windows.
  • FastLED/FastLED#2883: This PR updates run_bloat() and run_compile() to dynamically select between OS-specific entrypoints, directly building on the bash bloat wrapper and ci/bloat.py backend introduced in the retrieved PR.

Poem

🐰 Cross-platform hops, no more bash tears—
Windows and Unix, together at last!
compile.bat here, bash wrappers there,
One script to rule them all, with platform.system() care! 🎯

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/2935-measure-windows-compat

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant