Repository navigation
Description
Background
Follow-up to #2482. Bumping the meson floor to 1.11.0 (#2483) replaced the cryptic AttributeError: 'NoneType' object has no attribute 'fileno' with the real underlying OSError. The crash is gone, but the underlying cause — a stale lockfile from an abandoned/killed meson process on Windows — is still unhandled.
Root cause
Neither the WASM nor the native build path cleans <build_dir>/meson-private/meson.lock before invoking meson setup:
ci/wasm_build.py:464-472(ensure_meson_configured)ci/wasm_build.py:488-494(force-reconfigure path)ci/meson/build_config.py:1502-1508and1916-1929(setup_meson_build)
Existing stale-state recovery handles other artifacts but not the lockfile:
- Stale test caches:
build_config.py:1931-1961(detects "does not exist", clearstest_metadata.cache/test_list_cache.txt, retries setup once). - Stale WASM build state:
wasm_build.py:357-426and1547-1584(_recover_stale_wasm_build) — deletes.ninja_depsand metadata caches on link failures.
If a previous meson process was Ctrl-C'd or killed on Windows, the next setup hits an OSError from the lockfile and fails with no automatic recovery.
Proposed change
- Before
meson setupruns, remove<build_dir>/meson-private/meson.lockif it exists. Log the cleanup so users see it happened.- Add to
ensure_meson_configured()inci/wasm_build.py(lines 464-472 and 488-494). - Add to
setup_meson_build()inci/meson/build_config.py(around line 1911).
- Add to
- Extend
_recover_stale_wasm_build()(aroundwasm_build.py:402-414) to also deletemeson-private/meson.lockbefore the reconfigure attempt. - Optional Windows CI safety: pre-build step to kill any orphaned
meson.exeprocesses before invoking build scripts.
Risk
Low. The lockfile is recreated by every meson setup invocation and only matters during concurrent meson runs (which the FastLED build orchestration does not perform). Deleting a stale lockfile is safe under the current single-process invocation pattern.
Acceptance
- Windows users hitting the original symptom from Bump meson floor to >=1.11.0 (fixes DirectoryLock NoneType crash on Windows) #2482 no longer see meson setup fail when a previous run was killed.
- New cleanup is logged so the behavior is visible.
Activity
fix(build): clean stale meson lockfile before setup (#2486)