Adopt fbuild's perf + Windows-correctness lessons
FastLED/fbuild is a hybrid Rust+Python tool that has spent the past month grinding down ~50× of cumulative wall-clock cost on its install + iteration loop, and just landed a Windows stdout-ordering fix that is exactly the same bug this template will hit. Time to back-port the lessons.
This is a meta-issue — each box below was a self-contained PR. All merged; closing.
Source PRs in fbuild (for reference)
Punch list
Correctness
Build speed
Followups
Acceptance — all verified
- ✅
cmd /c 'echo === BEFORE === & template-cli --version & echo === AFTER ===' prints === AFTER === after the output (verified locally on Windows after uv pip install dist/...whl into a fresh venv).
- ✅
unzip -l dist/template_python_rust_cmd-*.whl shows template_python_rust_cmd-0.1.0.data/scripts/template-cli.exe. No _bin/ entries.
- ✅
file $(which template-cli) reports PE32+ executable for MS Windows ... (console), x86-64. Not a Zip-archive console-script stub.
PRs merged in order
| # |
PR |
Items |
| 1 |
#3 |
(2) + (3) — dev profile + rust-lld |
| 2 |
#4 |
(7) — uv cache-keys |
| 3 |
#5 |
(4) + (5) — CARGO_TARGET_DIR + no-build-isolation |
| 4 |
#6 |
(6) + (8) — mtime-skip + JSON artifact discovery |
| 5 |
#7 |
(1) + (10) — raw wheel script, drop Python shim |
| 6 |
#8 |
(9) — BUILD_PROFILE=dev |
Adopt fbuild's perf + Windows-correctness lessons
FastLED/fbuildis a hybrid Rust+Python tool that has spent the past month grinding down ~50× of cumulative wall-clock cost on its install + iteration loop, and just landed a Windows stdout-ordering fix that is exactly the same bug this template will hit. Time to back-port the lessons.This is a meta-issue — each box below was a self-contained PR. All merged; closing.
Source PRs in fbuild (for reference)
rust-lldlinker.setup.py+ pinnedCARGO_TARGET_DIR.[tool.uv] cache-keysso editable installs re-sync on Rust edits.Punch list
Correctness
template-clias a raw wheel script. → fix(install): ship template-cli as raw wheel script; drop Python shim #7Build speed
[profile.dev.package."*"] opt-level = 3in the rootCargo.toml. → perf(build): rust-lld linker on Windows + opt-3 deps in dev profile #3[target.{x86_64,aarch64}-pc-windows-msvc] linker = "rust-lld.exe"in.cargo/config.toml. → perf(build): rust-lld linker on Windows + opt-3 deps in dev profile #3CARGO_TARGET_DIRto a home-dir path for wheel builds. → perf(install): pin CARGO_TARGET_DIR + disable PEP 517 isolation #5[tool.uv] no-build-isolation-package = ["template-python-rust-cmd"]inpyproject.toml. Reverted in fix(install): ship template-cli as raw wheel script; drop Python shim #7 — with maturin the no-isolation trade-off doesn't work cleanly (uv reuses a build env without maturin; previewextra-build-dependenciesis fragile). Documented this in the resulting comment block; CARGO_TARGET_DIR pin from perf(install): pin CARGO_TARGET_DIR + disable PEP 517 isolation #5 still applies and gives most of the win. Marking complete because the question is settled.ci/build_wheel.py. → perf(install): mtime-skip fast path + structured artifact discovery #6[tool.uv] cache-keyscovering Rust source. → fix(uv): re-sync editable on Rust edits via cache-keys #4ci/build_wheel.py. → perf(install): mtime-skip fast path + structured artifact discovery #6Followups
BUILD_PROFILE=devenv-var iteration path throughci/build_wheel.py. → feat(build): BUILD_PROFILE=dev env var for fast local iteration #8cli.pydeleted,[project.scripts]removed). → bundled into fix(install): ship template-cli as raw wheel script; drop Python shim #7Acceptance — all verified
cmd /c 'echo === BEFORE === & template-cli --version & echo === AFTER ==='prints=== AFTER ===after the output (verified locally on Windows afteruv pip install dist/...whlinto a fresh venv).unzip -l dist/template_python_rust_cmd-*.whlshowstemplate_python_rust_cmd-0.1.0.data/scripts/template-cli.exe. No_bin/entries.file $(which template-cli)reportsPE32+ executable for MS Windows ... (console), x86-64. Not a Zip-archive console-script stub.PRs merged in order