vacp2p / zerokit

A set of Zero Knowledge modules, written in Rust and designed to be used in other system programming environments.
Apache License 2.0
130 stars 7 forks source link

add wasm-strip to reduce size even more #137

Closed tyshko-rostyslav closed 1 year ago

tyshko-rostyslav commented 1 year ago

Closes: #135

rymnc commented 1 year ago

Should wasm-strip be added to the deps in the Makefile? You can add the post-build task to the dependency array https://github.com/vacp2p/zerokit/blob/658d07ae8cd7148a7d7a8237d2400bd88c7a7abf/rln-wasm/Makefile.toml#L8-L14 so that it runs automatically

tyshko-rostyslav commented 1 year ago

Should wasm-strip be added to the deps in the Makefile? You can add the post-build task to the dependency array

https://github.com/vacp2p/zerokit/blob/658d07ae8cd7148a7d7a8237d2400bd88c7a7abf/rln-wasm/Makefile.toml#L8-L14

so that it runs automatically

wasm-strip, cannot be a dependency of build, since it needs a built .wasm file to work with first.

rymnc commented 1 year ago

pack-rename runs after the file is built, isn't it?

rymnc commented 1 year ago

The error in CI is because wasm-strip isn't installed, please install it as a dependency in the root Makefile

tyshko-rostyslav commented 1 year ago

The error in CI is because wasm-strip isn't installed, please install it as a dependency in the root Makefile

I think it cannot find the file

rymnc commented 1 year ago

With this -

[tasks.post-build]
script = "wasm-strip pkg/rln_wasm_bg.wasm"

This is the build error -

[cargo-make] INFO - Running Task: pack-rename
[cargo-make] INFO - Running Task: post-build
/var/folders/v_/4f04x6_901qckppx8f0lj_h00000gn/T/fsio_E3zqzGVGzp.sh: line 3: wasm-strip: command not found
[cargo-make] ERROR - Error while executing command, exit code: 127
rymnc commented 1 year ago

The "file" it cannot find is actually the executable for wasm-strip

tyshko-rostyslav commented 1 year ago

The "file" it cannot find is actually the executable for wasm-strip

Fixed