Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Info.plist modification in out dir causes Cargo to rebuild every time #7614

Closed
irh opened this issue Aug 14, 2023 · 1 comment
Closed
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@irh
Copy link

irh commented Aug 14, 2023

Describe the bug

On macOS, every time I run tauri dev Cargo has to rebuild the application even when no source files have been touched.

Running cargo build -v shows that the target/debug/build/[my-app]/out/Info.plist file has changed since the last build, requiring a rebuild of the app.

This happens with my 1.4-based app, but also on the latest dev with the helloworld example.

Reproduction

  • On macOS, in the Tauri repo, run cargo run --example helloworld
  • Close the app, and run cargo build --example -v
  • Observe that Cargo classifies the Info.plist file as Dirty, causing a recompilation of the main app binary.

Expected behavior

If no source files have been touched, then it would be great if Cargo wouldn't have to recompile the app.

Platform and versions

[✔] Environment
    - OS: Mac OS 13.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.71.0 (8ede3aae2 2023-07-12)
    ✔ Cargo: 1.71.0 (cfd3bbd8f 2023-06-08)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 16.15.0
    - pnpm: 8.6.11
    - yarn: 1.22.19
    - npm: 8.10.0

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.1
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../build
    - devPath: http://localhost:5173/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

No response

@irh irh added status: needs triage This issue needs to triage, applied to new issues type: bug labels Aug 14, 2023
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue Apr 26, 2024
@olexiyb
Copy link
Contributor

olexiyb commented Apr 26, 2024

I tracked down to invalid logic in https://github.com/tauri-apps/tauri/blob/1a984a41e7207c616e03b8032431c21176af6379/core/tauri-codegen/src/context.rs

let format =
        time::format_description::parse("[year][month][day].[hour][minute][second]").unwrap();
      if let Ok(build_number) = time::OffsetDateTime::now_utc().format(&format) {
        plist.insert("CFBundleVersion".into(), build_number.into());
      }

According to https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleversion

This key is a machine-readable string composed of one to three period-separated integers, such as 10.14.1. The string can only contain numeric characters (0-9) and periods.
...
You can include more integers but the system ignores them.

I believe this field should just have the version from tauri.conf.json

olexiyb added a commit to Sanctum-AI/tauri that referenced this issue Apr 26, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 3, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 10, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 10, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 22, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 24, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 25, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue May 25, 2024
olexiyb added a commit to Sanctum-AI/tauri that referenced this issue Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants