Skip to content

Bump meson floor to >=1.11.0 (fixes DirectoryLock NoneType crash on Windows) #2482

Closed

Description

@zackees

Summary

pyproject.toml:26 pins meson>=1.10.0. meson 1.9.x and 1.10.x have a Windows-only bug in DirectoryLock.__enter__ that produces a cryptic AttributeError: 'NoneType' object has no attribute 'fileno' crash instead of a real error, blocking the WASM build pipeline.

The fix is upstream and shipped in meson 1.11.0.

Repro

On Windows + Python 3.13 + meson 1.9.1 (or 1.10.x), running the fastled-wasm CLI against a FastLED sketch:

$ fastled --just-compile examples/Blink
[WASM] Configuring meson (mode: quick)...
Traceback (most recent call last):
  File ".../mesonbuild/mesonmain.py", line 193, in run
    return options.run_func(options)
  File ".../mesonbuild/msetup.py", line 395, in run
    app.generate()
  File ".../mesonbuild/msetup.py", line 191, in generate
    with mesonlib.DirectoryLock(self.build_dir, 'meson-private/meson.lock',
                                mesonlib.DirectoryLockAction.FAIL,
                                'Some other Meson process is already using this build directory. Exiting.'):
  File ".../mesonbuild/utils/win32.py", line 34, in __enter__
    msvcrt.locking(self.lockfile.fileno(), mode, 1)
                   ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'fileno'

ERROR: Unhandled python exception
    This is a Meson bug and should be reported!
Native Rust WASM build failed: meson setup failed with exit code: 2

Root cause

In meson 1.9.x and 1.10.x, DirectoryLock.__enter__ on Windows has a missing raise in the except OSError block:

# meson 1.10.0 — buggy
except OSError:
    if self.action == DirectoryLockAction.IGNORE or self.optional:
        return
    # NO raise here — falls through with self.lockfile = None
try:
    ...
    msvcrt.locking(self.lockfile.fileno(), mode, 1)  # crashes here

When open(lockpath, 'w+') raises an OSError that isn't FileNotFoundError/IsADirectoryError (e.g., a file-locking conflict with a previous build), and the action is FAIL (the default), execution falls through to the lock attempt against self.lockfile = None.

Fix upstream

mesonbuild/meson@fb6db407 ("utils: make .wraplock optional", 2025-08-26) added the missing raise. The first PyPI release containing it is meson 1.11.0.

meson version DirectoryLock OSError handler
1.9.x buggy
1.10.x buggy
1.11.0+ ✅ fixed

Proposed change

pyproject.toml:26:

-    "meson>=1.10.0",
+    "meson>=1.11.0",

That guarantees pip install fastled (or pip install meson directly) pulls a release where the cryptic NoneType crash is replaced by the actual underlying OSError with a real reason, which is diagnosable.

Notes

  • Bumping the floor only converts the misleading crash into a clean error. The downstream OSError that originally triggered the fallthrough is still worth investigating — it's likely a stale meson-private/meson.lock file lock from a previous abandoned process on Windows.
  • A parallel discussion in zackees/fastled-wasm is looking at whether the WASM build orchestration should use clang-tool-chain-emcc directly (the documented entry in ci/meson/wasm_cross_file.ini) instead of synthesizing its own cross-file at runtime. That's separate from this meson floor bump.

Activity

  1. added a commit that references this issue on May 18, 2026
    1c5f873
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