Closed jeffcharles closed 2 years ago
I'm not sure what's going on with the publish step failing
Looks good to me, thanks! I'll try to poke at the CI failure but I think it's unrelated to this PR.
👋 would it be possible to publish a release that includes this fix? 🙂
Sure yeah, that's at https://github.com/bytecodealliance/cargo-wasi/pull/121
Fixes #112 and adds supports downloading
wasm-opt
when running on Apple Silicon.This also introduces a
ToolPath
struct for representing the various paths involved withwasm-opt
. I tried doing this without introducing a new type but the code is harder to follow IMO. There's the path to the binary, the base path, the subpaths, and whether the binary path is an overridden path that need to all be represented and used correctly.I also debated whether to adjust the
get_wasm_bindgen
function to return thatToolPath
type. I opted against it because it doesn't add any value beyond consistency withget_wasm_opt
's signature. I would be okay with changingget_wasm_bindgen
in a similar manner if that's preferred.I also considered trying to keep the code adjustments more local to
install_wasm_opt
but couldn't figure out a clean way to deal with the path being returned sometimes being a path to the binary and sometimes being a path to the cache directory without introducing something similar toToolPath
.