Skip to content

[bug] [v2] Cargo assertion failure during consecutive Tauri builds #9547

Closed
tauri-apps/create-tauri-app
#791
@fabiankachlock

Description

@fabiankachlock

Describe the bug

I've just migrated my project to tauri v2 and cargo fails to build the project because of the following assertion mtimes.insert(output.clone(), mtime).is_none()

This only happens in consecutive builds. The first build after running cargo clean always works. The rebuild triggered by saving a file while tauri dev is running, fails the same way.

These errors occur on both windows & liunx with the same behavior.

Reproduction

You can find the project itself at https://github.com/fabiankachlock/zwoo
Follow these steps to reporduce:

  • Clone the repo: git clone [email protected]:fabiankachlock/zwoo.git
  • cd ./zwoo/frontend
  • checkout the branch git checkout feat/ZWOO-458-migrate-tauri
  • yarn (install frontend deps)
  • yarn vite --mode tauri --port 8070 (start frontend)
  • yarn tauri dev should work fine the first time, but running it a second time fails

Expected behavior

The project builds just fine even after consecutive calls to tauri dev/build or saving a file while tauri dev is active.

Full tauri info output

The windows machine:

[✔] Environment
    - OS: Windows 10.0.22631 X64
    ✔ WebView2: 123.0.2420.97
    ✔ MSVC: Visual Studio Community 2022
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (bbb9276d2 2024-03-08)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (environment override by RUSTUP_TOOLCHAIN)
    - node: 20.11.0
    - pnpm: 8.15.6
    - yarn: 1.22.19
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.15
    - tauri-build [RUST]: 2.0.0-beta.12
    - wry [RUST]: 0.39.1
    - tao [RUST]: 0.27.0
    - tauri-cli [RUST]: 2.0.0-beta.13
    - @tauri-apps/api [NPM]: 2.0.0-beta.8
    - @tauri-apps/cli [NPM]: 2.0.0-beta.13

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist-tmp
    - devUrl: http://localhost:8070/
    - framework: Vue.js
    - bundler: Rollup

The linux machine:

[✔] Environment
    - OS: Linux Rolling Release X64
    ✔ webkit2gtk-4.1: 2.44.1
    ✔ rsvg2: 2.58.0
    ✔ rustc: 1.77.2 (25ef9e3d8 2024-04-09)
    ✔ cargo: 1.77.2 (e52e36006 2024-03-26)
    ✔ rustup: 1.27.0 (2024-03-12)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 20.11.1
    - pnpm: 8.15.6
    - yarn: 1.22.21
    - npm: 10.2.4

[-] Packages
    - tauri [RUST]: 2.0.0-beta.15
    - tauri-build [RUST]: 2.0.0-beta.12
    - wry [RUST]: 0.39.1
    - tao [RUST]: 0.27.0
    - tauri-cli [RUST]: 2.0.0-beta.10
    - @tauri-apps/api [NPM]: 2.0.0-beta.8
    - @tauri-apps/cli [NPM]: 2.0.0-beta.13

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist-tmp
    - devUrl: http://localhost:8070/
    - framework: Vue.js
    - bundler: Rollup

Stack trace

thread 'main' panicked at src/cargo\core\compiler\fingerprint\mod.rs:1111:13:
assertion failed: mtimes.insert(output.clone(), mtime).is_none()
stack backtrace:
   0:     0x7ff6f9a012d2 - git_midx_writer_dump
   1:     0x7ff6f9a2b85d - git_midx_writer_dump
   2:     0x7ff6f99fa661 - git_midx_writer_dump
   3:     0x7ff6f9a010fa - git_midx_writer_dump
   4:     0x7ff6f9a03f79 - git_midx_writer_dump
   5:     0x7ff6f9a03c35 - git_midx_writer_dump
   6:     0x7ff6f9a04494 - git_midx_writer_dump
   7:     0x7ff6f9a0432b - git_midx_writer_dump
   8:     0x7ff6f9a01bd9 - git_midx_writer_dump
   9:     0x7ff6f9a04036 - git_midx_writer_dump
  10:     0x7ff6f9ae0227 - git_midx_writer_dump
  11:     0x7ff6f9ae0302 - git_midx_writer_dump
  12:     0x7ff6f8d597f1 - git_filter_source_repo
  13:     0x7ff6f8d51ace - git_filter_source_repo
  14:     0x7ff6f8e10e79 - git_odb_object_id
  15:     0x7ff6f928b329 - git_filter_source_path
  16:     0x7ff6f8d52677 - git_filter_source_repo
  17:     0x7ff6f8d4d61a - git_filter_source_repo
  18:     0x7ff6f912d787 - git_filter_source_path
  19:     0x7ff6f920f770 - git_filter_source_path
  20:     0x7ff6f8b5a97d - git_filter_source_repo
  21:     0x7ff6f8b5a679 - git_filter_source_repo
  22:     0x7ff6f88e53cc - git_libgit2_prerelease
  23:     0x7ff6f89500c5 - git_filter_source_repo
  24:     0x7ff6f8947b2e - git_filter_source_repo
  25:     0x7ff6f892de06 - git_libgit2_prerelease
  26:     0x7ff6f894cb2c - git_filter_source_repo
  27:     0x7ff6f99f0622 - git_midx_writer_dump
  28:     0x7ff6f894ae5c - git_filter_source_repo
  29:     0x7ff6f9a344dc - git_midx_writer_dump
  30:     0x7fff8170257d - BaseThreadInitThunk
  31:     0x7fff8384aa48 - RtlUserThreadStart

Additional context

No response

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