tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.77k stars 2.45k forks source link

[bug] Can't run the examples #8897

Closed lucascampelo closed 6 months ago

lucascampelo commented 6 months ago

Describe the bug

I'm trying tauri for the first days and everything runs fine with create-tauri-app, but I want to know a little deeper about it and I'm trying to run the examples. I started with the examples/api and follow the readme.md but the example doesn't start. I'm trying to run with different ways in dev, latest, next and 1.x branches without success until now. I'm using WSL2 on Windows 11 and started following these v1 instructions, then quick start and now I'm stucked in the example with the error bellow:

$ yarn tauri dev
yarn run v1.22.21
warning package.json: No license field
$ node ../../tooling/cli/node/tauri.js dev
     Running BeforeDevCommand (`yarn dev`)
warning package.json: No license field
$ vite --clearScreen false --port 5173

  vite v2.9.16 dev server running at:

  > Local: http://localhost:5173/
  > Network: use `--host` to expose

  ready in 629ms.

        Info Watching /home/lucascampelo/projetos/lucascampelo/tauri/examples/api/src-tauri for changes...
    Updating crates.io index
error: failed to select a version for `nix`.
    ... required by package `wl-clipboard-rs v0.8.0`
    ... which satisfies dependency `wl-clipboard-rs = "^0.8"` of package `arboard v3.3.0`
    ... which satisfies dependency `arboard = "^3"` (locked to 3.3.0) of package `tauri-runtime-wry v0.14.4 (/home/lucascampelo/projetos/lucascampelo/tauri/core/tauri-runtime-wry)`
    ... which satisfies path dependency `tauri-runtime-wry` of package `api v0.1.0 (/home/lucascampelo/projetos/lucascampelo/tauri/examples/api/src-tauri)`
versions that meet the requirements `^0.26.4` are: 0.26.4

all possible versions conflict with previously selected packages.

  previously selected package `nix v0.26.2`
    ... which satisfies dependency `nix = "^0.26.0"` (locked to 0.26.2) of package `tauri v1.6.0 (/home/lucascampelo/projetos/lucascampelo/tauri/core/tauri)`
    ... which satisfies path dependency `tauri` of package `api v0.1.0 (/home/lucascampelo/projetos/lucascampelo/tauri/examples/api/src-tauri)`

failed to select a version for `nix` which could resolve this conflict
error Command failed with exit code 101.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction

Try to run the examples/api in a new environment.

Expected behavior

To start the example app.

Full tauri info output

[✔] Environment
    - OS: Ubuntu 20.04 X64
    ✔ webkit2gtk-4.0: 2.38.6
    ✔ rsvg2: 2.48.9
    ✔ rustc: 1.76.0 (07dca489a 2024-02-04)
    ✔ cargo: 1.76.0 (c84b36747 2024-01-18)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.10.0
    - yarn: 1.22.21
    - npm: 10.2.3

[-] Packages
    - tauri [RUST]: 1.5.3
    - tauri-build [RUST]: 1.5.0
    - wry [RUST]: 0.24.6
    - tao [RUST]: 0.16.2
    - tauri-cli [RUST]: 1.5.10
    - @tauri-apps/api [NPM]: 1.5.3
    - @tauri-apps/cli [NPM]: 1.5.10

[-] App
    - build-type: bundle
    - CSP: img-src 'self' asset: https://asset.localhost blob: data:; default-src 'self' customprotocol: asset:; font-src https://fonts.gstatic.com; style-src 'unsafe-inline' 'self' https://fonts.googleapis.com
    - distDir: ../dist
    - devPath: http://localhost:5173/
    - framework: Svelte
    - bundler: Vite

Stack trace

error: failed to select a version for `nix`.
    ... required by package `wl-clipboard-rs v0.8.0`
    ... which satisfies dependency `wl-clipboard-rs = "^0.8"` of package `arboard v3.3.0`
    ... which satisfies dependency `arboard = "^3"` (locked to 3.3.0) of package `tauri-runtime-wry v0.14.4 (/home/lucascampelo/projetos/lucascampelo/tauri/core/tauri-runtime-wry)`
    ... which satisfies path dependency `tauri-runtime-wry` of package `api v0.1.0 (/home/lucascampelo/projetos/lucascampelo/tauri/examples/api/src-tauri)`
