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

Incorrect minimum supported rust version #253

Closed
hoxxep opened this issue Nov 22, 2023 · 5 comments
Closed

Incorrect minimum supported rust version #253

hoxxep opened this issue Nov 22, 2023 · 5 comments

Comments

@hoxxep
Copy link

hoxxep commented Nov 22, 2023

Using cargo msrv suggests that the actual minimum supported rust version is 1.66.1 due to the following compile failure in the jobserver v0.1.27 sub-dependency required by the cc/parallel feature.

Check for toolchain '1.64.0-aarch64-apple-darwin' failed with:
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Compiling libc v0.2.150                                                                                                                                          │
│    Compiling pkg-config v0.3.27                                                                                                                                  │
│    Compiling zstd-safe v7.0.0 (/Users/liam/RustroverProjects/zstd-rs/zstd-safe)                                                                                  │
│    Compiling jobserver v0.1.27                                                                                                                                   │
│ error[E0412]: cannot find type `RawFd` in `std::os::fd`                                                                                                          │
│  --> /Users/liam/.cargo/registry/src/github.com-1ecc6299db9ec823/jobserver-0.1.27/src/error.rs:2:27                                                              │
│   |                                                                                                                                                              │
│ 2 | type RawFd = std::os::fd::RawFd;                                                                                                                             │
│   |                           ^^^^^ not found in `std::os::fd`                                                                                                   │
│   |                                                                                                                                                              │
│ help: consider importing this type alias                                                                                                                         │
│   |                                                                                                                                                              │
│ 1 | use std::os::unix::prelude::RawFd;                                                                                                                           │
│   |                                                                                                                                                              │
│ help: if you import `RawFd`, refer to it directly                                                                                                                │
│   |                                                                                                                                                              │
│ 2 - type RawFd = std::os::fd::RawFd;                                                                                                                             │
│ 2 + type RawFd = RawFd;                                                                                                                                          │
│   |                                                                                                                                                              │
│                                                                                                                                                                  │
│ error[E0603]: module `fd` is private                                                                                                                             │
│  --> /Users/liam/.cargo/registry/src/github.com-1ecc6299db9ec823/jobserver-0.1.27/src/error.rs:2:23                                                              │
│   |                                                                                                                                                              │
│ 2 | type RawFd = std::os::fd::RawFd;                                                                                                                             │
│   |                       ^^ private module                                                                                                                      │
│   |                                                                                                                                                              │
│ note: the module `fd` is defined here                                                                                                                            │
│                                                                                                                                                                  │
│ Some errors have detailed explanations: E0412, E0603.                                                                                                            │
│ For more information about an error, try `rustc --explain E0412`.                                                                                                │
│ error: could not compile `jobserver` due to 2 previous errors  

Submitting a matching PR to bump msrv in Cargo.toml.

@gyscos
Copy link
Owner

gyscos commented Nov 22, 2023

This looks like it's caused by jobserver 0.1.27, not by this crate itself. You might be able to downgrade the version used by your application by including jobserver = "<0.1.27" in your Cargo.toml. With this, this properly compiles on rustc 1.64.0.

@hoxxep
Copy link
Author

hoxxep commented Nov 22, 2023

I have submitted an MR to jobserver (rust-lang/jobserver-rs#62), so that it will no longer cause a breaking change in this crate's MSRV. If that gets merged I'll close this issue and the associated PR 👍

@epage
Copy link

epage commented Nov 22, 2023

FYI non-semver upper bounds are generally discouraged as they can create incompatibilities between crates. The proper way to handle this would be in Cargo.lock which can be edited with cargo update.

@hoxxep
Copy link
Author

hoxxep commented Nov 22, 2023

Closing this issue as @epage and @dtolnay have pointed out there are workarounds and an MSRV-aware dependency resolver in Cargo would be the real solution. I'll leave the jobserver MR open for the crate owners to decide upon, as the change should be trivial there to support a lower MSRV.

@hoxxep hoxxep closed this as completed Nov 22, 2023
@gyscos
Copy link
Owner

gyscos commented Nov 22, 2023

One problem is also that jobserver 0.1.27, the offending version, does not specify a MSRV at all (it was only added right after that version was published), so a MSRV-aware cargo would not be able to do much here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants