Skip to content

Commit

Permalink
Merge cross-rs#709
Browse files Browse the repository at this point in the history
709: Update Emscripten targets to latest official Docker image r=Emilgardis a=Jules-Bertholet



Co-authored-by: Jules Bertholet <[email protected]>
  • Loading branch information
bors[bot] and Jules-Bertholet authored May 9, 2022
2 parents c8cb80b + ec8c32b commit 4deac83
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 42 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ jobs:
- { target: x86_64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { 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
#- { 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 }
# Disabled, see #396
#-{ target: x86_64-unknown-dragonfly, os: ubuntu-latest, cpp: 1, dylib: 1 }
- { target: i686-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 }
Expand All @@ -162,10 +165,6 @@ jobs:
# Disabled, see #534
#-{ target: sparcv9-sun-solaris, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1 }
#-{ target: x86_64-sun-solaris, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1 }
# Disabled, see #634
#-{ target: asmjs-unknown-emscripten, os: ubuntu-latest, std: 1, run: 1 }
# `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`.
#-{ target: wasm32-unknown-emscripten, os: ubuntu-latest, std: 1 }
- { target: thumbv6m-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv7em-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv7em-none-eabihf, os: ubuntu-latest, std: 1 }
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- #709 - Update Emscripten targets to `emcc` version 3.1.10
- #707, #708 - Set `BINDGEN_EXTRA_CLANG_ARGS` environment variable to pass sysroot to `rust-bindgen`
- #696 - bump freebsd to 12.3
- #629 - Update Android NDK version and API version
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ terminate.
| `armv7-linux-androideabi` [2] | 9.0.0 | 4.9 || 5.1.0 ||
| `armv7-unknown-linux-gnueabihf` | 2.15 | 4.6.2 || 5.1.0 ||
| `armv7-unknown-linux-musleabihf` | 1.1.20 | 6.3.0 | | 5.1.0 ||
| `asmjs-unknown-emscripten` [6] | 1.2.2 | 3.1.10 || N/A ||
| `i586-unknown-linux-gnu` | 2.23 | 5.3.1 || N/A ||
| `i586-unknown-linux-musl` | 1.1.20 | 6.3.0 | | N/A ||
| `i686-unknown-freebsd` [4] | 12.1 | 6.4.0 | | N/A ||
Expand All @@ -301,7 +302,7 @@ terminate.
| `thumbv7em-none-eabi` [5] | 2.2.0 | 5.3.1 | | N/A | |
| `thumbv7em-none-eabihf` [5] | 2.2.0 | 5.3.1 | | N/A | |
| `thumbv7m-none-eabi` [5] | 2.2.0 | 5.3.1 | | N/A | |
| `wasm32-unknown-emscripten` [6] | 1.1.15 | 1.37.13 || N/A ||
| `wasm32-unknown-emscripten` [6] | 1.2.2 | 3.1.10 || N/A ||
| `x86_64-linux-android` [2] | 9.0.0 | 4.9 || 5.1.0 ||
| `x86_64-pc-windows-gnu` | N/A | 7.3.0 || N/A ||
| `x86_64-sun-solaris` [4] | 2.11 | 5.3.0 || N/A | |
Expand All @@ -326,8 +327,8 @@ terminate.

[5] libc = newlib

[6] libc = musl, gcc = emcc; Some projects that use libc may fail due to wrong
definitions (will be fixed by https://github.com/rust-lang/libc/pull/610)
[6] libc = musl, gcc = emcc. The Docker images for these targets are currently not built automatically
due to a [compiler bug](https://github.com/rust-lang/rust/issues/85821), you will have to build them yourself for now.

## Debugging

Expand Down
23 changes: 4 additions & 19 deletions docker/Dockerfile.asmjs-unknown-emscripten
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:16.04
FROM emscripten/emsdk:3.1.10
WORKDIR /
ARG DEBIAN_FRONTEND=noninteractive

COPY common.sh lib.sh /
Expand All @@ -10,25 +11,9 @@ RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh

COPY --from=trzeci/emscripten:1.39.20-upstream /emsdk_portable /emsdk_portable

ENV EMSDK /emsdk_portable
ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk

ENV EM_DATA ${EMSDK}/.data
ENV EM_CONFIG ${EMSDK}/.emscripten
ENV EM_CACHE ${EM_DATA}/cache
ENV EM_PORTS ${EM_DATA}/ports

ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}"

ENTRYPOINT ["/emsdk_portable/entrypoint"]

RUN apt-get update && apt-get update && apt-get install --assume-yes --no-install-recommends \
libxml2 \
python

ENV CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node

# Prevent 'wasm2js does not support source maps yet' error.
ENV RUSTFLAGS='-C debuginfo=0'
ENV CARGO_TARGET_ASMJS_UNKNOWN_EMSCRIPTEN_RUNNER=node \
BINDGEN_EXTRA_CLANG_ARGS_asmjs_unknown_emscripten="--sysroot=/emsdk/upstream/emscripten/cache/sysroot"
20 changes: 4 additions & 16 deletions docker/Dockerfile.wasm32-unknown-emscripten
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ubuntu:16.04
FROM emscripten/emsdk:3.1.10
WORKDIR /
ARG DEBIAN_FRONTEND=noninteractive

COPY common.sh lib.sh /
Expand All @@ -10,22 +11,9 @@ RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh

COPY --from=trzeci/emscripten:1.39.20-upstream /emsdk_portable /emsdk_portable

ENV EMSDK /emsdk_portable
ENV EMSCRIPTEN=${EMSDK}/emscripten/sdk

ENV EM_DATA ${EMSDK}/.data
ENV EM_CONFIG ${EMSDK}/.emscripten
ENV EM_CACHE ${EM_DATA}/cache
ENV EM_PORTS ${EM_DATA}/ports

ENV PATH="${EMSDK}:${EMSDK}/emscripten/sdk:${EMSDK}/llvm/clang/bin:${EMSDK}/node/current/bin:${EMSDK}/binaryen/bin:${PATH}"

ENTRYPOINT ["/emsdk_portable/entrypoint"]

RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
libxml2 \
python

ENV CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node
ENV CARGO_TARGET_WASM32_UNKNOWN_EMSCRIPTEN_RUNNER=node \
BINDGEN_EXTRA_CLANG_ARGS_wasm32_unknown_emscripten="--sysroot=/emsdk/upstream/emscripten/cache/sysroot"

0 comments on commit 4deac83

Please sign in to comment.