Repository navigation
pre-commit: fix hooks failing on Windows dev checkouts - #4588
Conversation
- agentrc: a git checkout at <root>/.agentrc is an installed agentrc, not a hil_remote stage (a stage is plain files plus a manifest); an in-tree agentrc clone broke every agentrc load since #4436 - host-test: run through tools/hook_steps.py (Windows has no sh), with -G Ninja and ninja from the hook venv so CMake takes gcc rather than Visual Studio's MSVC - build.py get_examples: an example has a CMakeLists.txt; untracked IDE/build leftovers (IAR Debug/, settings/) are not examples - test_build: test_shared_uses_the_canonical_hil_dir runs in a scratch ROOT instead of the developer's real cmake-build dir
[Medium impact] The PR appears safe to merge; the separate build directory fixes the previous hook failure.
|
CMake refuses to reconfigure an existing build/host-test (the README's manual build, Unix Makefiles) under -G Ninja.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Code sizeBaseline: 9f4eb56 (exact) https://github.com/hathach/tinyusb/actions/runs/44813545104
1156 builds on 35 boards compared, 0 changed no changes |
Hardware-in-the-loop (HIL) Test Reporthfp-iar✅ 110 passed · ❌ 0 failed · ⚪ 2 skipped · blank not run
hfp.json✅ 110 passed · ❌ 0 failed · ⚪ 2 skipped · blank not run
tinyusb-esp.json✅ 35 passed · ❌ 1 failed · ⚪ 0 skipped · blank not run
tinyusb.json✅ 487 passed · ❌ 6 failed · ⚪ 26 skipped · blank not run
⚡ SystemView performance — HILbase raspberry_pi_pico — live 17.1 sdevice/cdc_msc · raspberry_pi_pico-sysview · SYSVIEW=4 buffer 65536 · all events · workload cdc_burst r1 15 s · OpenOCD RTT channel 1
xychart-beta
title "hot functions p50 µs (base vs PR)"
x-axis [usbd_edpt_xfer, task, cdc_read, edpt_xfer, cdc_write_flush, mscd_xfer_cb]
y-axis "µs" 0 --> 31.2
bar [11.0, 9.0, 24.0, 6.0, 5.0, 20.0]
bar [11.0, 9.0, 24.0, 6.0, 5.0, 20.0]
stm32f407disco — live 17.1 sdevice/cdc_msc · stm32f407disco-sysview · SYSVIEW=4 buffer 65536 · all events · workload cdc_burst r1 15 s · OpenOCD RTT channel 1
xychart-beta
title "hot functions p50 µs (base vs PR)"
x-axis [task, cdc_read, cdc_write_flush, mscd_xfer_cb, usbd_edpt_xfer, edpt_xfer]
y-axis "µs" 0 --> 19.8
bar [4.6, 10.3, 2.6, 15.2, 9.9, 5.9]
bar [4.6, 10.3, 2.6, 15.2, 9.9, 5.9]
Legend — p50/p99: median / 99th-percentile duration over all calls in the capture window (µs; p50 = typical cost, p99 = tail latency). Δ: change vs base branch; − is faster/better; +∞% marks a jump from an (effectively) zero base -- not literally infinite, just too big to express as a normal percentage; gone marks a row base had that PR does not (work that used to run no longer does, or was renamed -- investigate before merging). pt: percentage points. CPU load, workload win: context's busy share summed from the raw scheduling events over the workload window (the span of |
On a Windows dev checkout
pre-commit run --all-filesfailed 7 hooks (gen-doc, host-test, hil-test, change-impact-test, claude-scripts, drivers-coverage, membrowse-targets). With this PR all 17 hooks pass on Windows.Changes
test/hil/helper/agentrc.py: since hil: load agentrc from the installed copy; only CI fetches the pin #4436, any<root>/.agentrccounts as a copy staged byhil_remote.py. A developer who keeps an agentrc clone at that path (and names it withAGENTRC_DIR) hit.agentrc\manifest.json is not readable JSONon every agentrc load. A staged copy is plain files plus a manifest and never a git checkout, so a.agentrcthat contains.gitis now treated as an installed agentrc. An empty or broken staged copy is still refused. New test:test_an_agentrc_checkout_at_the_stage_path_is_an_install_not_a_stage.sh -cdoesn't exist on Windows, so the hook now runs throughtools/hook_steps.pylike the other multi-step hooks. It also passes-G Ninja, with ninja installed into the hook venv: on Windows CMake's default generator is Visual Studio, whose MSVC the host fixtures refuse. Ninja uses the gcc on PATH (MinGW on Windows, the system gcc on Linux).tools/build.pyget_examples: an example must have aCMakeLists.txt. Untracked IDE or build leftovers (IARDebug/,settings/) were listed as targets, which broke the membrowse-targets mirror test. Every tracked example already has one. The ESP fixture intest_code_size.pygains the top-levelCMakeLists.txtthat real examples have..claude/test/test_build.py:test_shared_uses_the_canonical_hil_dirread the developer's realcmake-build/cmake-build-stm32f407discoand failed when a code-size run had configured it withLINKERMAP_OPTION. It now runs in a scratch ROOT, like the test next to it.Validation
pre-commit run --all-filespasses all 17 hooks on Windows 10 (Python 3.12, ucrt64 gcc). There are no firmware changes.