Crossbeam-channel v0.3.7 does not compile on 1.36 stable

I'm trying to compile a package which has dependencies on crossbeam-channel v0.3.7, however when running cargo I get:

error[E0432]: unresolved import `crossbeam_utils::Backoff`
 --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-channel-0.3.7/src/context.rs:9:5
  |
9 | use crossbeam_utils::Backoff;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `Backoff` in the root

error[E0432]: unresolved import `crossbeam_utils::Backoff`
  --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-channel-0.3.7/src/flavors/array.rs:23:23
   |
23 | use crossbeam_utils::{Backoff, CachePadded};
   |                       ^^^^^^^ no `Backoff` in the root

error[E0432]: unresolved import `crossbeam_utils::Backoff`
  --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-channel-0.3.7/src/flavors/list.rs:10:23
   |
10 | use crossbeam_utils::{Backoff, CachePadded};
   |                       ^^^^^^^ no `Backoff` in the root

error[E0432]: unresolved import `crossbeam_utils::Backoff`
  --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-channel-0.3.7/src/flavors/zero.rs:10:5
   |
10 | use crossbeam_utils::Backoff;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `Backoff` in the root

error[E0432]: unresolved import `crossbeam_utils::Backoff`
 --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-channel-0.3.7/src/select.rs:8:5
  |
8 | use crossbeam_utils::Backoff;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `Backoff` in the root

error[E0432]: unresolved import `crossbeam_utils::Backoff`
  --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-channel-0.3.7/src/utils.rs:10:5
   |
10 | use crossbeam_utils::Backoff;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `Backoff` in the root

Could someone suggest how to fix this? For the first time, I've seen cargo fail to build stuff.

Note that the Backoff type is added in crossbeam-utils verson 0.6.4.

Hmm ok, so I've tried cargo update -p crossbeam-utils and it does not help for some reason. Looking at my dependency graph I see this:

│   │   ├── tokio v0.1.7
│   │   │   ├── futures v0.1.28 (*)
│   │   │   ├── mio v0.6.19
│   │   │   │   ├── iovec v0.1.2 (*)
│   │   │   │   ├── libc v0.2.60 (*)
│   │   │   │   ├── log v0.4.1 (*)
│   │   │   │   ├── net2 v0.2.33 (*)
│   │   │   │   └── slab v0.4.0 (*)
│   │   │   ├── tokio-executor v0.1.8
│   │   │   │   ├── crossbeam-utils v0.6.3 (*)
│   │   │   │   └── futures v0.1.28 (*)
│   │   │   ├── tokio-fs v0.1.6
│   │   │   │   ├── futures v0.1.28 (*)
│   │   │   │   ├── tokio-io v0.1.12 (*)
│   │   │   │   └── tokio-threadpool v0.1.10
│   │   │   │       ├── crossbeam-channel v0.3.7
│   │   │   │       │   ├── crossbeam-utils v0.6.3 (*)
│   │   │   │       │   └── smallvec v0.6.10

So basically the crossbeam-channel v0.3.7 is although requires crossbeam-utils * somehow is fetching the 0.6.3 version. But why?

Try running cargo tree -i -p crossbeam-utils to get the full graph of which crates depend on crossbeam-utils (I see that tokio-executor depends on ^0.6.2 and crossbeam-channel depends on ^0.6, but you have at least one more crate that depends on it in your graph).

You can add crossbeam-utils = "0.6.4" to your top-level crate, so it'll force at least this version. If some crate is using crossbeam-utils = "<=0.6.3" or such, Cargo will show you the conflict.

Ok so this is pretty interesting, I think I got a similar issue to this, where cargo update -p crossbeam-utils did not work, but doing cargo update fixed the issue. Not sure what was the underlying cause, but its all sorted now.

Thanks to everyone for the fast replies!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.