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] Failed to build pre-release on windows: app version cannot have build metadata or pre-release identifier #5286

Closed
nailuoGG opened this issue Sep 27, 2022 · 5 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@nailuoGG
Copy link

Describe the bug

build tauri app on windows, get below error:

Error failed to bundle project: app version cannot have build metadata or pre-release identifier: app version cannot have build metadata or pre-release identifier

but everything is ok on macOS

Reproduction

tauri.conf.json

{
"package": {
    "productName": "Initial-App",
    "version": "../package.json"
  }
}

and package.json

{
  "version": "0.1.2-alpha.0",
}

then build app

pnpm tauri build

Expected behavior

success build a pre-release package on windows

just like on macOS

Platform and versions

Environment
› OS: Windows 10.0.19044 X64
› Webview2: 105.0.1343.50
› MSVC:
- Visual Studio ???? 2022
› Node.js: 14.20.0
› npm: 6.14.17
› pnpm: 7.11.0
› yarn: Not installed!
› rustup: 1.25.1
› rustc: 1.63.0
› cargo: 1.63.0
› Rust toolchain: stable-x86_64-pc-windows-msvc

Packages
› @tauri-apps/cli [NPM]: 1.1.1
› @tauri-apps/api [NPM]: 1.1.0
› tauri [RUST]: 1.1.1,
› tauri-build [RUST]: 1.1.1,
› tao [RUST]: 0.14.0,
› wry [RUST]: 0.21.1,

App
› framework: React

App directory structure
├─ .git
├─ .github
├─ dist
├─ node_modules
├─ sample
├─ src
└─ src-tauri

Stack trace

warning: `app` (bin "app") generated 1 warning
    Finished release [optimized] target(s) in 16.10s
       Error failed to bundle project: app version cannot have build metadata or pre-release identifier: app version cannot have build metadata or pre-release identifier
 ELIFECYCLE  Command failed with exit code 1.

Additional context

I already search the keyword on tauri issue list and doc site

not sure if it's related to rust

@nailuoGG nailuoGG added status: needs triage This issue needs to triage, applied to new issues type: bug labels Sep 27, 2022
@FabianLars
Copy link
Member

This is a limitation of WiX (the toolkit used to create the .msi bundle). -> It only supports numeric versions (major.minor.patch)
The error message itself is from Tauri because the WiX error would unreadable so we catch the invalid version before WiX is invoked.

@FabianLars FabianLars closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 2022
@KillerCodeMonkey
Copy link

KillerCodeMonkey commented Jan 18, 2023

@FabianLars My problem is, that i had a workaround that replaced the semver to a valid wix version like 1.5.0-beta.1 to 1.5.0.1. but then i get an error that this is not a valid semver. It seems that this worked around 6 months ago.

Do you have an idea how to solve this "deadlock". i mean it would be nice to be able to create pre-releases for windows as well.

@FabianLars
Copy link
Member

The upcoming nsis target will support pre-releases.
For the current msi/wix target we could fix the version check to allow a 4th field too since wix does support it as long as it's a number.

@KillerCodeMonkey
Copy link

that would be awesome

@FabianLars
Copy link
Member

implemented in #6096

it still must be a valid semver string, meaning it'd look something like 0.1.0+1234 (build number) or 0.1.0-1234 (pre-release). No auto conversion is done and it's required that build/pre is numeric only.

nsis willl have proper/full semver support.

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

3 participants