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

cargo build fails with parse error on my ~/.gitconfig #4777

Closed
laughinghan opened this issue Dec 5, 2017 · 5 comments · Fixed by #8778
Closed

cargo build fails with parse error on my ~/.gitconfig #4777

laughinghan opened this issue Dec 5, 2017 · 5 comments · Fixed by #8778
Labels
A-git Area: anything dealing with git

Comments

@laughinghan
Copy link

laughinghan commented Dec 5, 2017

In a brand new repo that happens to have hyper as a dependency, I get:

$ cargo build
error: failed to load source for a dependency on `hyper`

Caused by:
  Unable to update registry https://github.com/rust-lang/crates.io-index

Caused by:
  [7/-1] failed to parse config file: Invalid configuration key (in /Users/han/.gitconfig:34, column 0)

I just git cloned this repo, so I know my .gitconfig does not have any parse errors, and the line in question does not define a configuration key: https://github.com/laughinghan/dotfiles/blob/cd846f8069fb10fb25df072da50ec6d9f25f98e7/.gitconfig#L34

Obviously this is a pretty crazy .gitconfig, but it's a valid one, why does cargo build care? Doesn't it just use the system's git? (If you're curious, that crazy alias in question, git sgrep, is like git grep but instead of only searching the repo you're in, it will also recurse into submodules.)

$ git --version
git version 2.10.1 (Apple Git-78)

$ cargo --version --verbose
cargo 0.22.0
release: 0.22.0

$ rustc --version --verbose
rustc 1.22.1
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-apple-darwin
release: 1.22.1
LLVM version: 4.0
@lukaslueg
Copy link
Contributor

Probably a hickup in libgit. Where does your rustc come from, homebrew or rustup?

@alexcrichton
Copy link
Member

Ah yes right now Cargo uses libgit2, not the system git binary. Perhaps this is a bug for libgit2?

@Eh2406
Copy link
Contributor

Eh2406 commented Mar 26, 2018

Did this get resolved? Move to close?

@laughinghan
Copy link
Author

Will double-check tonight.

@ehuss
Copy link
Contributor

ehuss commented Mar 23, 2020

Filed upstream issue libgit2/libgit2#5459

@ehuss ehuss mentioned this issue Oct 14, 2020
@bors bors closed this as completed in 60194f2 Oct 14, 2020
ehuss pushed a commit to ehuss/cargo that referenced this issue Oct 14, 2020
Update git2.

Closes rust-lang#8517
Closes rust-lang#8588
Closes rust-lang#8352
Closes rust-lang#4777
Closes rust-lang#8746

I only added a test for one of these. I can add for the others if you want.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants