Skip to content

fix(win): EMCC_CORES=128 causes emcc subprocess crashes during system-lib build #116

Closed

Description

@zackees

Bug

After fixes #111, #113, #114, #115, the build proceeds through library compile, sketch compile, and starts the final em++ wasm link. While emscripten builds its sysroot libraries from source, an emcc subprocess crashes with an access-violation-style exit code:

cache:INFO: generating system library: ...libcompiler_rt-mt.a...
em++: error: subprocess 43/183 failed (returned 3221356611)! (cmdline: 'emcc.bat' -c -O2 ... ../../../system/lib/compiler-rt/lib/builtins/divsf3.c)
Native Rust WASM build failed: em++ wasm link failed with exit code: 1

Cause

crates/fastled-cli/src/wasm_build.rs unconditionally sets EMCC_CORES=128 on Windows. That tells emscripten to spawn up to 128 concurrent emcc Python subprocesses during the libc/compiler_rt build. On typical hardware that vastly exceeds the host's logical-core count, and Windows process pressure plus Python's slow startup makes one of them flake (exit code 3221356611, which is in the access-violation family).

Fix

Replace the hard-coded 128 with std::thread::available_parallelism() clamped to ~32. Match the host.

Activity

  1. zackees commented on Jun 2, 2026

    @zackees
    MemberAuthor

    Resolved by merged PR #118 (e008ca3e). Current origin/main sets EMCC_CORES from std::thread::available_parallelism().min(32) instead of hard-coding 128, avoiding excessive Windows emcc subprocess fan-out.

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