electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.61k stars 1.74k forks source link

Version in debian metadata replaces `-` with `~` #8438

Open ctkinetic opened 1 month ago

ctkinetic commented 1 month ago

The debian metadata has our version different from the version we specify, which breaks our deployment logic. We set the version in package.json like so (with a - between the semantic version and the timestamp):

  "version": "5.26.2-20240817042507",

but the version in the debian package metadata (viewed via dpkg-deb --info) is different (note the ~ between the semantic version and the timestamp):

 Version: 5.26.2~20240817042507

This difference breaks our downstream deployment logic, because we can't install the specific version via something like apt install our-package=5.26.2-20240817042507.

The file name of the debian package is correct (with a dash).

The last build where this was not a problem used electron-builder version 24.6.4. This broke when we changed the devDependencies line in package.json from

    "electron-builder": "^24.6.4",

to

    "electron-builder": "^24.13.3",

Any suggestions?

ficristo commented 1 month ago

I think it is related to this issue https://github.com/electron-userland/electron-builder/issues/7977 and its fix https://github.com/electron-userland/electron-builder/pull/7978

ctkinetic commented 1 month ago

Hmm, then maybe somebody's replacement logic is over-aggressive? That is to say, a version provided by the user should not be modified by electron-builder, right? Changing user input makes things inconsistent (especially if the file name is not changed to match).

mmaietta commented 4 weeks ago

I'm not so sure if it's over-aggressive based on this PR description:

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.

As Debian expects it and the ~ also matches the fedora recommendations regarding packaging

I'm honestly not sure on the best way to progress here.