Skip to content

[BUG] cargo generate failure #989

@jccampagne

Description

@jccampagne

The issue

The docs https://github.com/cloudflare/workers-rs#getting-started

says to run:

cargo generate cloudflare/workers-rs

But this fails:

cargo generate cloudflare/workers-rs
⚠️   Favorite `cloudflare/workers-rs` not found in config, using it as a git repository: https://github.com/cloudflare/workers-rs.git
Error: all authentication attempts failed

Even direct command fails:

~ % cargo generate --git https://github.com/cloudflare/workers-rs.git
Error: all authentication attempts failed

After a some digging (checking configs of git, ssh; testing other repos) and reviewing past issues in cargo-generate, it boils down to a recent change in worker-rs repo, related to submodules, being the cause:

https://github.com/cloudflare/workers-rs/blob/7ad71392841a4ed049fbf497e6fdf22e5e6732fb/.gitmodules

The lines

	url = git@github.com:guybedford/wasm-streams.git
	url = git@github.com:wasm-bindgen/ts-gen

causes some resolution issue.

suggested fix

Changing those lines to

	url = https://github.com/guybedford/wasm-streams
	url = https://github.com/wasm-bindgen/ts-gen

fixes the issue.

Running the same command against my change runs fine:

test % cargo generate https://github.com/jccampagne/workers-rs
⚠️   Favorite `https://github.com/jccampagne/workers-rs` not found in config, using it as a git repository: https://github.com/jccampagne/workers-rs
✔ 🤷   Which template should be expanded? · templates/hello-world
🤷   Project Name: test-hello-world
🔧   Destination: /private/tmp/test/test-hello-world ...
🔧   project-name: test-hello-world ...
🔧   Generating template ...
✔ 🤷   Enable panic=unwind and abort recovery? · false
[1/5]   Done: .gitignore
[2/5]   Done: Cargo.toml
[3/5]   Done: src/lib.rs
[4/5]   Done: src
🔧   Moving generated files into: `/private/tmp/test/test-hello-world`...
🔧   Initializing a fresh Git repository
✨   Done! New project created /private/tmp/test/test-hello-world

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions