Skip to content

Clean stale meson-private/meson.lock before meson setup (Windows) #2484

Closed

Description

@zackees

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-1508 and 1916-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", clears test_metadata.cache / test_list_cache.txt, retries setup once).
  • Stale WASM build state: wasm_build.py:357-426 and 1547-1584 (_recover_stale_wasm_build) — deletes .ninja_deps and 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

  1. Before meson setup runs, remove <build_dir>/meson-private/meson.lock if it exists. Log the cleanup so users see it happened.
    • Add to ensure_meson_configured() in ci/wasm_build.py (lines 464-472 and 488-494).
    • Add to setup_meson_build() in ci/meson/build_config.py (around line 1911).
  2. Extend _recover_stale_wasm_build() (around wasm_build.py:402-414) to also delete meson-private/meson.lock before the reconfigure attempt.
  3. Optional Windows CI safety: pre-build step to kill any orphaned meson.exe processes 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

Activity

  1. added a commit that references this issue on May 18, 2026
    ab36dc7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions