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

Cannot have nix 0.20 and 0.23 in same package due to conflicting bitflags requirement #1555

Closed
aDotInTheVoid opened this issue Oct 10, 2021 · 7 comments · Fixed by #1607
Closed

Comments

@aDotInTheVoid
Copy link

In Cargo.toml

[dependencies]
nix = "0.23.0"
zbus = "1.9.2"

This leads to

error: failed to select a version for `bitflags`.
    ... required by package `nix v0.20.2`
    ... which is depended on by `zbus v1.9.2`
    ... which is depended on by `whyyy v0.1.0 (/private/tmp/whyyy)`
versions that meet the requirements `>=1.1.0, <1.3.0` are: 1.2.1, 1.2.0, 1.1.0

all possible versions conflict with previously selected packages.

  previously selected package `bitflags v1.3.1`
    ... which is depended on by `nix v0.23.0`
    ... which is depended on by `whyyy v0.1.0 (/private/tmp/whyyy)`

failed to select a version for `bitflags` which could resolve this conflict

Because v0.23 needs bitflags > 1.3 but v0.20 need bitflags < 1.3

aDotInTheVoid added a commit to aDotInTheVoid/nix that referenced this issue Oct 10, 2021
Fixes nix-rust#1555

None of the 1.3 features were being used
aDotInTheVoid added a commit to aDotInTheVoid/nix that referenced this issue Oct 10, 2021
Fixes nix-rust#1555

None of the 1.3 features were being used

Tested with `cargo +nightly generate-lockfile -Zminimal-versions`
@aDotInTheVoid
Copy link
Author

Also if you could release 0.23.1 with this, that would be super helpfull for fixing the starship issue.

@m-ou-se
Copy link

m-ou-se commented Oct 12, 2021

See also #1548

asomers added a commit to asomers/nix that referenced this issue Oct 15, 2021
The vendor/ directory will henceforth contain virginal code copied from
upstream, and any necessary local modifications will only be made to
src/bitflags.rs.

Fixes nix-rust#1555
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
asomers added a commit to asomers/nix that referenced this issue Oct 15, 2021
The vendor/ directory will henceforth contain virginal code copied from
upstream, and any necessary local modifications will only be made to
src/bitflags.rs.

Fixes nix-rust#1555
@asomers
Copy link
Member

asomers commented Oct 15, 2021

Here's my proposed solution:

@aDotInTheVoid what do you think?

asomers added a commit to asomers/nix that referenced this issue Oct 15, 2021
The vendor/ directory will henceforth contain virginal code copied from
upstream, and any necessary local modifications will only be made to
src/bitflags.rs.

Fixes nix-rust#1555
@asomers
Copy link
Member

asomers commented Oct 21, 2021

@aDotInTheVoid are you able to review the linked PR?

@aDotInTheVoid
Copy link
Author

I think this would solve the problem I'm facing with starship, I'll try in a couple of hours when I'm back at a keyboard

@aDotInTheVoid
Copy link
Author

I dont know how to test this actually. Sorry

rivy added a commit to rivy/rs.coreutils that referenced this issue Nov 14, 2021
- possibly causing the CI codecov break for MacOS
- ref: [MacOS: Undefined symbols for architecture x86_64](nix-rust/nix#1588)
- ref: [Cannot have nix 0.20 and 0.23 in same package due to conflicting bitflags requirement](nix-rust/nix#1555)
- ref: [Declare the MSRV in Cargo.toml](nix-rust/nix#1561)
@asomers
Copy link
Member

asomers commented Dec 15, 2021

Aleksey Kladov came up with a different solution, which we merged as #1593 .

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>
asomers added a commit to asomers/nix that referenced this issue Dec 15, 2021
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 17, 2021
1607: Relax the bitflags dependency from 1.3.1 to 1.1 r=rtzoeller a=asomers

Fixes #1555

Co-authored-by: Alan Somers <asomers@gmail.com>
@bors bors bot closed this as completed in 178ea09 Dec 17, 2021
asomers added a commit to asomers/nix that referenced this issue Jan 23, 2022
asomers added a commit to asomers/nix that referenced this issue Jan 23, 2022
asomers added a commit to asomers/nix that referenced this issue Jan 23, 2022
asomers added a commit to asomers/nix that referenced this issue Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants