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 fails at loading git dependency #9191

Closed
aWeinzierl opened this issue Feb 20, 2021 · 2 comments
Closed

Cargo fails at loading git dependency #9191

aWeinzierl opened this issue Feb 20, 2021 · 2 comments
Labels
C-bug Category: bug

Comments

@aWeinzierl
Copy link

aWeinzierl commented Feb 20, 2021

Problem
Failure with the following reported message when trying to build repo:

error: failed to get `windows` as a dependency of package `minesweeper-rs v0.1.0 (C:\Users\andre\[directory]\minesweeper-rs)`

Caused by:
  failed to load source for dependency `windows`

Caused by:
  Unable to update https://github.com/microsoft/windows-rs#031b4736

Caused by:
  the given reference name 'refs/heads/' is not valid; class=Reference (4)

Steps

  1. Clone https://github.com/robmikh/minesweeper-rs
  2. Switch to uwp branch
  3. Delete C:\Users\andre\.cargo\git
  4. Run cargo update or cargo +nightly build -Z build-std=std,panic_abort --target x86_64-uwp-windows-msvc or cargo +stable update

Notes

  • deleting Cargo.lock does not help
  • requiring master for windows-rs does not help

Perhaps related issues: #8957 #9133

Output of cargo version:
cargo 1.52.0-nightly (bf5a5d5 2021-02-18)
cargo 1.50.0 (f04e7fa 2021-02-04)

OS:
Windows 10.0.19042 Pro

@aWeinzierl aWeinzierl added the C-bug Category: bug label Feb 20, 2021
@ehuss
Copy link
Contributor

ehuss commented Feb 20, 2021

Thanks for the report. I suspect this is a duplicate of #8957. Have you tried checking the init.defaultbranch git config option as suggested in that issue?

@aWeinzierl
Copy link
Author

I have init.defaultbranch= too.
However, I misinterpreted something so, I didn't delete C:/Users/andre/.gitconfig (or alternatively set defaultBranch = "" to defaultBranch = "master"`` before deleting C:\Users\andre\.cargo\git, so I thought the problem would lie somewhere else

Interesting that cargo cares about this setting which I have never edited (myself by hand), but it works now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants