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

Distribute wasm-pack binary via cargo #746

Closed
pablosichert opened this issue Dec 6, 2019 · 6 comments
Closed

Distribute wasm-pack binary via cargo #746

pablosichert opened this issue Dec 6, 2019 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@pablosichert
Copy link

Hi there!

Would it be possible to distribute the wasm-pack binary via cargo, instead of requiring users to run curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh?

It would make keeping track of the installation easier and would automatically provide the binary when wasm-pack is added as dependency to cargo.toml.

Rust bindgen also distributes via cargo.

@Pauan
Copy link
Contributor

Pauan commented Dec 6, 2019

Although it isn't well advertised, you actually can do cargo install wasm-pack. Of course this will build the binary from source, because Cargo doesn't currently support shipping pre-compiled binaries.

@pablosichert
Copy link
Author

Oh, I see! I think it would be nice to state this on that page as well: https://rustwasm.github.io/wasm-pack/installer/.

@Pauan
Copy link
Contributor

Pauan commented Dec 6, 2019

@pablosichert It actually already does, but you have to click on the display all supported installers link (that's what I meant by "it isn't well advertised").

Maybe we could just always display it, without requiring a click on the link. @ashleygwilliams what do you think?

@ashleygwilliams
Copy link
Member

i definitely agree that we should not hide the additional installer instrucitons. i would happily accept a pull request for this.

i have had an issue open for this for a long time actually: #355

i'm going to close this a duplicate :)

@ashleygwilliams ashleygwilliams added the duplicate This issue or pull request already exists label Feb 8, 2020
@lynn
Copy link
Contributor

lynn commented Sep 8, 2023

I don't think this issue is a duplicate of #355. That one is about which install options to display on the website. This issue is about distributing a wasm-pack binary via cargo.

Four years ago @Pauan commented that

Cargo doesn't currently support shipping pre-compiled binaries

but I'm not sure if that's still true (I'm reminded of the recent situation surrounding serde_derive).

@Pauan
Copy link
Contributor

Pauan commented Sep 8, 2023

but I'm not sure if that's still true (I'm reminded of the recent situation surrounding serde_derive).

It's still true today, you can't ship pre-compiled binaries with Cargo, cargo install will always recompile the program from scratch.

rust-cli/team#8

rust-cli/team#20

So the current best way to distribute binaries is to use GitHub Releases (which is what wasm-bindgen does).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants