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

Fails with latest cargo-generate #1245

Closed
orhun opened this issue Mar 19, 2023 · 3 comments
Closed

Fails with latest cargo-generate #1245

orhun opened this issue Mar 19, 2023 · 3 comments

Comments

@orhun
Copy link

orhun commented Mar 19, 2023

🐛 Bug description

I'm using cargo-generate from Arch repositories:

$ halp --no-help cargo-generate
(°ロ°)  checking 'cargo-generate -V'
\(^ヮ^)/ success '-V' argument found!
cargo generate 0.18.1

I just built wasm-pack 0.11.0 and it fails like the following:

$ wasm-pack new test
Error: expected value at line 1 column 1
Caused by: expected value at line 1 column 1

However, if I uninstall cargo-generate and let wasm-pack handle that:

$ pacman -R cargo-generate
$ wasm-pack new test
[INFO]: ⬇️  Installing cargo-generate...
🐑  Generating a new rustwasm project with name 'test'...

It works as expected.

I tracked down this issue with using strace and found out wasm-pack actually installs an older version of cargo-generate:

$ /home/orhun/.cache/.wasm-pack/cargo-generate-9349d7b81730c28d/cargo-generate -V
cargo generate 0.17.3

Thus I concluded this is something that has changed between the latest version of cargo-generate and the version that is used by wasm-pack.

🤔 Expected Behavior

Successful run.

👟 Steps to reproduce

  1. Install cargo-generate (pacman -S cargo-generate)
  2. Build 0.11.0 and install wasm-pack using this PKGBUILD.

🌍 Your environment

wasm-pack version: 0.11.0
rustc version: rustc 1.68.0 (2c8cc3432 2023-03-06) (Arch Linux rust 1:1.68.0-1)

@drager
Copy link
Member

drager commented Mar 19, 2023

You are correct. We are downloading 0.17.3 in wasm-pack:

Tool::CargoGenerate => {
Ok(format!(
"https://github.com/cargo-generate/cargo-generate/releases/download/v{0}/cargo-generate-v{0}-{1}.tar.gz",
"0.17.3",
target
))
},

I suppose we can upgrade that and debug why it's failing then.

@sassman
Copy link
Contributor

sassman commented Apr 13, 2023

I guess under the hood it's just running something like:

cargo generate rustwasm/wasm-pack-template

I tried this successfully with the latest version of cargo-generate v0.18.2 on a M1.
image

@orhun
Copy link
Author

orhun commented May 12, 2023

This is magically fixed in 0.11.1, maybe it was related to #1254

@orhun orhun closed this as completed May 12, 2023
drager added a commit that referenced this issue May 30, 2023
fix: bump cargo-generate version to 0.18.2 (#1245)
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