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
The issue
The docs https://github.com/cloudflare/workers-rs#getting-started
says to run:
But this fails:
Even direct command fails:
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
causes some resolution issue.
suggested fix
Changing those lines to
fixes the issue.
Running the same command against my change runs fine: