chore: upgrade wasm-bindgen

This commit is contained in:
Mayeul@Zama
2025-01-17 13:10:57 +01:00
committed by mayeul-zama
parent c62112a4a9
commit 67783f4683
3 changed files with 17 additions and 14 deletions

View File

@@ -11,13 +11,10 @@ members = [
"backends/tfhe-cuda-backend",
"utils/tfhe-versionable",
"utils/tfhe-versionable-derive",
"tests"
"tests",
]
exclude = [
"tests/backward_compatibility_tests",
"utils/tfhe-lints",
]
exclude = ["tests/backward_compatibility_tests", "utils/tfhe-lints"]
[workspace.dependencies]
aligned-vec = { version = "0.6", default-features = false }
bytemuck = "1.14.3"
@@ -28,7 +25,7 @@ pulp = { version = "0.20.0", default-features = false }
rand = "0.8"
rayon = "1"
serde = { version = "1.0", default-features = false }
wasm-bindgen = ">=0.2.86,<0.2.94"
wasm-bindgen = "0.2.100"
[profile.bench]
lto = "fat"
@@ -48,6 +45,4 @@ lto = "off"
debug-assertions = false
[workspace.metadata.dylint]
libraries = [
{ path = "utils/tfhe-lints" }
]
libraries = [{ path = "utils/tfhe-lints" }]

View File

@@ -117,7 +117,7 @@ install_wasm_bindgen_cli: install_rs_build_toolchain
.PHONY: install_wasm_pack # Install wasm-pack to build JS packages
install_wasm_pack: install_rs_build_toolchain
@wasm-pack --version | grep "$(WASM_PACK_VERSION)" > /dev/null 2>&1 || \
cargo $(CARGO_RS_BUILD_TOOLCHAIN) install --locked wasm-pack@0.13.1 || \
cargo $(CARGO_RS_BUILD_TOOLCHAIN) install --locked wasm-pack@$(WASM_PACK_VERSION) || \
( echo "Unable to install cargo wasm-pack, unknown error." && exit 1 )
.PHONY: install_node # Install last version of NodeJS via nvm
@@ -521,11 +521,11 @@ build_web_js_api: install_rs_build_toolchain install_wasm_pack
build_web_js_api_parallel: install_rs_check_toolchain install_wasm_pack
cd tfhe && \
rustup component add rust-src --toolchain $(RS_CHECK_TOOLCHAIN) && \
RUSTFLAGS="$(WASM_RUSTFLAGS) -C target-feature=+atomics,+bulk-memory,+mutable-globals" rustup run $(RS_CHECK_TOOLCHAIN) \
RUSTFLAGS="$(WASM_RUSTFLAGS) -C target-feature=+atomics,+bulk-memory" rustup run $(RS_CHECK_TOOLCHAIN) \
wasm-pack build --release --target=web \
-- --features=boolean-client-js-wasm-api,shortint-client-js-wasm-api,integer-client-js-wasm-api,parallel-wasm-api,zk-pok \
-Z build-std=panic_abort,std && \
find pkg/snippets -type f -iname workerHelpers.worker.js -exec sed -i "s|from '..\/..\/..\/';|from '..\/..\/..\/tfhe.js';|" {} \;
find pkg/snippets -type f -iname workerHelpers.js -exec sed -i "s|const pkg = await import('..\/..\/..');|const pkg = await import('..\/..\/..\/tfhe.js');|" {} \;
jq '.files += ["snippets"]' tfhe/pkg/package.json > tmp_pkg.json && mv -f tmp_pkg.json tfhe/pkg/package.json
.PHONY: build_node_js_api # Build the js API targeting nodejs

View File

@@ -76,7 +76,7 @@ tfhe-versionable = { version = "0.4.0", path = "../utils/tfhe-versionable" }
wasm-bindgen = { workspace = true, features = [
"serde-serialize",
], optional = true }
wasm-bindgen-rayon = { version = "=1.2.2", optional = true }
wasm-bindgen-rayon = { version = "1.3.0", optional = true }
js-sys = { version = "0.3", optional = true }
console_error_panic_hook = { version = "0.1.7", optional = true }
serde-wasm-bindgen = { version = "0.6.0", optional = true }
@@ -130,7 +130,15 @@ software-prng = ["tfhe-csprng/software-prng"]
[package.metadata.docs.rs]
# TODO: manage builds for docs.rs based on their documentation https://docs.rs/about
features = ["boolean", "shortint", "integer", "gpu", "zk-pok", "software-prng", "strings"]
features = [
"boolean",
"shortint",
"integer",
"gpu",
"zk-pok",
"software-prng",
"strings",
]
rustdoc-args = ["--html-in-header", "katex-header.html"]
###########