cargo-wasi icon indicating copy to clipboard operation
cargo-wasi copied to clipboard

fix: wasm_opt

Open ChenKS12138 opened this issue 3 years ago • 4 comments

  1. As @PiotrSikora says, in order to runwasm_opt, a dynamic library needs to be installed (for Linux and mac os). https://github.com/bytecodealliance/cargo-wasi/pull/91#issuecomment-787433832 And the cache folder's structure will be as follow.

image

  1. update wasm_opt version from version_97 to version_105

ChenKS12138 avatar Feb 19 '22 15:02 ChenKS12138

Oops, some checks are stills be not successful, IMHO maybe examples/markdown is not a suitable example for cargo-wasi, we need to remove it, as @alexcrichton says

the wasm32-wasi target is not compatible with wasm-bindgen

https://github.com/rustwasm/wasm-bindgen/issues/2554#issuecomment-840774170

Or, we should allow users to pass and override the target argument, something like that. (It works well to compile examples/markdown if I have changed the target)

cargo wasi build -p markdown --release --verbose --target wasm32-unknown-unknown

https://github.com/bytecodealliance/cargo-wasi/blob/6d2e50238275e1cd4cc2e6c4755f1d3d26d2742b/src/lib.rs#L82-L94

ChenKS12138 avatar Feb 19 '22 16:02 ChenKS12138

  1. As @PiotrSikora says, in order to runwasm_opt, a dynamic library needs to be installed (for Linux and mac os). Update wasm-opt to version_97. #91 (comment) And the cache folder's structure will be as follow.

image

  1. bump wasm_opt version from version_97 to version_105
  1. Installing target wasm32-unknown-unknown when compiling example/markdown on CI.

ChenKS12138 avatar Feb 23 '22 14:02 ChenKS12138

Sorry there's a good number of changes here and I don't have a ton of time to review this right now. If wasm-opt-the-builtin-version isn't working well I'd recommend disabling it and then manually running it afterwards.

alexcrichton avatar Feb 23 '22 17:02 alexcrichton

I have removed the code that updating wasm-opt version, and I believe this is the minimum code changes to let CI checks pass.

There is no problem with wasm-opt-the-builtin-version, but an essential library (libbinaryen.dylib/libbinaryen.a) is not installed and linked.

ChenKS12138 avatar Feb 24 '22 02:02 ChenKS12138