electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.52k stars 522 forks source link

Electron tries to run Redhat-specific tools when not using Redhat #3772

Open DrHyde opened 2 days ago

DrHyde commented 2 days ago

Pre-flight checklist

Electron Forge version

7.6.0

Electron version

v33.2.1

Operating system

Devuan GNU/Linux 5 (daedalus), x64

Last known working Electron Forge version

No response

Expected behavior

I tried to build my code on Devuan. The exact same code builds just fine on a Mac. npm run make should produce a working binary in the out/ directory.

Actual behavior

$ npm run make

> Unicode-search@0.0.1 make
> electron-forge make

✔ Checking your system
✔ Loading configuration
✖ Resolving make targets
  › Cannot make for rpm, the following external binaries need to be installed: rpmbuild
◼ Running package command
◼ Running preMake hook
◼ Making distributables
◼ Running postMake hook

An unhandled rejection has occurred inside Forge:
Error: Cannot make for rpm, the following external binaries need to be installed: rpmbuild
at MakerRpm.ensureExternalBinariesExist (/home/david/unicode-search/node_modules/@electron-forge/maker-base/dist/Maker.js:107:19)
    at /home/david/unicode-search/node_modules/@electron-forge/core/dist/api/make.js:119:27
    at async _Task.taskFn (/home/david/unicode-search/node_modules/@electron-forge/tracer/dist/index.js:58:20)
    at async _Task.run (/home/david/unicode-search/node_modules/listr2/dist/index.cjs:2063:11)

Steps to reproduce

To reproduce:

Additional information

A very similar error was reported previously in #1262 and "fixed" by improving the error message to make it clear that Electron is trying to erroneously run Redhat-specific tools on a non-Redhat machine. Making the error message more clear is obviously not in fact a fix. A fix would be a code change to make it stop running Redhat stuff on any platform except Redhat, unless specifically asked to do so, just like you would only run Mac-specific tools on a Mac, and Windows-specific tools on Windows.

DrHyde commented 2 days ago

As a work-around, users who aren't on Redhat can apt-get install rpm but this is obviously far from ideal.