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

Package ndarray v0.4.0 does not have these features: complex #2472

Closed
daniel-vainsencher opened this issue Mar 11, 2016 · 8 comments
Closed
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself.

Comments

@daniel-vainsencher
Copy link

I've changed cargo.toml to depend on ndarray=0.4 (without yet using it from the code at all) and suddenly get the above error message very early in building my package (right after Updating the registry).

I have no idea where to start: is any particular line of code or configuration requiring the feature 'complex'? why is it required specifically of ndarray? it does not seem to be a feature provided by ndarray according to https://github.com/bluss/rust-ndarray#recent-changes

@alexcrichton
Copy link
Member

Does any crate in the dependency graph require the complex feature from ndarray and is accidentally picking up 0.4.0 when it actually only works with 0.3.0 perhaps?

The error message here could probably be much better though! Do you have a reproduction I could play around with as well?

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Mar 11, 2016
@daniel-vainsencher
Copy link
Author

Unfortunately, this particular project is private.
I have worked around the problem by removing

[dependencies.libc]

From cargo.toml.
Adding that line to the cargo.toml of another project that uses ndarray doesn't reproduce the problem, unfortunately.

Yes, the issue is definitely about the error message, of course. Even in easier cases I am sure it could give a lot more information.

@alexcrichton
Copy link
Member

Hm that may just be a case where the resolver is being somewhat nondeterministic. Do you have a public project I could poke at? In theory all that's needed to reproduce are the Cargo.toml files.

@daniel-vainsencher
Copy link
Author

I am now failing to reproduce the problem, both on a clean project and on the original, so cannot help find the problem :/

I hope the error message can still be improved in a general way.

@Ryman
Copy link

Ryman commented Mar 12, 2016

@alexcrichton Similar error if you try using a Cargo.toml with only ffmpeg = "*" as a dependency in a fresh project.

cargo update          (or cargo build for initial build)                                                                                             
    Updating registry `https://github.com/rust-lang/crates.io-index`
Package `ffmpeg v0.1.0` does not have these features: `swscale, avcodec, swresample, avdevice, postproc, avfilter, avformat, avresample`

Note that there are versions published after 0.1.0.

This works with the cargo released with 1.7, fails on 1.8.0-beta.1 and recent 1.9.0 nightly. 1.7 pulls in v0.2.0-alpha.1 (which fails to build for other reasons)

EDIT(More info):
If you change to ffmpeg = '0.1.1' on beta or nightly, you get another error about not finding a version, due to how ffmpeg-sys has done it's versioning numbers e.g. 2.6.2-5, you get an error:

    Updating registry `https://github.com/rust-lang/crates.io-index`
no matching package named `ffmpeg-sys` found (required by `ffmpeg`)
location searched: registry https://github.com/rust-lang/crates.io-index
version required: ^2.6.2

Again, this works on stable (just fails to build because of using features on stable).

It looks like it's related to semver parsing?

@bluss
Copy link
Member

bluss commented Mar 13, 2016

FYI ndarray uses complex from num https://github.com/bluss/rust-ndarray/blob/master/Cargo.toml#L25-L28 Seems like a weird bug (mixing up which package the feature belongs to) for that reason.

(ndarray itself has never had a feature called complex).

@alexcrichton
Copy link
Member

This looks to be a bug in resolution. When it's backtracking some feature set's not getting cleared out so it's leaking from one dependency to another. Hope to have a fix soon!

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Mar 16, 2016
In the local loop during resolution all variables need to be reset whenever we
backtrack up a frame, but currently the `method` and `features` set are
accidentally not reset whenever we backtrack. Calculate the `method` later and
cache `features` in each frame so we can properly backtrack.

Closes rust-lang#2472
bors added a commit that referenced this issue Mar 17, 2016
Fix caching features across backtracking

In the local loop during resolution all variables need to be reset whenever we
backtrack up a frame, but currently the `method` and `features` set are
accidentally not reset whenever we backtrack. Calculate the `method` later and
cache `features` in each frame so we can properly backtrack.

Closes #2472
@daniel-vainsencher
Copy link
Author

Thanks for the sleuthing!

On Wed, Mar 16, 2016 at 9:04 PM, bors notifications@github.com wrote:

Closed #2472 #2472 via #2484
#2484.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2472 (comment)

Daniel Vainsencher

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.
Projects
None yet
Development

No branches or pull requests

4 participants