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

Crossbeam channel v0.3.7 fails to compile #312

Closed
LivingInSyn opened this issue Jan 29, 2019 · 10 comments
Closed

Crossbeam channel v0.3.7 fails to compile #312

LivingInSyn opened this issue Jan 29, 2019 · 10 comments

Comments

@LivingInSyn
Copy link

including Crossbeam channel v0.3.7 fails to compile with the error:

  Downloaded crossbeam-channel v0.3.7
  Downloaded crossbeam-utils v0.6.1
   Compiling quote v0.6.11
   Compiling crossbeam-channel v0.3.7
error[E0432]: unresolved import `crossbeam_utils::Backoff`

this appears to be because of a mismatch between channel and utils

@ghost
Copy link

ghost commented Jan 29, 2019

Gah, it's because it requires the latest version of crossbeam-utils. :(
You can fix the problem with cargo update -p crossbeam-utils.

I'll publish a new minor version with a fix.

@BurntSushi
Copy link

@stjepang You might find testing with minimal versions to be helpful. For example: https://github.com/rust-lang/regex/blob/60d087a23025e045ae754a345b04003c31d83d93/ci/script.sh#L53-L56

@ghost
Copy link

ghost commented Jan 29, 2019

Ok, I've published 0.3.8 that bumps the crossbeam-utils dependency.

@BurntSushi Thank you, that's exactly what I'm looking for! :)

@LivingInSyn
Copy link
Author

Thanks, all!

@jhpratt
Copy link

jhpratt commented Feb 4, 2019

@stjepang Works for me! Looks like this can be closed.

@ghost
Copy link

ghost commented Feb 15, 2019

@BurntSushi Transitive dependencies break under -Z minimal-versions:

    Checking void v1.0.0
error[E0259]: the name `core` is defined multiple times
  --> /home/stjepan/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.0/src/lib.rs:14:1
   |
14 | extern crate core;
   | ^^^^^^^^^^^^^^^^^^ `core` reimported here
   |
   = note: `core` must be defined only once in the type namespace of this module
help: you can use `as` to change the binding name of the import
   |
14 | extern crate core as other_core;
   |

error: aborting due to previous error

Lots of other folks reported similar problems with - it looks like the whole crates ecosystem is broken in this aspect because no one cares about minimal versions. :( Did you have better luck with -Z minimal-versions?

@BurntSushi
Copy link

Yes. I ran into the same problem. This was the PR that added the check to regex, and this was the PR that removed the dependency on unreachable. Given that the unreachable and void crates are effectively micro-crates that are also, in practice, unmaintained, I would suggest lobbying the maintainers of smallvec to drop them as dependencies. It's probably a good idea to do that regardless of the minimal version check. cc @mbrubeck

It looks like this was discussed in servo/rust-smallvec#128, but we don't need to bump the MSRV to do this. They can just inline what they need from unreachable directly since there's so little code. In the process, they'll drop two dependencies from a very large number of crates in the ecosystem.

mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this issue Feb 16, 2019
Fixes servo#128 by inlining the tiny amount of code we use from `unreachable`
and its dependency `void`.  Eventually this can be replaced with
`std::hint::unrechable_unchecked` but this will require bumping our
minumum supported Rust version.

This will prevent build breakage from users building with broken
versions of the `void` crate, as in crossbeam-rs/crossbeam#312.
bors-servo pushed a commit to servo/rust-smallvec that referenced this issue Feb 16, 2019
Remove dependency on unmaintained 'unreachable' crate

Fixes #128 by inlining the tiny amount of code we use from `unreachable` and its dependency `void`.  Eventually this can be replaced with `std::hint::unrechable_unchecked` but this will require bumping our minumum supported Rust version.

This will prevent build breakage from users building with broken versions of the `void` crate, as in crossbeam-rs/crossbeam#312.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/140)
<!-- Reviewable:end -->
@BurntSushi
Copy link

It looks like smallvec 0.6.9 no longer depends on unreachable (and void), courtesy of @mbrubeck <3. So this might work now!

@ghost
Copy link

ghost commented Feb 21, 2019

Thanks for the update! Unfortunately, building with minimal dependencies still doesn't work:

error: expected identifier, found `"std"`
  --> /home/stjepan/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.1.1/rust/src/liblibc/lib.rs:79:46
   |
79 | #[cfg(feature = "cargo-build")] extern crate "std" as core;
   |                                              ^^^^^ expected identifier

error: aborting due to previous error

error: Could not compile `libc`.
warning: build failed, waiting for other jobs to finish...
error[E0407]: method `seed_from_u64` is not a member of trait `SeedableRng`
   --> /home/stjepan/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_isaac-0.1.0/src/isaac.rs:126:5
    |
126 | /     fn seed_from_u64(seed: u64) -> Self {
127 | |         IsaacRng(BlockRng::<IsaacCore>::seed_from_u64(seed))
128 | |     }
    | |_____^ not a member of trait `SeedableRng`

error[E0407]: method `seed_from_u64` is not a member of trait `SeedableRng`
   --> /home/stjepan/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_isaac-0.1.0/src/isaac.rs:331:5
    |
331 | /     fn seed_from_u64(seed: u64) -> Self {
332 | |         let mut key = [w(0); RAND_SIZE];
333 | |         key[0] = w(seed as u32);
334 | |         key[1] = w((seed >> 32) as u32);
...   |
341 | |         Self::init(key, 1)
342 | |     }
    | |_____^ not a member of trait `SeedableRng`

There are many more errors after that. We could manually require higher minimal versions of broken packages by adding them as dependencies to crossbeam-channel, but it's not as easy as it sounds. As such, I don't think we can easily add this check to CI, at least not yet... :(

@BurntSushi
Copy link

@stjepang Thanks for trying! I filed rust-random/rand#741

bors bot added a commit that referenced this issue Mar 10, 2019
341: Add minimal versions check to travis r=stjepang a=taiki-e

Related: #312, rust-lang/cargo#5657

Co-authored-by: Taiki Endo <te316e89@gmail.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants