You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
Using cargo generate as described in the game of life example not working #52
I was able to install cargo install cargo-generate without a problem, and also have the latest LTS version of NPM. (Also, did a rustup update this morning to update my stable installation of rustc and cargo.)
However, when I run cargo generate --git https://www.github.com/rustwasm/wasm-pack-template and name my project wasm-game-of-life, it fails to clone with the error ⛔ Git Error: failed to clone into: /Users/andrewlee/Documents/Projects/Personal/Rust/wasm-game-of-life4g21l6
hrm. will have to investigate- having just released another CLI tool that leverages this under the hood and having tested it extensively on multiple platforms with a gallery of templates- i'm not entirely sure what could cause this bug! my expectation is that it is likely associated with our use of libgit2...but i'll have to look into it. thank you so much for filing and sorry you are running into this!
Thanks @ashleygwilliams . I really enjoyed watching the talk you did in Kyiv, Ukraine in April of 2017. And thanks @fitzgen for the initial response. Yall keep up the good work.
I am seeing the same problem, or is it a different one?
The Travis CI rules installed with the game of life tutorial template tell it to use cargo-generate version 0.2. However that version can not be used any longer as liquid v0.15.0 doesn't compile due to an accepted regression in Rust, see rust-lang/rust#60958
I tried to change the rules to use cargo-generate version 0.4, but that leads to a failure later when cargo-generate is actually being run:
$ cargo generate --git . --name testing
Creating project called testing...
Git Error: failed to find branch master
The command "cargo generate --git . --name testing" exited with 0.
I've found someone who created a docker image with the environment set up. I struggled to try to build it myself out of masochism, but his seems to be relatively stable as a workaround (hopefully temporarily)
I'm also still getting this error (@gilgameshskytrooper's original issue).
Are there any workarounds? Perhaps regarding absolute/relative paths or something?
Did you ever get this working @gilgameshskytrooper?
It looks like it is tagging six alphanumeric chars onto the end of the path it's trying to clone into, but they seem to be new random chars every time:
Please let me know if there's any further info that could help.
That's as far as I got. It looks like something is failing in that fetch function, but I don't know what. There are references to git2 and the "command-line" git in the function so maybe check if upgrading libgit helps.
Perhaps it would be possible to create a minimal example that calls that function directly - or to checkout the cargo project and point cargo-generate to it in Cargo.toml and trace it through with some println! statements.
As a workaround in the short-term, perhaps you can avoid cargo-generate for now and clone the repository manually. You'd have to replace the interpolations manually (e.g. {{author}}). I don't know how difficult that would be. Alternatively, if you just want a barebones wasm project, I have an example project here: https://github.com/tuzz/minimal-rust-wasm
Activity
fitzgen commentedon Jun 3, 2019
This seems like a bug in
cargo-generate. cc @ashleygwilliamsfitzgen commentedon Jun 3, 2019
Did you have network access? Was there any other output afterwards?
bravecorvus commentedon Jun 3, 2019
I do.
I tried again right now, and i got a slightly different error
bravecorvus commentedon Jun 3, 2019
Ya think this could be related to this?
ashleygwilliams commentedon Jun 4, 2019
hrm. will have to investigate- having just released another CLI tool that leverages this under the hood and having tested it extensively on multiple platforms with a gallery of templates- i'm not entirely sure what could cause this bug! my expectation is that it is likely associated with our use of libgit2...but i'll have to look into it. thank you so much for filing and sorry you are running into this!
bravecorvus commentedon Jun 4, 2019
Thanks @ashleygwilliams . I really enjoyed watching the talk you did in Kyiv, Ukraine in April of 2017. And thanks @fitzgen for the initial response. Yall keep up the good work.
svenfoo commentedon Sep 11, 2019
I am seeing the same problem, or is it a different one?
The Travis CI rules installed with the game of life tutorial template tell it to use cargo-generate version 0.2. However that version can not be used any longer as liquid v0.15.0 doesn't compile due to an accepted regression in Rust, see rust-lang/rust#60958
I tried to change the rules to use cargo-generate version 0.4, but that leads to a failure later when cargo-generate is actually being run:
Kelvinm commentedon Jun 15, 2020
Hi, is this still being looked into?
@ashleygwilliams ,
Sorry, just wanted to bring this to your attention.
@RiderSargent,
I've found someone who created a docker image with the environment set up. I struggled to try to build it myself out of masochism, but his seems to be relatively stable as a workaround (hopefully temporarily)
https://users.rust-lang.org/t/tutorial-conways-game-of-life-in-rust-and-webassembly/16823
RiderSargent commentedon Jun 19, 2020
I'm also still getting this error (@gilgameshskytrooper's original issue).
Are there any workarounds? Perhaps regarding absolute/relative paths or something?
Did you ever get this working @gilgameshskytrooper?
It looks like it is tagging six alphanumeric chars onto the end of the path it's trying to clone into, but they seem to be new random chars every time:
Please let me know if there's any further info that could help.
Thanks!
My setup:
OS: macOS 10.15.5
Cargo version: cargo 1.44.0 (05d080faa 2020-05-06)
rustc version: rustc 1.44.0 (49cae5576 2020-06-01)
npm version: 6.14.4
node version: v12.18.0
git version: git version 2.24.3 (Apple Git-128)
(hub version 2.14.2)
bravecorvus commentedon Jun 19, 2020
@RiderSargent I have not. Sorry. But I haven't tried for quite some time so I'm not sure if this is still an issue.
tuzz commentedon Jun 23, 2020
Hello, for context, it's working for me for the non-www URL. My setup:
I did a bit of digging:
cargo-generate calls
git::createwhich is returning an error result heregit::createusesGitRemotetocheckoutthe project hereThat's coming from
cargo::sources. Here's theGitRemote::checkoutfunctionThere's a
format_errorproc that's building the error message hereThe console output from @RiderSargent's screenshot shows "failed to clone", so we know the
operationargument is "clone".There's a call to
fetchthat callsformat_errorwith "clone" herefetchis defined in the same file hereThat's as far as I got. It looks like something is failing in that
fetchfunction, but I don't know what. There are references togit2and the "command-line" git in the function so maybe check if upgrading libgit helps.Perhaps it would be possible to create a minimal example that calls that function directly - or to checkout the cargo project and point cargo-generate to it in
Cargo.tomland trace it through with someprintln!statements.As a workaround in the short-term, perhaps you can avoid cargo-generate for now and clone the repository manually. You'd have to replace the interpolations manually (e.g.
{{author}}). I don't know how difficult that would be. Alternatively, if you just want a barebones wasm project, I have an example project here: https://github.com/tuzz/minimal-rust-wasmezpuzz commentedon Aug 28, 2020
I had this issue. Fixed with workarounds described here: cargo-generate/cargo-generate#168
workaround: remove url rewrites from your
~/.gitconfig