FabianLars / tauri-plugin-oauth

Apache License 2.0
79 stars 20 forks source link

Support for Tauri v2 #7

Closed kumareshind closed 10 months ago

kumareshind commented 10 months ago

I have been using this plugin with Tauri 1.x so far and it worked well.

When I moved to Tauri 2.0.0-alpha.x, there are dependency issues that I am facing when I do Cargo update.

This is what I get.

error: failed to select a version fortauri. ... required by packagetauri-plugin-oauth v0.0.0-alpha.0 ... which satisfies dependencytauri-plugin-oauth = "^0.0.0-alpha.0"of packagedrapp v0.1.0 (/Users/kr/Documents/GitHub/test-app/src-tauri) versions that meet the requirements^1` are: 1.5.2, 1.5.1, 1.5.0, 1.4.1, 1.4.0, 1.3.0, 1.2.5, 1.2.4, 1.2.3, 1.2.2, 1.2.1, 1.2.0, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.9, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0

the package tauri links to the native library web_kit2, but it conflicts with a previous package which links to web_kit2 as well: package wry v0.33.0 ... which satisfies dependency wry = "^0.33" of package tauri-runtime-wry v1.0.0-alpha.4 ... which satisfies dependency tauri-runtime-wry = "^1.0.0-alpha.4" of package tauri v2.0.0-alpha.16 ... which satisfies dependency tauri = "^2.0.0-alpha.16" of package drapp v0.1.0 (/Users/kr/Documents/GitHub/test-app/src-tauri) 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 ='tauri' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

the package tauri links to the native library web_kit2, but it conflicts with a previous package which links to web_kit2 as well: package tauri-runtime-wry v1.0.0-alpha.4 ... which satisfies dependency tauri-runtime-wry = "^1.0.0-alpha.4" of package tauri v2.0.0-alpha.16 ... which satisfies dependency tauri = "^2.0.0-alpha.16" of package drapp v0.1.0 (/Users/kr/Documents/GitHub/test-app/src-tauri) 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 ='tauri' value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.`

[✔] Environment

[-] Packages

[-] App

FabianLars commented 10 months ago

Thanks for the issue :)

I uploaded a v2 branch that's compatible with 2.0.0-alpha.16. I think i'll wait with publishing it to crates.io until v2 hits beta though. Until then you can consume it by changing the cargo.toml entry to this:

tauri-plugin-oauth = { git = "https://github.com/FabianLars/tauri-plugin-oauth", branch = "v2" }

p.s. for anyone interested, i tried to solve it with feature flags this time (like async-std with tokio02, tokio03, tokio1) but cargo wasn't happy with me because of all the native library linking :( - basically the same issue as above.

liyasthomas commented 5 months ago

Tauri v2 is now in beta. Can you update the library to add support to Tauri v2?

Edit: #9 works fine for me.