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

fix(linux): Use ~ as pre-release separator for deb targets #7978

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

mvitale1989
Copy link
Contributor

Fixes: #7977

This PR translates the - pre-release separator (as mandated by the semver 2.0.0 spec, which is the format accepted by package.json) to a ~, to match Debian's expectations on package versioning.

See the below examples:

### According to semver 2.0, '1.0.0' should be considered greater than '1.0.0-rc1'. But for Debian it's not.
### This means that Debian will consider final releases a "downgrade" compared to the RCs, so it will always prefer installing the RC if both are available
$ dpkg --compare-versions 1.0.0 gt 1.0.0-rc1; echo $?
1
### On the other hand, using '~' instead of '-' yelds the correct ordering
$ dpkg --compare-versions 1.0.0 gt 1.0.0~rc1; echo $?
0

The reason why using ~ fixes this is because Debian orders the ~ "lower" than the end-of-string character, and afaiu the reason such a special character was needed is exactly for use cases such as pre-releases.

This also matches the fedora recommendations regarding packaging (which was first linked in this analysis, but this specific ordering issue was not caught due to the lack of explicit recommendations by Debian).

Copy link

changeset-bot bot commented Jan 11, 2024

🦋 Changeset detected

Latest commit: 0fde9ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
app-builder-lib Patch
dmg-builder Patch
electron-builder-squirrel-windows Patch
electron-builder Patch
electron-forge-maker-appimage Patch
electron-forge-maker-nsis-web Patch
electron-forge-maker-nsis Patch
electron-forge-maker-snap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jan 11, 2024

Deploy Preview for car-park-attendant-cleat-11576 ready!

Name Link
🔨 Latest commit 0fde9ba
🔍 Latest deploy log https://app.netlify.com/sites/car-park-attendant-cleat-11576/deploys/65a121318d077a000863ff4d
😎 Deploy Preview https://deploy-preview-7978--car-park-attendant-cleat-11576.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@mvitale1989 mvitale1989 changed the title Use ~ as pre-release separator for deb targets fix(linux): Use ~ as pre-release separator for deb targets Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deb pre-release builds are considered upgrades compared to final release builds
2 participants