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 1.50.0 can not cope with filedescriptor-0.8.0 #9610

Closed
mcr opened this issue Jun 21, 2021 · 4 comments · Fixed by #9657
Closed

cargo 1.50.0 can not cope with filedescriptor-0.8.0 #9610

mcr opened this issue Jun 21, 2021 · 4 comments · Fixed by #9657
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. C-bug Category: bug

Comments

@mcr
Copy link

mcr commented Jun 21, 2021

dooku-~ mcr 10001 %cargo install filedescriptor
Updating crates.io index
Downloaded filedescriptor v0.8.0
error: failed to parse manifest at /home/mcr/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/filedescriptor-0.8.0/Cargo.toml

I expected to get installed. (I came across this after an cargo update on another project)

Steps

  1. install cargo 1.50.0
  2. try to install this version of filedescriptor (which I think is the latest)

Possible Solution(s)
Upgrade to cargo 1.53.0

Notes

The comment at the top of that file says:

# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)

I think that the goal of the rewriting is to keep people from being forced to upgrade.

@mcr mcr added the C-bug Category: bug label Jun 21, 2021
@ehuss
Copy link
Contributor

ehuss commented Jun 21, 2021

It can be helpful to post the full message:

error: failed to download `filedescriptor v0.8.0`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/Users/eric/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/filedescriptor-0.8.0/Cargo.toml`

Caused by:
  feature `resolver` is required

  this Cargo does not support nightly features, but if you
  switch to nightly channel you can add
  `cargo-features = ["resolver"]` to enable this feature

As you may see, 1.50 does not support this feature. You'll need at least 1.51. When a project uses new features or syntax, they may require a newer version of Rust to use.

Also, from what I can see, filedescriptor is not a binary crate, so cargo install won't work.

@ehuss
Copy link
Contributor

ehuss commented Jul 2, 2021

I'm going to close, as I believe the error message indicates why it is unable to use that package. I think that is about the best the error message can do, as it does not know when a particular feature gets stabilized. Of course, if you have any suggestions on how it could be clearer, feel free to suggest them.

@ehuss ehuss closed this as completed Jul 2, 2021
@mcr
Copy link
Author

mcr commented Jul 4, 2021

It can be helpful to post the full message:

Yes, but how does telling me to right nightly cargo, sync with the VERY VERY clear message in the generated Cargo.toml, that tells me that if it doesn't work, then it's a bug that should be reported.
It seems to me that the ENTIRE PURPOSE of rewriting the Cargo toml is to make it backwards compatible.
The message

this Cargo does not support nightly features, but if you
switch to nightly channel you can add

so, this has nothing to do with a nightly feature, but in fact a feature deployed. Perhaps when the Cargo toml is updated, then it should contain a minimum Cargo version that it can be used with?

@ehuss
Copy link
Contributor

ehuss commented Jul 5, 2021

Ah, I think I understand. I think the error message could be improved when it comes from a registry dependency, since the user does not have control over those.

The preamble in the rewritten Cargo.toml also probably isn't too helpful.

There is an unstable enhancement to add specifying the rust version, but it has not been stabilized, yet.

@ehuss ehuss reopened this Jul 5, 2021
@ehuss ehuss added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Jul 5, 2021
@bors bors closed this as completed in 01ddc25 Jul 12, 2021
bors added a commit that referenced this issue Jul 12, 2021
Don't recommend filing issues on rust-lang/cargo for Cargo.toml errors.

I don't think this suggestion has ever led to something useful, and is just confusing.

cc #9610
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. C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants