pentamassiv / gtk4-layer-shell-gir

Unsafe bindings and a safe wrapper for gtk4-layer-shell, automatically generated from a .gir file
MIT License
22 stars 2 forks source link

Failed to install with relm4 #7

Closed siddharthroy12 closed 1 year ago

siddharthroy12 commented 1 year ago

I tried to use this with relm4 but I got this error

rust_playground on  master [?] is 📦 v0.1.0 via 🦀 v1.70.0 took 4s 
❯ cargo run
    Updating crates.io index
error: failed to select a version for `gtk4-sys`.
    ... required by package `gtk4-layer-shell-sys v0.0.2`
    ... which satisfies dependency `ffi = "^0.0.2"` of package `gtk4-layer-shell v0.0.3`
    ... which satisfies dependency `gtk4-layer-shell = "^0.0.3"` of package `rust_playground v0.1.0 (/home/siddharthroy/Projects/rust_playground)`
versions that meet the requirements `^0.6` are: 0.6.3, 0.6.2, 0.6.0

the package `gtk4-sys` links to the native library `gtk-4`, but it conflicts with a previous package which links to `gtk-4` as well:
package `gtk4-sys v0.5.0`
    ... which satisfies dependency `ffi = "^0.5.0"` of package `gtk4 v0.5.0`
    ... which satisfies dependency `gtk = "^0.5"` of package `relm4 v0.5.0`
    ... which satisfies dependency `relm4 = "^0.5.0"` of package `relm4-components v0.5.0`
    ... which satisfies dependency `relm4-components = "^0.5.0"` of package `rust_playground v0.1.0 (/home/siddharthroy/Projects/rust_playground)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the links ='gtk4-sys' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `gtk4-sys` which could resolve this conflict

My Cargo.toml

[package]
name = "rust_playground"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
gtk4-layer-shell = "0.0.3"
relm4 = "0.5.0"
relm4-components = "0.5.0"
siddharthroy12 commented 1 year ago

Solved: I needed to use version 0.6.0 of relm4 instead of 0.5.0

[package]
name = "rust_playground"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
gtk4-layer-shell = "0.0.3"
relm4 = "0.6.0"
relm4-components = "0.6.0"