From f59d468a9865bad31189bb35e6b09db29d6a99a3 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Thu, 23 Jun 2022 16:38:01 -0500 Subject: [PATCH] Re-enable wasm32-unknown-emscripten target. Uses a trick described in rust-lang/rust/issues#85821#issuecomment-969369677. Note that this still allows it to run, despite there seemingly being no entry point: this has no effect on the resulting code. Related to #609. Partially fixes #839. --- .github/workflows/ci.yml | 4 ++-- docker/Dockerfile.wasm32-unknown-emscripten | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9b511828..84a815d7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,9 +182,9 @@ jobs: - { target: x86_64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1, runners: qemu-user } - { target: x86_64-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 } - { target: i686-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 } - # Disabled for now, see https://github.com/rust-lang/rust/issues/85821 + # Disabled for now, see https://github.com/rust-lang/rust/issues/98216 #- { target: asmjs-unknown-emscripten, os: ubuntu-latest, cpp: 1, std: 1, run: 1 } - #- { target: wasm32-unknown-emscripten, os: ubuntu-latest, cpp: 1, std: 1, run: 1 } + - { target: wasm32-unknown-emscripten, os: ubuntu-latest, cpp: 1, std: 1, run: 1 } - { target: x86_64-unknown-dragonfly, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, build-std: 1 } - { target: i686-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 } - { target: x86_64-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 } diff --git a/docker/Dockerfile.wasm32-unknown-emscripten b/docker/Dockerfile.wasm32-unknown-emscripten index 8b458cbaa..962f48c14 100644 --- a/docker/Dockerfile.wasm32-unknown-emscripten +++ b/docker/Dockerfile.wasm32-unknown-emscripten @@ -16,4 +16,5 @@ RUN apt-get update && apt-get install --assume-yes --no-install-recommends \ python ENV CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node \ - BINDGEN_EXTRA_CLANG_ARGS_wasm32_unknown_emscripten="--sysroot=/emsdk/upstream/emscripten/cache/sysroot" + BINDGEN_EXTRA_CLANG_ARGS_wasm32_unknown_emscripten="--sysroot=/emsdk/upstream/emscripten/cache/sysroot" \ + EMCC_CFLAGS="-s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry ${EMCC_CFLAGS}"