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] cannot build with tauri.conf.json version with pre-release semvar (e.g., 0.1.0-1) #12470

Closed
Da-NKP opened this issue Jan 21, 2025 · 2 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Da-NKP
Copy link

Da-NKP commented Jan 21, 2025

Describe the bug

In /src-tauri/tauri.conf.json, using a prerelease semvar (e.g., 0.1.0-1) will cause a build error:

> [email protected] tauri
> tauri ios build

thread '<unnamed>' panicked at crates/tauri-cli/src/mobile/ios/mod.rs:148:62:
called `Result::unwrap()` on an `Err` value: IosVersionNumberInvalid(VersionTripleInvalid(PatchInvalid { version: "0.1.0-1", source: ParseIntError { kind: InvalidDigit } }))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: abort      npm run tauri ios build

Reproduction

  1. set up new project (npm create tauri-app@latest) according to the guide
  2. update version in /src-tauri/tauri.conf.json to a prerelease version (e.g., 0.1.0-1)
  3. do npm run tauri ios build (after ensuring all previous setup steps for new project are complete)

Expected behavior

Using a prerelease semvar should not cause the app to panic during build. It should compile just as it does for a standard release number.

Full tauri info output

[✔] Environment
    - OS: Mac OS 15.2.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.84.0 (9fc6b4312 2025-01-07)
    ✔ cargo: 1.84.0 (66221abde 2024-11-19)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 18.20.6
    - pnpm: 9.15.4
    - npm: 10.8.2
    - bun: 1.1.34

[-] Packages
    - tauri 🦀: 2.2.3
    - tauri-build 🦀: 2.0.5
    - wry 🦀: 0.48.1
    - tao 🦀: 0.31.1
    - @tauri-apps/api : 2.2.0
    - @tauri-apps/cli : 2.2.5

[-] Plugins
    - tauri-plugin-opener 🦀: 2.2.5
    - @tauri-apps/plugin-opener : 2.2.5

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

[-] iOS
    - Developer Teams: [Personal Dev Team], [Work Dev Team]

Stack trace

> [email protected] tauri
> tauri ios build

thread '<unnamed>' panicked at crates/tauri-cli/src/mobile/ios/mod.rs:148:62:
called `Result::unwrap()` on an `Err` value: IosVersionNumberInvalid(VersionTripleInvalid(PatchInvalid { version: "0.1.0-1", source: ParseIntError { kind: InvalidDigit } }))
stack backtrace:
   0:        0x1114e7758 - _napi_register_module_v1
   1:        0x111115300 - _bz_internal_error
   2:        0x1114b7f8c - _napi_register_module_v1
   3:        0x1114e9ab8 - _napi_register_module_v1
   4:        0x1114ea1e0 - _napi_register_module_v1
   5:        0x1114e9b80 - _napi_register_module_v1
   6:        0x1114e9af0 - _napi_register_module_v1
   7:        0x1114e9ae4 - _napi_register_module_v1
   8:        0x1118e87c8 - _napi_register_module_v1
   9:        0x1118e8a60 - _napi_register_module_v1
  10:        0x1116d2488 - _napi_register_module_v1
  11:        0x1116d60fc - _napi_register_module_v1
  12:        0x111050b2c - <unknown>
  13:        0x11105a3a4 - <unknown>
  14:        0x1114ecc08 - _napi_register_module_v1
  15:        0x18d1f02e4 - __pthread_deallocate
zsh: abort      RUST_BACKTRACE=full npm run tauri ios build

Additional context

No response

@Da-NKP Da-NKP added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jan 21, 2025
@FabianLars
Copy link
Member

can you check whether 0.1.0+1 works? iOS generally doesn't support full semver. A tldr from my understanding:
iOS has 2 version fields, CFBundleShortVersionString and CFBundleVersion.

  • CFBundleShortVersionString: This is the "main" public facing version and it requires a number[.number[.number]] format and does not accept prerelease data or build numbers (+/- in semver)
  • CFBundleVersion: This is the "build number". In app store contexts this can be used to re-submit your still private/in-testing app for the same main version. It also requires a number[.number[.number]] format.

For explanation, number[.number[.number]] means 1, 1.0, and 1.0.0 are all valid formats (but also the only formats).

Sooo, to get back to the topic, i asked to try 0.1.0+1 because + means build data in semver and i wondered if maybe we use the build data as the build number. Probably far fetched but worth a try.

@FabianLars
Copy link
Member

closing in favor of #12479

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2025
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