Repository navigation
Description
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 hereWhen 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
OSErrorthat originally triggered the fallthrough is still worth investigating — it's likely a stalemeson-private/meson.lockfile 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-emccdirectly (the documented entry inci/meson/wasm_cross_file.ini) instead of synthesizing its own cross-file at runtime. That's separate from this meson floor bump.
Activity
build: bump meson floor to >=1.11.0 (#2483)