Skip to content

README: fix cargo build instruction#170

Merged
azat merged 4 commits intoazat:mainfrom
kavirajk:kavirajk/build-instructions
Nov 20, 2025
Merged

README: fix cargo build instruction#170
azat merged 4 commits intoazat:mainfrom
kavirajk:kavirajk/build-instructions

Conversation

@kavirajk
Copy link
Copy Markdown
Contributor

When I tried to build from source, it failed with following error.

Updating git repository https://github.com/azat-rust/cursive error: failed to load source for dependency cursive Caused by:
  Unable to update https://github.com/azat-rust/cursive?branch=chdig-25.7#2c18a81a
Caused by:
  failed to fetch into: /home/kavi/.cargo/git/db/cursive-6ea9b78501fad33c
Caused by:
  revision 2c18a81add64a3c4fa844ade56688905ac7361c7 not found
Caused by:
  failed to authenticate when downloading repository: git@github.com:azat-rust/cursive
  * attempted ssh-agent authentication, but no usernames succeeded: git if the git CLI succeeds then net.git-fetch-with-cli may help here https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli Caused by:
  no authentication methods succeeded

Adding net.git-fetch-with-cli to $HOME/.cargo/config.toml fixed the issue.

Reference: https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

thought of adding it to README for anyone facing the same issue. Feel free to ignore if there are better way to handle this.

When I tried to build from source, it failed with following error.

Updating git repository https://github.com/azat-rust/cursive
error: failed to load source for dependency cursive
Caused by:
  Unable to update https://github.com/azat-rust/cursive?branch=chdig-25.7#2c18a81a
Caused by:
  failed to fetch into: /home/kavi/.cargo/git/db/cursive-6ea9b78501fad33c
Caused by:
  revision 2c18a81add64a3c4fa844ade56688905ac7361c7 not found
Caused by:
  failed to authenticate when downloading repository: git@github.com:azat-rust/cursive
  * attempted ssh-agent authentication, but no usernames succeeded: git
  if the git CLI succeeds then net.git-fetch-with-cli may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
Caused by:
  no authentication methods succeeded

Adding `net.git-fetch-with-cli` to $HOME/.cargo/config.toml fixed the
issue.

Reference: https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
@kavirajk kavirajk changed the title fix cargo build README: fix cargo build instruction Nov 18, 2025
@azat azat self-assigned this Nov 19, 2025
@azat
Copy link
Copy Markdown
Owner

azat commented Nov 19, 2025

Hm, interesting, by some reason it substitued the protocol for the repo, it should be https://, while it uses:

  failed to authenticate when downloading repository: git@github.com:azat-rust/cursive
  * attempted ssh-agent authentication, but no usernames succeeded: git if the git CLI succeeds then net.git-fetch-with-cli may help here https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli Caused by:

Maybe you have some fancy gitconfig that has something like this

[url "git@github.com:"]
    pushInsteadOf = https://github.com/

But anyway, thanks for fixing it, I did not even knew that there is builtin library, worth to put into README, but let's make sure that there is no custom gitconfig first (to make the instructions clear)

P.S. interesting, it is the first time important message from github went into spam folder

@kavirajk
Copy link
Copy Markdown
Contributor Author

you are absolutely right @azat

Removing those from my .gitconfig fixed the issue :)

[url "git@github.com:"]
	insteadOf = https://github.com/

may be we can add it as NOTE somewhere in the README FWIW :). Also ok to just close this PR without merging if you think the error is straight forward :)

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
@azat azat merged commit 316ba91 into azat:main Nov 20, 2025
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

Successfully merging this pull request may close these issues.

2 participants