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

feat: add support for macos aarch64 #1088

Merged
merged 2 commits into from
Dec 16, 2021
Merged

Conversation

d3lm
Copy link
Contributor

@d3lm d3lm commented Dec 3, 2021

This PR fixes #913 for MacOS (aarch64) and will download x86_64-apple-darwin. Ideally, binaryen would release a native build but until then we can just use the x86 version which works fine on Apple Sillicon.

  • You have the latest version of rustfmt installed
$ rustup component add rustfmt
  • You ran cargo fmt on the code base before submitting
  • You reference which issue is being closed in the PR text

@pauldorehill
Copy link

Hi,

It would be good to also update the NPM package with this pull request by adding something like:

if (type === "Darwin" && arch === "arm64") {
    return "x86_64-apple-darwin";
}

@d3lm
Copy link
Contributor Author

d3lm commented Dec 9, 2021

@pauldorehill I think that's not strictly needed, because wasm-pack can be installed with cargo without issues if this PR was merged. Or maybe I am missing something?

@pauldorehill
Copy link

pauldorehill commented Dec 9, 2021

@d3lm the issue is that the package runs a postinstall script which throws and means none of your other node packages get installed. It's easy enough to just remove it from any of your own packages and just call your local cargo installation, but the problem arises if any of your other node packages take it as a dependancy.

You can solve it by using npm install --ignore-scripts, but I think it would be better to fix it 😄

@d3lm
Copy link
Contributor Author

d3lm commented Dec 10, 2021

Oh gotcha. So if it got installed via a package manager you mean? Yep sure, I can change that too 👍

Copy link
Member

@drager drager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I agree with fixing the npm package would be nice as well

@d3lm
Copy link
Contributor Author

d3lm commented Dec 10, 2021

@drager Do you want me to address this in another PR or include it in this PR?

@drager
Copy link
Member

drager commented Dec 11, 2021

@drager Do you want me to address this in another PR or include it in this PR?

Include it in this PR if possible

@d3lm
Copy link
Contributor Author

d3lm commented Dec 14, 2021

Ok, I have updated the PR and added support for arm64 when using npm too.

@vitvakatu
Copy link

Hi, @drager, could you make a new release of wasm-pack after this PR is merged? It blocks myself and my team, and I'd love to see this fix.

@drager
Copy link
Member

drager commented Dec 15, 2021

Hi, @drager, could you make a new release of wasm-pack after this PR is merged? It blocks myself and my team, and I'd love to see this fix.

Absolutely! I will try to get this merged tomorrow.

@drager drager merged commit 5eb3dff into rustwasm:master Dec 16, 2021
@d3lm d3lm deleted the feat/support-aarch64 branch December 16, 2021 19:19
@d3lm
Copy link
Contributor Author

d3lm commented Dec 16, 2021

Yay! Thanks for merging 🥳

@d3lm
Copy link
Contributor Author

d3lm commented Dec 16, 2021

@drager Are you going to publish a new version today too?

@drager
Copy link
Member

drager commented Dec 16, 2021

@drager Are you going to publish a new version today too?

On it. See #1095

@d3lm
Copy link
Contributor Author

d3lm commented Dec 16, 2021

Can confirm that it works now 🙌 Thanks for getting out a new release <3

@ghost
Copy link

ghost commented Dec 21, 2021

I'm using mac m1 and I updated version 0.10.2 but this issue is not fixed. It's still "Error: no prebuilt wasm-opt binaries are available for this platform: Unrecognized target!". I have no ideal about this problem. Could anyone help me, please?

@vitvakatu
Copy link

@Sotatek-NguyenNguyen4 are you sure you have an updated version of the wasm-pack? What's the output of wasm-pack --version? It certainly works for me.

@ghost
Copy link

ghost commented Dec 21, 2021

@vitvakatu Yes, it's exactly version 0.10.2. I don't understand why it doesn't work for me. Have I miss any step by step?
Screenshot at Dec 21 18-25-01

@d3lm
Copy link
Contributor Author

d3lm commented Dec 21, 2021

It's certainly fixed for me too. Did you install wasm-pack via cargo -> cargo install wasm-pack?

@vitvakatu
Copy link

@Sotatek-NguyenNguyen4 I think something is not right with your installation, perhaps two different versions of wasm-pack are available in the system. Your code seems to call /usr/local/cargo/bin/wasm-pack, while cargo usually uses $HOME/.cargo/bin directory for binaries.

I recommend avoiding using system package managers (homebrew in your case) and using rustup from https://rustup.rs to install and manage the Rust compiler and other tools.

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

Successfully merging this pull request may close these issues.

no prebuilt wasm-opt binaries error
4 participants