Skip to content

Commit 09aa588

Browse files
committed
fix
1 parent 52fbb81 commit 09aa588

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

‎src/fastled/toolchain/emscripten.py‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,21 @@ def _download_fastled(self, target_dir: Path) -> Path:
369369
else:
370370
raise FileNotFoundError("Failed to extract FastLED library")
371371

372-
return fastled_dir
372+
# Rename to a shorter name to avoid Windows path length limits.
373+
# The deeply nested build paths (e.g. .build/meson-wasm-quick/...)
374+
# combined with long directory names cause emar command lines to
375+
# exceed Windows' CreateProcess limit ([WinError 206]).
376+
short_dir = target_dir / "repo"
377+
if short_dir.exists():
378+
shutil.rmtree(short_dir, ignore_errors=True)
379+
fastled_dir.rename(short_dir)
380+
return short_dir
373381

374382
def _is_cache_fresh(self) -> bool:
375383
"""Check if the cached FastLED download is still fresh."""
376384
import time
377385

378-
timestamp_file = self.CACHE_DIR / "fastled-master" / ".cache_timestamp"
386+
timestamp_file = self.CACHE_DIR / "fl" / ".cache_timestamp"
379387
if not timestamp_file.exists():
380388
return False
381389
try:
@@ -396,18 +404,14 @@ def _get_fastled_path(self) -> Path:
396404
return self._fastled_path
397405

398406
# Check persistent cache
399-
cache_extract_dir = self.CACHE_DIR / "fastled-master"
407+
cache_extract_dir = self.CACHE_DIR / "fl"
400408
if cache_extract_dir.exists() and self._is_cache_fresh():
401-
# Find the FastLED dir inside the cache
402-
dirs = [
403-
d
404-
for d in cache_extract_dir.iterdir()
405-
if d.is_dir() and d.name.startswith("FastLED")
406-
]
407-
if dirs:
409+
# Check for the renamed "repo" dir (short name to avoid Windows path limits)
410+
repo_dir = cache_extract_dir / "repo"
411+
if repo_dir.is_dir():
408412
print("Using cached FastLED library...")
409-
self._fastled_path = dirs[0]
410-
return dirs[0]
413+
self._fastled_path = repo_dir
414+
return repo_dir
411415

412416
# Download to persistent cache
413417
cache_extract_dir.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)