versions that meet the requirements `^0.26.4` are: 0.26.4

all possible versions conflict with previously selected packages.

  previously selected package `nix v0.26.2`
    ... which satisfies dependency `nix = "^0.26.0"` (locked to 0.26.2) of package `tauri v1.6.0 (/home/lucascampelo/projetos/lucascampelo/tauri/core/tauri)`
    ... which satisfies path dependency `tauri` of package `api v0.1.0 (/home/lucascampelo/projetos/lucascampelo/tauri/examples/api/src-tauri)`

failed to select a version for `nix` which could resolve this conflict
error Command failed with exit code 101.

Additional context

No response

lucasfernog commented 6 months ago

Try running a cargo update first so it properly resolves this upstream bug.

lucascampelo commented 6 months ago

After the update the same error happen. Just for feedback:

$ cargo update
    Updating crates.io index
    Updating addr2line v0.20.0 -> v0.21.0
    Updating anyhow v1.0.79 -> v1.0.80
    Updating arboard v3.2.1 -> v3.3.1
    Updating async-channel v1.9.0 -> v2.2.0
    Updating async-executor v1.5.1 -> v1.8.0
      Adding async-io v2.3.1
      Adding async-lock v3.3.0
    Updating async-process v1.7.0 -> v1.8.1
      Adding async-signal v0.2.5
    Updating backtrace v0.3.68 -> v0.3.69
    Updating blocking v1.4.1 -> v1.5.1
    Updating bstr v1.6.2 -> v1.9.0
    Updating bumpalo v3.14.0 -> v3.15.0
    Updating cargo_toml v0.15.2 -> v0.15.3
    Updating cfg-expr v0.15.4 -> v0.15.7
    Updating clipboard-win v4.5.0 -> v5.1.0
    Updating colored v2.0.2 -> v2.1.0
      Adding core-graphics v0.23.1
    Updating crossbeam-channel v0.5.8 -> v0.5.11
      Adding crossbeam-deque v0.8.5
      Adding crossbeam-epoch v0.9.18
    Updating crossbeam-utils v0.8.16 -> v0.8.19
    Removing cty v0.2.2
    Updating darling v0.20.5 -> v0.20.6
    Updating darling_core v0.20.5 -> v0.20.6
    Updating darling_macro v0.20.5 -> v0.20.6
      Adding deranged v0.3.11
      Adding dlib v0.5.2
    Updating embed-resource v2.3.0 -> v2.4.1
      Adding equivalent v1.0.1
    Updating error-code v2.3.1 -> v3.0.0
      Adding event-listener v3.1.0
      Adding event-listener v4.0.3
      Adding event-listener v5.1.0
      Adding event-listener-strategy v0.4.0
      Adding event-listener-strategy v0.5.0
    Updating flate2 v1.0.26 -> v1.0.28
      Adding foreign-types v0.5.0
      Adding foreign-types-macros v0.2.3
      Adding foreign-types-shared v0.3.1
      Adding futures-lite v2.2.0
    Updating gethostname v0.2.3 -> v0.4.3
    Updating gimli v0.27.3 -> v0.28.1
    Updating globset v0.4.13 -> v0.4.14
    Updating h2 v0.3.20 -> v0.3.24
      Adding hashbrown v0.14.3
    Updating ignore v0.4.18 -> v0.4.22
    Updating image v0.24.4 -> v0.24.8
      Adding indexmap v2.2.3
    Removing is-terminal v0.4.7
    Updating jpeg-decoder v0.2.6 -> v0.3.1
      Adding libloading v0.8.1
      Adding linux-raw-sys v0.4.13
    Updating memchr v2.6.2 -> v2.7.1
    Removing memoffset v0.6.5
    Removing nix v0.24.3
      Adding num-conv v0.1.0
    Removing num-integer v0.1.46
    Removing num-rational v0.4.1
    Removing num_threads v0.1.6
    Updating object v0.31.1 -> v0.32.2
    Updating os_str_bytes v6.5.1 -> v6.6.1
    Updating petgraph v0.6.3 -> v0.6.4
    Updating pkg-config v0.3.29 -> v0.3.30
    Updating plist v1.5.1 -> v1.6.0
    Updating png v0.17.11 -> v0.17.13
      Adding polling v3.5.0
      Adding powerfmt v0.2.0
    Updating proptest v1.2.0 -> v1.4.0
      Adding quick-xml v0.31.0
    Updating raw-window-handle v0.5.0 -> v0.5.2
    Removing redox_syscall v0.3.5
    Updating regex v1.9.6 -> v1.10.3
    Updating regex-automata v0.3.9 -> v0.4.5
    Updating regex-syntax v0.7.5 -> v0.8.2
    Updating reqwest v0.11.18 -> v0.11.24
      Adding rustix v0.38.31
      Adding rustls-pemfile v1.0.4
    Updating ryu v1.0.16 -> v1.0.17
    Updating semver v1.0.21 -> v1.0.22
    Updating serde_json v1.0.97 -> v1.0.113
    Updating serde_spanned v0.6.1 -> v0.6.5
    Updating serde_with v3.0.0 -> v3.6.1
    Updating serde_with_macros v3.0.0 -> v3.6.1
    Removing signal-hook v0.3.17
      Adding socket2 v0.5.5
    Removing str-buf v1.0.6
    Updating syn v2.0.48 -> v2.0.49
      Adding sync_wrapper v0.1.2
      Adding system-configuration v0.5.1
      Adding system-configuration-sys v0.5.0
    Updating system-deps v6.1.1 -> v6.2.0
    Updating tar v0.4.39 -> v0.4.40
    Updating tempfile v3.6.0 -> v3.10.0
    Updating textwrap v0.16.0 -> v0.16.1
    Updating tiff v0.7.4 -> v0.9.1
    Updating time v0.3.15 -> v0.3.34
      Adding time-core v0.1.2
    Updating time-macros v0.2.4 -> v0.2.17
    Updating tokio v1.29.0 -> v1.36.0
    Updating tokio-macros v2.1.0 -> v2.2.0
    Removing toml v0.7.3
      Adding toml v0.7.8
      Adding toml v0.8.10
    Updating toml_datetime v0.6.1 -> v0.6.5
    Removing toml_edit v0.19.8
      Adding toml_edit v0.19.15
      Adding toml_edit v0.22.6
    Updating wasm-streams v0.2.3 -> v0.4.0
      Adding wayland-backend v0.3.3
    Updating wayland-client v0.29.5 -> v0.31.2
    Removing wayland-commons v0.29.5
    Updating wayland-protocols v0.29.5 -> v0.31.2
      Adding wayland-protocols-wlr v0.2.0
    Updating wayland-scanner v0.29.5 -> v0.31.1
    Updating wayland-sys v0.29.5 -> v0.31.1
    Removing winapi-wsapoll v0.1.1
      Adding windows-core v0.52.0
    Removing winnow v0.4.1
      Adding winnow v0.5.40
      Adding winnow v0.6.1
    Updating winreg v0.10.1 -> v0.50.0
    Updating wl-clipboard-rs v0.7.0 -> v0.8.0
    Updating x11rb v0.10.1 -> v0.13.0
    Updating x11rb-protocol v0.10.0 -> v0.13.0
    Updating xattr v0.2.3 -> v1.3.1
    Removing xml-rs v0.8.19
    Updating zbus v3.13.0 -> v3.15.0
    Updating zbus_macros v3.13.0 -> v3.15.0
    Updating zbus_names v2.5.0 -> v2.6.0
    Updating zvariant v3.13.0 -> v3.15.0
    Updating zvariant_derive v3.13.0 -> v3.15.0
    Updating zvariant_utils v1.0.0 -> v1.0.1
lucascampelo commented 6 months ago

The same version works fine on Mac OS, but doesn't work on WSL2 running Ubuntu 20.04.

lucascampelo commented 6 months ago

The current version of dev branch is targeting the v2-beta of tauri. Looking deeper I found the required dependency libwebkit2gtk-4.1-dev isn't available on Ubuntu 20.04 (which is the version I was running). After to run on Ubuntu 22.04, works pretty fine. Maybe tauri v2 will not be compatible with Ubuntu 20.04 due the this dependency change.

FabianLars commented 6 months ago

Maybe tauri v2 will not be compatible with Ubuntu 20.04 due the this dependency change.

Correct. At least as long as we're using webkitgtk :)