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

invalid version for semver pre-releases when targeting "pacman" #7601

Closed
m4rch3n1ng opened this issue Jun 6, 2023 · 3 comments · Fixed by #7630
Closed

invalid version for semver pre-releases when targeting "pacman" #7601

m4rch3n1ng opened this issue Jun 6, 2023 · 3 comments · Fixed by #7630

Comments

@m4rch3n1ng
Copy link
Contributor

  • Electron-Builder Version: 23.6.0
  • Node Version: v20.2.0
  • Target: pacman

building for target "pacman" with a semver compatible pre-release version (e.g. 0.0.0-alpha.0, 3.0.0-preview.19) results in an invalid version format, since arch linux does not allow hyphens in package versions. installing the package then results not in installing the desired package-name@0.0.0-alpha.0 but instead package-name-0.0.0@alpha.0.

changing the hyphen to an underscore (like the arch wiki recommends) or a period (also common, though not recommended) results in an Invalid version: "0.0.0_alpha.0" error.

i am unsure how exactly to deal with this, but i would probably recommend following the advice from the arch wiki and replacing the hyphen with an underscore when building for the "pacman" target.

@mmaietta
Copy link
Collaborator

Happy to review a PR for the change!

@mvitale1989
Copy link
Contributor

mvitale1989 commented Jan 11, 2024

Hello @mmaietta , the current implementation still presents some weird ordering behaviour on Debian:

### 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

I have tested the changes from #7630 and extended the translation of - to a ~ for debian, and the deb packages are built with the correct version. I can open a PR to fix this.

edit: also opened a dedicated issue for this #7977

@m4rch3n1ng
Copy link
Contributor Author

ah i didn't see the footnotes when i opened the pr, the tilde is explained in the debian docs in footnote 7

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 a pull request may close this issue.

3 participants