Electron-builder: Unable to build deb for packages with scoped names

Created on 29 May 2018  路  2Comments  路  Source: electron-userland/electron-builder


  • Version: 20.15.1

  • Target: deb


usage description

Our application uses a scoped name in its package.json along with a productName without special characters. We build for several targets, including deb.

expected behavior

I expected the deb file to have a control file that looks like:

Package: Opentrons # <-productName
...

actual behavior

electron-builder always uses name from package.json as the deb:

Package: @opentrons/app-shell # <- name

problem

Debian package names must start with an alphanumeric character. As it stands, electron-builder by default builds invalid deb packages for projects with scoped names, because Package: @scope/name is illegal.

I'm not very familiar with this codebase, but this looks to me like it could be the offending line: https://github.com/electron-userland/electron-builder/blob/master/packages/electron-builder-lib/src/targets/fpm.ts#L125

I'm currently working around this by specifying --name=Opentrons in the deb.fpm config option, but that's sub-optimal because I have to manually keep that name and the packageName in sync (the file macros do not appear to work in the fpm option).

I think using packageName for fpm --name if it exists would be a very sane default. Otherwise, macro expansion in fpm options would also be an acceptable solution to me.

related tickets

  • #2956
  • #1895 (maybe?)
bug linux

Most helpful comment

Fixed, release will be in 2 days.

All 2 comments

Fixed, release will be in 2 days.

Was this page helpful?
0 / 5 - 0 ratings