Skip to content

Emscripten: emcc not found on win32 cross-compile #239

Closed
@vvanders

Description

@vvanders

Saw this on Nightly a few months back and just thought it was a stability issue but looks like with the recent 1.20 release it's made it into stable:

(note some portion of the paths are sanitized with 'zzz')

error: failed to run custom build command for `lua v0.0.11 (file:///C:/zzz/rust-lua53)`
process didn't exit successfully: `C:\zzz\target\release\build\lua-91f996492c3978b1\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("asmjs-unknown-emscripten")
OPT_LEVEL = Some("3")
TARGET = Some("asmjs-unknown-emscripten")
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("asmjs-unknown-emscripten")
TARGET = Some("asmjs-unknown-emscripten")
HOST = Some("x86_64-pc-windows-msvc")
CC_asmjs-unknown-emscripten = None
CC_asmjs_unknown_emscripten = None
TARGET_CC = None
CC = None
TARGET = Some("asmjs-unknown-emscripten")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_asmjs-unknown-emscripten = None
CFLAGS_asmjs_unknown_emscripten = None
TARGET_CFLAGS = None
CFLAGS = None
PROFILE = Some("release")
running: "emcc.bat" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-DLUA_32BITS" "-DLUA_COMPAT_LOADSTRING" "-o" "C:\\zzz\target\\asmjs-unknown-emscripten\\release\\build\\lua-7f6f6329781534a1\\out\\lua-source\\src\\lapi.o" "-c" "lua-source\\src\\lapi.c"
cargo:warning=python: can't open file 'C:\zzz\rust-lua53\\emcc': [Errno 2] No such file or directory
exit code: 2

When I was debugging this before the issue came down to how Command was now pulling in certain environment variables.

Specifically the way emcc is invoked through emcc.bat on windows:

@echo off
python "%~dp0\emcc" %*

Here "%~dp0" is supposed to be the folder of where emcc.bat exists, however when run from the rust Command it ends up being the folder that the crate is being build it.

Let me know if this makes better sense as an issue in the core Rust project. Right now I can't build emscripten since 1.20 fails and I can't get 1.19 to install the emscripten component when pinned to 1.19.

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