Skip to content

[bug] Top Level Cargo Workspace Breaks Tauri Info #4232

@kdumontnu

Description

@kdumontnu

Describe the bug

I'm working on setting up Tauri as a front-end for my Rust library, with a top-level Cargo.toml file that looks like the following:

[workspace]
members = [
  "src-tauri",
  
  # core
  "core/my-library"
]

When I run cargo update, it puts Cargo.lock in the top (root) directory. Then, running tauri info shows "(no lockfile)", or older versions of my dependencies if I already have a lockfile in ./src-tauri/.

Reproduction

  1. Create a new tauri project
  2. Add a Cargo.toml file at the root directory with
[workspace]
members = [
  "src-tauri",
]
  1. Run tauri info and you will see (no lockfile) for tauri deps.

Expected behavior

I expect it to default first to use the cargo lock file at the top level (same as cargo).

Platform and versions

`$ npm run tauri info`


> tauri-test-app@0.1.0 tauri
> tauri "info"


Environment
  › OS: Mac OS 12.3.1 X64
  › Node.js: 18.2.0
  › npm: 8.9.0
  › pnpm: 6.11.0
  › yarn: 1.22.15
  › rustup: 1.24.3
  › rustc: 1.62.0-beta.2
  › cargo: 1.62.0-beta.2
  › Rust toolchain: beta-aarch64-apple-darwin 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.13
  › @tauri-apps/api [NPM]: 1.0.0-rc.6
  › tauri [RUST]: 1.0.0-rc.14 (no lockfile),
  › tauri-build [RUST]: no manifest (no lockfile),
  › tao [RUST]: no manifest (no lockfile),
  › wry [RUST]: no manifest (no lockfile),

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/
  › framework: Vue.js

App directory structure
  ├─ core
  ├─ test
  ├─ dist
  ├─ target
  ├─ node_modules
  ├─ public
  ├─ src-tauri
  ├─ .git
  ├─ .vscode
  └─ src

Stack trace

No response

Additional context

I'm pretty new to Tauri and Rust, so if this is not the "correct" way of structuring my project I can close this, but it was very confusing to me initially that I was seeing outdated versions of tauri in my tauri info when using cargo workspaces.

I could place the library directory (core/) as a sub-directory in ./src-tauri and move my workspace into that directory as well, but that seems counter to what I'm trying to build, where tauri is an optional front-end to this library, and the main component of my repo is in core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions