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

Resolve errors are likely quite obscure #782

Closed
alexcrichton opened this Issue Oct 30, 2014 · 15 comments

Comments

Projects
None yet
9 participants
@alexcrichton
Copy link
Member

alexcrichton commented Oct 30, 2014

There's not a huge amount of infrastructure to generate meaningful errors in resolve, and the errors are likely difficult to read and interpret. Need to invest some time into figuring out error conditions, producing high quality errors, and implementing it.

@alexcrichton alexcrichton added the E-hard label Oct 30, 2014

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Oct 30, 2014

There is some code for errors, but I'm dubious of the quality of it.

@jmesmon

This comment has been minimized.

Copy link
Contributor

jmesmon commented Feb 18, 2015

Just to add another example of someone having trouble parsing these types of errors: http://www.reddit.com/r/rust/comments/2w6scv/regex_macros_from_cratesio_seems_to_be_broken/

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 19, 2016

Minimal steps to reproduce this (I think?):

coreyf@frewbook-pro /tmp> cargo new --bin someproject
coreyf@frewbook-pro /tmp> cd someproject/
coreyf@frewbook-pro /t/someproject (master)> echo 'objc-foundation = "0.0.2"' >> Cargo.toml
coreyf@frewbook-pro /t/someproject (master)> cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling libc v0.1.12
   Compiling block v0.1.4
   Compiling libc v0.2.4
   Compiling malloc_buf v0.0.6
   Compiling objc v0.1.8
   Compiling objc_id v0.0.2
   Compiling objc-foundation v0.0.2
   Compiling someproject v0.1.0 (file:///private/tmp/someproject)
coreyf@frewbook-pro /t/someproject (master)> cargo update -p "objc-foundation" --precise 0.0.4
    Updating registry `https://github.com/rust-lang/crates.io-index`
no matching package named `objc-foundation` found (required by `someproject`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: ^0.0.2
versions found: 0.0.4
@SimonSapin

This comment has been minimized.

Copy link
Contributor

SimonSapin commented Jan 19, 2016

@frewsxcv that error message is expected: Cargo considers 0.0.4 is incompatible with 0.0.2. This gave me a lead for #2293, and I think the cause is the same although the error message there is bad. You need to change https://github.com/aweinstock314/rust-clipboard/blob/master/Cargo.toml

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 19, 2016

@SimonSapin how about this:

coreyf@frewbook-pro /tmp> cargo new --bin someproject
coreyf@frewbook-pro /tmp> cd someproject/
coreyf@frewbook-pro /t/someproject (master)>
echo 'objc-foundation = "~0.0.2"' >> Cargo.toml
coreyf@frewbook-pro /t/someproject (master)> cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading objc-foundation v0.0.4
   Compiling block v0.1.4
   Compiling libc v0.2.4
   Compiling malloc_buf v0.0.6
   Compiling objc v0.1.8
   Compiling objc-foundation v0.0.4
   Compiling someproject v0.1.0 (file:///private/tmp/someproject)
coreyf@frewbook-pro /t/someproject (master)>
cargo update -p "objc-foundation" --precise 0.0.4
    Updating registry `https://github.com/rust-lang/crates.io-index`
no matching package named `objc` found (required by `objc-foundation`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: = 0.1.8
@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jan 19, 2016

Thanks for the minimized test case @frewsxcv! Your thoughts on #2293 were correct in that I don't believe it was related to that bug at all. In any case, however, I've now submitted a fix for this bug

@frewsxcv

This comment has been minimized.

Copy link
Member

frewsxcv commented Jan 19, 2016

Awesome, thanks!

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jun 23, 2016

@alexcrichton removed P-high on this inactive bug.

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jun 23, 2016

@brson sounds good to me

@elahn

This comment has been minimized.

Copy link

elahn commented Apr 26, 2017

This is still quite obscure when you've never hit a resolve error and don't know to run cargo update:

>cargo build
error: failed to select a version for `syn` (required by `serde_derive_internals`):
all possible versions conflict with previously selected versions of `syn`
  version 0.11.9 in use by syn v0.11.9
  possible versions to select: 0.11.11, 0.11.10

Files for test case: test_resolve_syn.zip
Regardless if this is a bug and is fixed, it'd be great for new users hitting a resolve error to be suggested to run cargo update.

@nipunn1313

This comment has been minimized.

Copy link
Contributor

nipunn1313 commented May 10, 2017

Yes. It is especially obscure when the dep is a dep-of-a-dep

We also had the unfortunate situation of not being able to upgrade deps independently:

nipunn-mbp:engine nipunn$ cargo update -p libc
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to select a version for `gcc` (required by `chromedebugger`):
all possible versions conflict with previously selected versions of `gcc`
  version 0.3.38 in use by gcc v0.3.38
  possible versions to select: 0.3.45
nipunn-mbp:engine nipunn$ cargo update -p gcc
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to select a version for `libc` (required by `sync`):
all possible versions conflict with previously selected versions of `libc`
  version 0.2.20 in use by libc v0.2.20
  possible versions to select: 0.2.22
nipunn-mbp:engine nipunn$ cargo update -p libc
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to select a version for `gcc` (required by `events`):
all possible versions conflict with previously selected versions of `gcc`
  version 0.3.38 in use by gcc v0.3.38
  possible versions to select: 0.3.45

This situation was caused by a git merge conflict in the Cargo.lock. I rolled back the Cargo.lock to head and tried to resolve by merging the Cargo.tomls and ended up here.

Got out of it by doing cargo update, but it updated way more things (10x more) than I hoped to achieve today. We have 100s of deps, so doing a full cargo update is a bit scary.

@seeekr

This comment has been minimized.

Copy link

seeekr commented Jun 6, 2017

I did not know about cargo update. Had to google for the

rust failed to select a version for libc

error and then do a bit of reading to figure out what is happening.

If someone wants to point me to where one would have to start in order to generate a PR for improving this, I'd be happy to spend some time on it.

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Jun 6, 2017

@seeekr all of resolution happens in this module, but there's unfortunately not really an easy way to jump in right now :(

@Eh2406

This comment has been minimized.

Copy link
Contributor

Eh2406 commented Mar 22, 2018

Move to close, error messages have gotten better and there are other open issues about it.

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Mar 22, 2018

Agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.