cargo: paths override in .cargo/config but cargo can't find crate

I’m trying to build ffmpeg on windows (using the latest cargo and nightly rustc-msvc through rustup). This crate depends on rust-ffmpeg-sys which didn’t build on windows out of the box so I tweaked it until it did build, as a local fork, at D:\3rdparty\rust-ffmpeg-sys. Next, I wanted to build rust-ffmpeg using my local fork of rust-ffmpeg-sys, so I put this in C:\Users\me\.cargo\config:

paths = ['D:\3rdparty\rust-ffmpeg-sys']

Now trying to build rust-ffmpeg again with this override, I get this error:

d:\projects\forks\rust-ffmpeg>cargo build
   Compiling ffmpeg v0.2.0-alpha.2 (file:///D:/projects/forks/rust-ffmpeg)
error[E0463]: can't find crate for `sys`
 --> src\lib.rs:4:1
  |
4 | pub extern crate ffmpeg_sys as sys;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

error: Could not compile `ffmpeg`.

To learn more, run the command again with --verbose.

verbose output

My intention with the override is that all crates that I try to build with cargo that depend on ffmpeg-sys will use the local version (because otherwise they will fail to build).

Why doesn’t the override work?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

@alexcrichton

The documentation says:

Note that when a crate is overridden the copy it’s overridden with must have both the same name and version, but it can come from a different source (e.g. git or a local path).

So what can one use to replace a crate with a different version now that neither [replace] nor path overrides allow it?

Oh try changing the version in ffmpeg-sys itself to match 2.8 perhaps?