Skip to content

Commit

Permalink
fix: WASM build failures because of binius (#483)
Browse files Browse the repository at this point in the history
* fix: WASM build failures because of binius

* nits
  • Loading branch information
sagar-a16z authored Oct 21, 2024
1 parent aa4aa7a commit 249bb31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions jolt-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ ark-serialize = { version = "0.4.2", default-features = false, features = [
"derive",
] }
ark-std = { version = "0.4.0" }
binius-field = { git = "https://gitlab.com/UlvetannaOSS/binius", package = "binius_field" }
clap = { version = "4.3.10", features = ["derive"] }
enum_dispatch = "0.3.12"
fixedbitset = "0.5.0"
Expand Down Expand Up @@ -66,7 +65,7 @@ indicatif = "0.17.8"
common = { path = "../common" }
tracer = { path = "../tracer" }
bincode = "1.3.3"
bytemuck = "1.15.0"
bytemuck = "1.19.0"
hex = "0.4.3"
tokio = { version = "1.38.0", optional = true }
alloy-primitives = "0.7.6"
Expand Down Expand Up @@ -111,6 +110,7 @@ host = ["dep:reqwest", "dep:tokio"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
memory-stats = "1.0.0"
tokio = { version = "1.38.0", optional = true, features = ["rt-multi-thread"] }
binius-field = { git = "https://gitlab.com/UlvetannaOSS/binius", package = "binius_field" }


[target.'cfg(target_arch = "wasm32")'.dependencies]
Expand Down
1 change: 1 addition & 0 deletions jolt-core/src/field/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ where
}

pub mod ark;
#[cfg(not(target_arch = "wasm32"))]
pub mod binius;
7 changes: 5 additions & 2 deletions src/build_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ fn preprocess_and_save(func_name: &str, attributes: &Attributes, is_std: bool) -
}

fn extract_provable_functions() -> Vec<FunctionAttributes> {
let content = fs::read_to_string("guest/src/lib.rs").expect("Unable to read file");
let syntax: syn::File = syn::parse_file(&content).expect("Unable to parse file");
let guest_path = Path::new("guest/src/lib.rs");
let content = fs::read_to_string(guest_path)
.unwrap_or_else(|_| panic!("Unable to read file: {:?}", guest_path));
let syntax: syn::File = syn::parse_file(&content)
.unwrap_or_else(|_| panic!("Unable to parse file: {:?}", guest_path));

syntax
.items
Expand Down

0 comments on commit 249bb31

Please sign in to comment.