This repository was archived by the owner on Apr 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +50
-14
lines changed
docker/wasm32-unknown-unknown Expand file tree Collapse file tree 5 files changed +50
-14
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ members = [
2929 " crates/libm-bench" ,
3030]
3131
32+ [build-dependencies ]
33+ rand = { version = " 0.6.5" , optional = true }
34+
3235[dev-dependencies ]
3336no-panic = " 0.1.8"
3437
35- [build-dependencies ]
36- rand = { version = " 0.6.5" , optional = true }
38+ [target .wasm32-unknown-unknown .dev-dependencies ]
39+ wasm-bindgen-test = " 0.2.47"
40+
Original file line number Diff line number Diff line change 3939 TARGET : powerpc64le-unknown-linux-gnu
4040 x86_64 :
4141 TARGET : x86_64-unknown-linux-gnu
42-
43- - job : wasm
44- pool :
45- vmImage : ubuntu-16.04
46- steps :
47- - template : ci/azure-install-rust.yml
48- - script : rustup target add wasm32-unknown-unknown
49- displayName : " Install rust wasm target"
50- - script : sh ./ci/run.sh wasm32-unknown-unknown
51- variables :
52- TOOLCHAIN : nightly
42+ wasm32 :
43+ TARGET : wasm32-unknown-unknown
44+ TOOLCHAIN : nightly
5345
5446 - job : rustfmt
5547 pool :
Original file line number Diff line number Diff line change 1+ FROM ubuntu:18.04
2+
3+ RUN apt-get update -y && apt-get install -y --no-install-recommends \
4+ ca-certificates \
5+ clang \
6+ cmake \
7+ curl \
8+ git \
9+ libc6-dev \
10+ make \
11+ python \
12+ xz-utils
13+
14+ # Install `wasm2wat`
15+ RUN git clone --recursive https://github.com/WebAssembly/wabt
16+ RUN make -C wabt -j$(nproc)
17+ ENV PATH=$PATH:/wabt/bin
18+
19+ # Install `node`
20+ RUN curl https://nodejs.org/dist/v12.0.0/node-v12.0.0-linux-x64.tar.xz | tar xJf -
21+ ENV PATH=$PATH:/node-v12.0.0-linux-x64/bin
22+
23+ COPY docker/wasm32-unknown-unknown/wasm-entrypoint.sh /wasm-entrypoint.sh
24+ ENTRYPOINT ["/wasm-entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -ex
4+
5+ # Download an appropriate version of wasm-bindgen based off of what's being used
6+ # in the lock file. Ideally we'd use `wasm-pack` at some point for this!
7+ version=$( grep -A 1 ' name = "wasm-bindgen"' Cargo.lock | grep version)
8+ version=$( echo $version | awk ' {print $3}' | sed ' s/"//g' )
9+ curl -L https://github.com/rustwasm/wasm-bindgen/releases/download/$version /wasm-bindgen-$version -x86_64-unknown-linux-musl.tar.gz \
10+ | tar xzf - -C target
11+ export PATH=$PATH :` pwd` /target/wasm-bindgen-$version -x86_64-unknown-linux-musl
12+ export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=wasm-bindgen-test-runner
13+ export NODE_ARGS=--experimental-wasm-simd
14+
15+ exec " $@ "
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ run() {
1212 # will be owned by root
1313 mkdir -p target
1414
15- docker build -t $target ci/docker/$target
15+ docker build -t $target -f ci/docker/$target /Dockerfile ci/
1616 docker run \
1717 --rm \
1818 --user $( id -u) :$( id -g) \
@@ -24,6 +24,7 @@ run() {
2424 -v ` rustc --print sysroot` :/rust:ro \
2525 --init \
2626 -w /checkout \
27+ --privileged \
2728 $target \
2829 sh -c " HOME=/tmp PATH=\$ PATH:/rust/bin exec ci/run.sh $target "
2930}
You can’t perform that action at this time.
0 commit comments