Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install @wasm-tool/rollup-plugin-rust does not work on Apple Silicon (M1) #24

Closed
GoldStrikeArch opened this issue Dec 4, 2021 · 10 comments

Comments

@GoldStrikeArch
Copy link

GoldStrikeArch commented Dec 4, 2021

Errors log afte running npm install @wasm-tool/rollup-plugin-rust

npm ERR! throw new Error(`Unsupported platform: ${type} ${arch}`); npm ERR! ^ npm ERR! npm ERR! Error: Unsupported platform: Darwin arm64

@GoldStrikeArch
Copy link
Author

Update:

Here is a more detailed look about it: rust-lang/rust#90342 (comment)

@Pauan
Copy link
Collaborator

Pauan commented Dec 4, 2021

That sounds like a bug in wasm-pack, so it should be reported here:

https://github.com/rustwasm/wasm-pack/issues

@pauldorehill
Copy link
Contributor

pauldorehill commented Dec 9, 2021

@MihailPertsev if you run npm install @wasm-tool/rollup-plugin-rust --ignore-scripts it will work. You will need to make sure you have installed wasm-pack locally using cargo install wasm-pack.

@Pauan I'm not even sure that this package needs a dependency on the wasm-pack npm package? Isn't it calling the local cargo installation anyway, rather than the binary in the node_modules/.bin folder?

@GoldStrikeArch
Copy link
Author

@MihailPertsev if you run npm install @wasm-tool/rollup-plugin-rust --ignore-scripts it will work. You will need to make sure you have installed wasm-pack locally using cargo install wasm-pack.

Yes, with this additional --ignore-scripts flag everything is fine. It is a pain that you have to manually install a local version of wasm-pack beforehand though...

@Pauan
Copy link
Collaborator

Pauan commented Dec 12, 2021

@pauldorehill I'm not even sure that this package needs a dependency on the wasm-pack npm package? Isn't it calling the local cargo installation anyway, rather than the binary in the node_modules/.bin folder?

Not at all, it is using the local node_modules package. Which is how it should be, because that ensures reproducibility. Global packages are really bad.

@pauldorehill
Copy link
Contributor

Ah indeed.. showing my lack of node understanding 😄 . I hadn't realized that node would look in `node_modules/.bin' when spawning a child process.

@Pauan
Copy link
Collaborator

Pauan commented Dec 13, 2021

To clarify, if you are using this plugin, then you do not need a global installation of wasm-pack, everything is automatically managed by the plugin without any fuss. Everything Just Works™, including version locking.

The only time you would need to use the global installation of wasm-pack is because you want to use a custom build of wasm-pack.

@Pauan
Copy link
Collaborator

Pauan commented Apr 20, 2022

In version 2.0.0 we no longer use wasm-pack. Please try upgrading and then let me know if you're still having the same issue.

@pauldorehill
Copy link
Contributor

Version 2 works seamlessly on mac

@Pauan
Copy link
Collaborator

Pauan commented Jun 26, 2022

@pauldorehill Thanks for letting me know, so I'll consider this issue as fixed.

@Pauan Pauan closed this as completed Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants