Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cargo version of wasm-opt instead of npx | /workflows/cd-containers #1773

Merged
merged 2 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const CONFIGS: Record<BuildableLanguage, VMConfig> = {
"wasm/rust": {
defaultIncludes: ["Cargo.toml", "Cargo.lock"],
baseImage: "polywrap/vm-base-rs",
version: "0.2.0",
version: "0.2.1",
},
"wasm/assemblyscript": {
defaultIncludes: ["package.json", "package-lock.json", "yarn.lock"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ RUN apk add curl pkgconfig openssl-dev bash
RUN apk add clang llvm build-base

# Install wasm-opt
RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
&& chmod +x binaryen-version_101/bin/wasm-opt \
&& cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \
&& rm -rf binary-version_101
RUN cargo install wasm-opt

# Install the toml-cli
RUN cargo install toml-cli
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ cargo install wasm-bindgen-cli
# Install wasm-tools
cargo install wasm-tools

# Install wasm-opt
cargo install wasm-opt

# Ensure the module at {{dir}} has the crate-type = ["cdylib"]
toml set "$1"/Cargo.toml lib.crate-type ["cdylib"] > "$1"/Cargo-local.toml && \
mv "$1"/Cargo.toml "$1"/Cargo-bak.toml && \
Expand Down Expand Up @@ -56,5 +59,5 @@ rm -rf "$2"/strip_module.wasm

# Use wasm-opt to perform the "asyncify" post-processing step over all modules
export ASYNCIFY_STACK_SIZE=24576
npx wasm-opt --asyncify -Os "$2"/snipped_module.wasm -o "$2"/wrap.wasm
wasm-opt --asyncify -Os "$2"/snipped_module.wasm -o "$2"/wrap.wasm
rm -rf "$2"/snipped_module.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ RUN apk add curl pkgconfig openssl-dev bash
RUN apk add clang llvm build-base

# Install wasm-opt
RUN curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz \
&& chmod +x binaryen-version_101/bin/wasm-opt \
&& cp binaryen-version_101/bin/wasm-opt /usr/local/bin/ \
&& rm -rf binary-version_101
RUN cargo install wasm-opt

# Install the toml-cli
RUN cargo install toml-cli
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.2.1