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

This crate cannot be used together with other crates that use bitflags 1.3.x #1510

Closed
eduardosm opened this issue Sep 1, 2021 · 4 comments
Closed

Comments

@eduardosm
Copy link

Due to

bitflags = ">= 1.1.0, < 1.3.0"

if a crate depends (directly or indirectly) on nix and bitflags 1.3.x, there will be a dependency resolution failure.

The dependency should be specified as

bitflags = "1.1.0"
@asomers
Copy link
Member

asomers commented Sep 1, 2021

It's a bitflags bug. Bitflags raised its MSRV in a minor release. Nix had to change its bitflags specification as above in order to keep working on the MSRV. Note that the next release of Nix will use bitflags 1.3.0.

@eduardosm
Copy link
Author

This will force users to use bitflags <1.3.0, even if their MSRV allows it. There are other ways of handling this, such as the approach used in the naga crate.

@asomers
Copy link
Member

asomers commented Sep 7, 2021

I'll release a new version of Nix that uses bitflags 1.3.0 as soon as the next libc release. Just waiting on rust-lang/libc#2388 .

@asomers asomers closed this as completed Sep 7, 2021
@asomers
Copy link
Member

asomers commented Sep 7, 2021

@eduardosm I should mention that if you can't wait for the next release, your MSRV is >= 1.46.0, and you want bitflags 1.3.0, then you can set your Nix dependency to =1.22.0 (or =1.21.0, etc). The .0 releases will let you use bitflags 1.3.0.

The approach taken by the naga crate seems to be to repeat their MSRV testing with multiple versions of bitflags. That's waaay too much effort, IMHO. I won't be going that route with Nix.

asomers added a commit to asomers/nix that referenced this issue Oct 15, 2021
This is a new feature in Cargo 1.56.0, currently in beta.  Once Nix's
MSRV is >= 1.56.0, this feature will prevent future problems like the
bitflags 1.3.0 fiasco.

Issue nix-rust#1491
Issue nix-rust#1510
Issue nix-rust#1548
Issue nix-rust#1555
bors bot added a commit that referenced this issue Dec 15, 2021
1561: Declare the MSRV in Cargo.toml r=rtzoeller a=asomers

This is a new feature in Cargo 1.56.0, currently in beta.  Once Nix's
MSRV is >= 1.56.0, this feature will prevent future problems like the
bitflags 1.3.0 fiasco.

Issue #1491
Issue #1510
Issue #1548
Issue #1555

Co-authored-by: Alan Somers <asomers@gmail.com>
bors bot added a commit that referenced this issue Dec 15, 2021
1561: Declare the MSRV in Cargo.toml r=rtzoeller a=asomers

This is a new feature in Cargo 1.56.0, currently in beta.  Once Nix's
MSRV is >= 1.56.0, this feature will prevent future problems like the
bitflags 1.3.0 fiasco.

Issue #1491
Issue #1510
Issue #1548
Issue #1555

Co-authored-by: Alan Somers <asomers@gmail.com>
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

2 participants