Skip to content

Commit 48caa26

Browse files
authored
fix: Fix packaging the library and enable wasmopt (#3)
1 parent 74e0a90 commit 48caa26

File tree

5 files changed

+36
-26
lines changed

5 files changed

+36
-26
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "zksync-os"]
22
path = zksync-os
3-
url = git@github.com:matter-labs/zksync-os.git
3+
url = https://github.com/matter-labs/zksync-os.git

Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proof_verifier_js/ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626
},
2727
"scripts": {
28-
"build:wasm": "cd ../wasm && RUST_MIN_STACK=267108864 wasm-pack build --target web --out-dir ../ts/wasm/pkg",
28+
"build:wasm": "cd ../wasm && ./build_for_ts.sh",
2929
"build:ts": "tsup",
3030
"build": "yarn build:wasm && yarn build:ts",
3131
"prepack": "yarn build"

proof_verifier_js/wasm/Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ version = "0.1.0"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66

7-
[package.metadata.wasm-pack.profile.release]
8-
wasm-opt = false
7+
# Disabling `wasm-opt` makes the build faster, but the resulting wasm file is much larger.
8+
# [package.metadata.wasm-pack.profile.release]
9+
# wasm-opt = false
910

1011
[lib]
1112
crate-type = ["cdylib"]
@@ -19,11 +20,11 @@ serde = { version = "1", features = ["derive"] }
1920
serde_json = "1"
2021
wasm-bindgen = "0.2"
2122

22-
full_statement_verifier = { git = "https://github.com/matter-labs/zksync-airbender", branch = "popzxc-optimize-builds", default-features = false, features = ["unified_verifier_only_security_80"] }
23-
verifier_common = { git = "https://github.com/matter-labs/zksync-airbender", branch = "popzxc-optimize-builds", default-features = false, features = ["proof_utils"] }
24-
prover = { git = "https://github.com/matter-labs/zksync-airbender", branch = "popzxc-optimize-builds", default-features = false, features = ["definitions_only"] }
25-
cs = { git = "https://github.com/matter-labs/zksync-airbender", branch = "popzxc-optimize-builds", default-features = false, features = ["compiler"] }
26-
field = { git = "https://github.com/matter-labs/zksync-airbender", branch = "popzxc-optimize-builds", default-features = false, features = ["no_inline"] }
23+
full_statement_verifier = { git = "https://github.com/matter-labs/zksync-airbender", branch = "dev", default-features = false, features = ["unified_verifier_only_security_80"] }
24+
verifier_common = { git = "https://github.com/matter-labs/zksync-airbender", branch = "dev", default-features = false, features = ["proof_utils"] }
25+
prover = { git = "https://github.com/matter-labs/zksync-airbender", branch = "dev", default-features = false, features = ["definitions_only"] }
26+
cs = { git = "https://github.com/matter-labs/zksync-airbender", branch = "dev", default-features = false, features = ["compiler"] }
27+
field = { git = "https://github.com/matter-labs/zksync-airbender", branch = "dev", default-features = false, features = ["no_inline"] }
2728

2829
# full_statement_verifier = { path = "../../../zksync-airbender/full_statement_verifier", default-features = false, features = ["unified_verifier_only_security_80"] }
2930
# verifier_common = { path = "../../../zksync-airbender/verifier_common", default-features = false, features = ["proof_utils"] }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
RUST_MIN_STACK=267108864 wasm-pack build --target web --out-dir ../ts/wasm/pkg
5+
6+
# `wasm-pack` generates `.gitignore`, which prevents these files to be published to npm
7+
# Right now, there is no flag to omit generating this file, so we just remove it here
8+
# See: https://github.com/drager/wasm-pack/issues/728
9+
rm ../ts/wasm/pkg/.gitignore

0 commit comments

Comments
 (0)