Skip to content

fix(cli): map SemVer prereleases to legal native package versions - #5797

Open
nikuda wants to merge 5 commits into
DioxusLabs:mainfrom
nikuda:fix/rpm-prerelease-version
Open

fix(cli): map SemVer prereleases to legal native package versions#5797
nikuda wants to merge 5 commits into
DioxusLabs:mainfrom
nikuda:fix/rpm-prerelease-version

Conversation

@nikuda

@nikuda nikuda commented Aug 30, 2026

Copy link
Copy Markdown

Dioxus passes the Cargo package version directly to rpm::PackageBuilder. The rpm crate validates the RPM Version field during build() and rejects SemVer prereleases that contain -, such as 1.2.3-rc.1.

This projects Cargo semver::Version per format instead of using the raw string:

  • RPM / Debian: 1.2.3-rc.11.2.3~rc.1 (- is illegal in RPM Version, and in Debian without a revision; ~ sorts before the final release). Build metadata is dropped so it cannot invert upgrades.
  • WiX: numeric major.minor.patch with MSI limits (u8 / u8 / u16). Explicit [bundle.windows.wix] version stays major.minor.patch[.build].
  • NSIS: VIProductVersion is numeric (u16 components); installer names and version-key strings keep the raw Cargo version so prereleases stay distinct.
  • macOS: CFBundleShortVersionString / default CFBundleVersion use the numeric core.

Format-specific exports (rpm / deb / wix / nsis / macos) share private helpers. AppImage and other unconstrained artifact names are unchanged.

nikuda added 5 commits August 31, 2026 00:08
VIProductVersion still uses the numeric projection; filenames and version
string keys keep the raw Cargo version so prereleases stay distinct.
Explicit [bundle.windows.wix] version still strips prerelease suffixes,
but build metadata is rejected so the field stays major.minor.patch[.build].
Cargo SemVer continues to go through wix().
Validate components against u8::MAX / u16::MAX instead of a WiX-only
index table so NSIS can accept 256.x.x and reject 16-bit overflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant