Skip to content

Commit 207628e

Browse files
committed
chore: fix wasm-opt download
1 parent 213778a commit 207628e

5 files changed

Lines changed: 13 additions & 26 deletions

File tree

.github/workflows/ci-containers.yaml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,12 @@ jobs:
2121
echo IMAGE_RS_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm >> $GITHUB_ENV
2222
echo IMAGE_AS_VM_DIR=./packages/cli/src/lib/defaults/build-strategies/wasm/assemblyscript/vm >> $GITHUB_ENV
2323
24-
# - name: Build RS VM Image (linux/amd64)
25-
# working-directory: ${{env.IMAGE_RS_VM_DIR}}
26-
# run: |
27-
# docker buildx build . --platform=linux/amd64 --no-cache
28-
29-
- name: Build RS VM Image (linux/arm64)
24+
- name: Build RS VM Image
3025
working-directory: ${{env.IMAGE_RS_VM_DIR}}
3126
run: |
32-
docker buildx build . --platform=linux/arm64 --no-cache
33-
34-
- name: Build AS VM Image (linux/amd64)
35-
working-directory: ${{env.IMAGE_AS_VM_DIR}}
36-
run: |
37-
docker buildx build . --platform=linux/amd64 --no-cache
27+
docker buildx build . --platform=linux/amd64,linux/arm64
3828
39-
- name: Build AS VM Image (linux/arm64)
29+
- name: Build AS VM Image
4030
working-directory: ${{env.IMAGE_AS_VM_DIR}}
4131
run: |
42-
docker buildx build . --platform=linux/arm64 --no-cache
32+
docker buildx build . --platform=linux/amd64,linux/arm64

packages/cli/src/lib/build-strategies/strategies/DockerVMStrategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const CONFIGS: Record<BuildableLanguage, VMConfig> = {
3636
"wasm/rust": {
3737
defaultIncludes: ["Cargo.toml", "Cargo.lock"],
3838
baseImage: "polywrap/vm-base-rs",
39-
version: "0.2.1",
39+
version: "0.2.0",
4040
},
4141
"wasm/assemblyscript": {
4242
defaultIncludes: ["package.json", "package-lock.json", "yarn.lock"],

packages/cli/src/lib/defaults/build-strategies/wasm/rust/image/Dockerfile.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ RUN apk add curl pkgconfig openssl-dev bash
1111
# Install clang
1212
RUN apk add clang llvm build-base
1313

14-
# Install Node.js
15-
RUN apk add --no-cache nodejs npm
16-
1714
# Install wasm-opt
18-
RUN npm i wasm-opt -g
15+
RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
16+
&& chmod +x binaryen-version_101/bin/wasm-opt \
17+
&& cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \
18+
&& rm -rf binary-version_101
1919

2020
# Install wasm-snip
2121
RUN cargo install wasm-snip

packages/cli/src/lib/defaults/build-strategies/wasm/rust/local/local.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ cargo install wasm-bindgen-cli
1515
# Install wasm-tools
1616
cargo install wasm-tools
1717

18-
# Install wasm-opt
19-
RUN npm i wasm-opt -g
20-
2118
# Ensure the module at {{dir}} has the crate-type = ["cdylib"]
2219
toml set "$1"/Cargo.toml lib.crate-type ["cdylib"] > "$1"/Cargo-local.toml && \
2320
mv "$1"/Cargo.toml "$1"/Cargo-bak.toml && \

packages/cli/src/lib/defaults/build-strategies/wasm/rust/vm/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ RUN apk add curl pkgconfig openssl-dev bash
1111
# Install clang
1212
RUN apk add clang llvm build-base
1313

14-
# Install Node.js
15-
RUN apk add --no-cache nodejs npm
16-
1714
# Install wasm-opt
18-
RUN npm i wasm-opt -g
15+
RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
16+
&& chmod +x binaryen-version_101/bin/wasm-opt \
17+
&& cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \
18+
&& rm -rf binary-version_101
1919

2020
# Install wasm-snip
2121
RUN cargo install wasm-snip

0 commit comments

Comments
 (0)