Skip to content
Closed
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
17 changes: 13 additions & 4 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ jobs:
build-wasm:
name: Build WebAssembly code

runs-on: ["ubuntu-latest"]

strategy:
matrix:
rust_toolchain_version: ["nightly-2024-09-05"]
os: ["ubuntu-latest", "macos-latest"]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
Expand All @@ -33,7 +34,15 @@ jobs:
run: rustup component add rust-src

- name: Build the WebAssembly for the web
run: make build-web
run: |
TOOLCHAIN_PATH=$(rustup run ${{ matrix.rust_toolchain_version }} rustc --print sysroot)
HOST_TRIPLE=$(rustc -vV | sed -n 's/host: //p')
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER="${TOOLCHAIN_PATH}/lib/rustlib/${HOST_TRIPLE}/bin/rust-lld"
make build-web

- name: Build the WebAssembly for NodeJS
run: make build-nodejs
run: |
TOOLCHAIN_PATH=$(rustup run ${{ matrix.rust_toolchain_version }} rustc --print sysroot)
HOST_TRIPLE=$(rustc -vV | sed -n 's/host: //p')
export CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER="${TOOLCHAIN_PATH}/lib/rustlib/${HOST_TRIPLE}/bin/rust-lld"
make build-nodejs
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### [plonk_wasm](./plonk-wasm)


- Add function to `deserialize` a `WasmProverProof`
([#3354](https://github.com/o1-labs/proof-systems/pull/3354))
- CI: add `macos-latest` as a supported platform
([#3359](https://github.com/o1-labs/proof-systems/pull/3359))

### [poly-commitment](./poly-commitment)

Expand Down
4 changes: 3 additions & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::{Context, Result};
use clap::{Parser, Subcommand, ValueEnum};
#[cfg(not(target_arch = "wasm32"))]
use raw_cpuid::CpuId;
use std::{
env,
Expand Down Expand Up @@ -152,7 +153,7 @@ fn build_kimchi_stubs(target_dir: Option<&str>, offline: bool) -> Result<()> {
}

fn build_wasm(out_dir: &str, target: Target, rust_version: RustVersion) -> Result<()> {
const RUSTFLAGS: &str = "-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=--max-memory=4294967296";
const RUSTFLAGS: &str = "-C linker-flavor=wasm-lld -C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=--max-memory=4294967296";

let cargo_target_dir = env::var("CARGO_TARGET_DIR").unwrap_or_else(|_| "target".to_string());
let artifact_dir = PathBuf::from(format!("{cargo_target_dir}/bin"));
Expand All @@ -171,6 +172,7 @@ fn build_wasm(out_dir: &str, target: Target, rust_version: RustVersion) -> Resul

let status = cmd
.args(args)
.env("RUSTFLAGS", RUSTFLAGS)
.env("CARGO_TARGET_DIR", &cargo_target_dir)
.status()
.context("Failed to build wasm-pack")?;
Expand Down
Loading