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

Improve error message for invalid path dependencies within git dependencies #7784

Closed
NickeZ opened this issue Jan 9, 2020 · 6 comments
Closed
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-git Area: anything dealing with git A-workspaces Area: workspaces C-bug Category: bug E-medium Experience: Medium

Comments

@NickeZ
Copy link

NickeZ commented Jan 9, 2020

Problem
I add a git dependency on "noise-rust-crypto" which is part of the "noise-rust" repository and cargo doesn't find it.

$ cargo update
    Updating git repository `https://github.com/sopium/noise-rust`
error: failed to load source for a dependency on `noise-rust-crypto`

Caused by:
  Unable to update https://github.com/sopium/noise-rust

Caused by:
  Could not find `Cargo.toml` in `/home/niklas/.cargo/git/checkouts/noise-rust-6131949caf0d2152/dad7f8b/noise`

Steps

  1. echo "noise-rust-crypto = {git = "https://github.com/sopium/noise-rust"}" >> Cargo.toml
  2. cargo update

Possible Solution(s)

Notes

Output of cargo version:

$ cargo --version
cargo 1.40.0 (bc8e4c8be 2019-11-22)
@NickeZ NickeZ added the C-bug Category: bug label Jan 9, 2020
@ehuss
Copy link
Contributor

ehuss commented Jan 9, 2020

It's a poor error message. The issue is that this line references a directory that doesn't exist.

@NickeZ
Copy link
Author

NickeZ commented Jan 9, 2020

Ok so it actually breaks when it fails instead of continue to search. That sounds brittle. I'll make a pr to the repo. Thanks

@ehuss
Copy link
Contributor

ehuss commented Jan 9, 2020

Yea, it is supposed to ignore errors like this. It's just an oversight that it doesn't in this particular case (path dependencies require a special code path).

@NickeZ NickeZ changed the title Issue with finding sub-crate in git repository Improve error message for invalid path dependencies within git dependencies Jan 13, 2020
@NickeZ
Copy link
Author

NickeZ commented Jan 13, 2020

I tried to update the issue name to something actionable. Thanks!

@ehuss ehuss added A-diagnostics Area: Error and warning messages generated by Cargo itself. A-git Area: anything dealing with git A-workspaces Area: workspaces labels Feb 2, 2020
@ehuss ehuss added E-help-wanted E-medium Experience: Medium labels Feb 25, 2020
@ehuss
Copy link
Contributor

ehuss commented Mar 22, 2020

I think this is now resolved by #7784. Bad paths in the git repo are now ignored (unless the package itself is missing).

@ehuss ehuss closed this as completed Mar 22, 2020
@aleksator
Copy link
Contributor

aleksator commented Mar 25, 2020

I think this is now resolved by #7784. Bad paths in the git repo are now ignored (unless the package itself is missing).

The link in the message points to this issue. Recursion!
The proper PR is probably this one: #7947

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-git Area: anything dealing with git A-workspaces Area: workspaces C-bug Category: bug E-medium Experience: Medium
Projects
None yet
Development

No branches or pull requests

3 participants