Skip to content

Commit 49a9472

Browse files
committed
chore: update wasm-opt installation
1 parent 13b651a commit 49a9472

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

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

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

14-
# Install the toml-cli
15-
RUN cargo install toml-cli
14+
# Install wasm-opt
15+
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash
16+
RUN nvm install 18 && nvm use 18
17+
RUN npm i wasm-opt -g
1618

1719
# Install wasm-snip
1820
RUN cargo install wasm-snip
@@ -23,8 +25,8 @@ RUN cargo install wasm-tools
2325
# Install wasm-bindgen
2426
RUN cargo install wasm-bindgen-cli
2527

26-
# Install wasm-opt
27-
RUN cargo install wasm-opt
28+
# Install the toml-cli
29+
RUN cargo install toml-cli
2830

2931
# Install cargo-build-deps
3032
RUN cargo install cargo-build-deps

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ cargo install wasm-bindgen-cli
1616
cargo install wasm-tools
1717

1818
# Install wasm-opt
19-
cargo install wasm-opt
19+
RUN npm i wasm-opt -g
2020

2121
# Ensure the module at {{dir}} has the crate-type = ["cdylib"]
2222
toml set "$1"/Cargo.toml lib.crate-type ["cdylib"] > "$1"/Cargo-local.toml && \

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

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

14-
# Install the toml-cli
15-
RUN cargo install toml-cli
14+
# Install wasm-opt
15+
RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash
16+
RUN nvm install 18 && nvm use 18
17+
RUN npm i wasm-opt -g
1618

1719
# Install wasm-snip
1820
RUN cargo install wasm-snip
@@ -23,8 +25,8 @@ RUN cargo install wasm-tools
2325
# Install wasm-bindgen
2426
RUN cargo install wasm-bindgen-cli
2527

26-
# Install wasm-opt
27-
RUN cargo install wasm-opt
28+
# Install the toml-cli
29+
RUN cargo install toml-cli
2830

2931
# Ensure the Wasm module is configured to use imported memory
3032
ENV RUSTFLAGS="-C link-arg=-z -C link-arg=stack-size=65536 -C link-arg=--import-memory"

0 commit comments

Comments
 (0)