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

Failed to make RPM package #3701

Open
3 tasks done
niklauslee opened this issue Sep 18, 2024 · 3 comments
Open
3 tasks done

Failed to make RPM package #3701

niklauslee opened this issue Sep 18, 2024 · 3 comments

Comments

@niklauslee
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.4.0

Electron version

31.3.0

Operating system

Ubuntu 24.04

Last known working Electron Forge version

7.4.0

Expected behavior

Try to make .rpm package but failed with errors

Actual behavior

Failed with the below errors:

An unhandled rejection has occurred inside Forge:
Error: Command failed with a non-zero return code (1):
rpmbuild -bb /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/SPECS/frame0.spec --target x86_64-none-linux --define _topdir /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64
Building target platforms: x86_64-none-linux
Building for target x86_64-none-linux
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.zcb8Zx

RPM build errors:

+ umask 022
+ cd /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/BUILD
+ /bin/rm -rf /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/BUILDROOT/frame0-1.0.0.beta.0-1.x86_64
+ /bin/mkdir -p /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/BUILDROOT
+ /bin/mkdir /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/BUILDROOT/frame0-1.0.0.beta.0-1.x86_64
+ mkdir -p /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/BUILDROOT/frame0-1.0.0.beta.0-1.x86_64/usr/
+ cp -r usr/bin usr/lib usr/share /tmp/electron-installer--30018-OEWdZ25er7DK/frame0_1.0.0.beta.0_x86_64/BUILDROOT/frame0-1.0.0.beta.0-1.x86_64/usr/
+ /usr/lib/rpm/brp-compress /usr
+ /usr/lib/rpm/brp-elfperms
+ /usr/lib/rpm/brp-strip /usr/bin/strip
xargs: /usr/bin/strip: No such file or directory
xargs: /usr/bin/strip: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.zcb8Zx (%install)
    Bad exit status from /var/tmp/rpm-tmp.zcb8Zx (%install)
at ChildProcess.<anonymous> (/home/niklaus/git/frame0/node_modules/electron-installer-redhat/node_modules/@malept/cross-spawn-promise/src/index.ts:172:16)
    at ChildProcess.emit (node:events:519:28)
    at ChildProcess.emit (node:domain:488:12)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)

Steps to reproduce

npm run make

# or
npm run make -- --targets=@electron-forge/maker-rpm

Additional information

forge.config.ts

import type { ForgeConfig } from "@electron-forge/shared-types";
import { VitePlugin } from "@electron-forge/plugin-vite";
import { FusesPlugin } from "@electron-forge/plugin-fuses";
import { FuseV1Options, FuseVersion } from "@electron/fuses";
import packageJson from "./package.json";

const config: ForgeConfig = {
  packagerConfig: {
    icon: "./build/icons/icon",
    asar: true,
    osxSign: {},
    osxNotarize: {
      appleId: "...",
      appleIdPassword: "...",
      teamId: "...",
    },
    executableName: "frame0",
  },
  rebuildConfig: {},
  makers: [
    {
      name: "@electron-forge/maker-zip",
      platforms: ["darwin"],
      config: (arch: string) => ({
        macUpdateManifestBaseUrl: `https://...`,
      }),
    },
    {
      name: "@electron-forge/maker-dmg",
      config: {
        icon: "./build/icons/icon.icns",
        format: "ULFO",
      },
    },
    {
      name: "@electron-forge/maker-squirrel",
      config: (arch: string) => ({
        iconUrl: `https://frame0.app/icons/icon.ico`,
        setupIcon: "./build/icons/icon.ico",
        certificateFile: "....",
        CertificatePassword: "...",
        remoteReleases: `https://...`,
      }),
    },
    {
      name: "@electron-forge/maker-deb",
      config: {
        options: {
          icon: "./build/icons/icon.png",
          name: packageJson.name,
          productName: packageJson.productName,
          maintainer: packageJson.author,
          homepage: packageJson.homepage,
        },
      },
    },
    {
      name: "@electron-forge/maker-rpm",
      config: {
        options: {
          icon: "./build/icons/icon.png",
          name: packageJson.name,
          productName: packageJson.productName,
          maintainer: packageJson.author,
          homepage: packageJson.homepage,
        },
      },
    },
  ],
  publishers: [
    {
      name: "@electron-forge/publisher-s3",
      config: {
        endpoint: "...",
        region: "auto",
        bucket: "...",
        folder: "releases",
        public: true,
        accessKeyId: "...",
        secretAccessKey: "...",
      },
    },
  ],
  plugins: [
    new VitePlugin({
      ...
    }),
    new FusesPlugin({
      ...
    }),
  ],
};

export default config;

package.json

{
  "name": "frame0",
  "productName": "Frame0",
  "version": "1.0.0-beta.0",
  "author": "niklauslee",
  "homepage": "https://frame0.app",
  "description": "My Electron application description",
  "main": ".vite/build/main.js",
  "scripts": {
    "dev": "electron-forge start",
    "package": "electron-forge package",
    "make": "electron-forge make",
    "publish": "electron-forge publish",
    "lint": "eslint --ext .ts,.tsx ."
  },
  "devDependencies": {
    "@electron-forge/cli": "^7.4.0",
    "@electron-forge/maker-deb": "^7.4.0",
    "@electron-forge/maker-dmg": "^7.4.0",
    "@electron-forge/maker-rpm": "^7.4.0",
    "@electron-forge/maker-squirrel": "^7.4.0",
    "@electron-forge/maker-zip": "^7.4.0",
    "@electron-forge/plugin-auto-unpack-natives": "^7.4.0",
    "@electron-forge/plugin-fuses": "^7.4.0",
    "@electron-forge/plugin-vite": "^7.4.0",
    "@electron-forge/publisher-s3": "^7.4.0",
    "@electron/fuses": "^1.8.0",
    "@electron/notarize": "^2.3.2",
    "@electron/osx-sign": "^1.3.1",
    "@types/node": "^20.14.10",
    "@types/path-browserify": "^1.0.2",
    "@types/react": "^18.3.3",
    "@types/react-dom": "^18.3.0",
    "@typescript-eslint/eslint-plugin": "^5.62.0",
    "@typescript-eslint/parser": "^5.62.0",
    "@vitejs/plugin-react": "^4.3.1",
    "autoprefixer": "^10.4.19",
    "electron": "^31.3.0",
    "eslint": "^8.57.0",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.1",
    "lucide-static": "^0.424.0",
    "postcss": "^8.4.38",
    "tailwindcss": "^3.4.4",
    "ts-node": "^10.9.2",
    "typescript": "^5.5.3",
    "vite": "^5.3.2"
  },
  "keywords": [],
  "license": "MIT",
  "dependencies": {
    "@dgmjs/core": "^0.31.2",
    "@dgmjs/export": "^0.8.1",
    "@dgmjs/react": "^0.20.4",
    "@hello-pangea/dnd": "^16.6.0",
    "@radix-ui/colors": "^0.1.8",
    "@radix-ui/react-accordion": "^1.1.2",
    "@radix-ui/react-alert-dialog": "^1.0.5",
    "@radix-ui/react-avatar": "^1.0.4",
    "@radix-ui/react-checkbox": "^1.0.4",
    "@radix-ui/react-collapsible": "^1.0.3",
    "@radix-ui/react-context-menu": "^2.1.4",
    "@radix-ui/react-dialog": "^1.0.5",
    "@radix-ui/react-dropdown-menu": "^2.0.6",
    "@radix-ui/react-icons": "^1.3.0",
    "@radix-ui/react-label": "^2.0.2",
    "@radix-ui/react-popover": "^1.0.7",
    "@radix-ui/react-radio-group": "^1.2.0",
    "@radix-ui/react-scroll-area": "^1.0.5",
    "@radix-ui/react-select": "^2.1.1",
    "@radix-ui/react-separator": "^1.0.3",
    "@radix-ui/react-slider": "^1.1.2",
    "@radix-ui/react-slot": "^1.0.2",
    "@radix-ui/react-switch": "^1.0.3",
    "@radix-ui/react-tabs": "^1.0.4",
    "@radix-ui/react-toast": "^1.1.5",
    "@radix-ui/react-toggle": "^1.0.3",
    "@radix-ui/react-toggle-group": "^1.0.4",
    "@radix-ui/react-tooltip": "^1.0.7",
    "class-variance-authority": "^0.7.0",
    "clsx": "^2.1.1",
    "electron-squirrel-startup": "^1.0.1",
    "immer": "^10.1.1",
    "lucide-react": "^0.407.0",
    "next-themes": "^0.3.0",
    "path-browserify": "^1.0.1",
    "react": "^18.3.1",
    "react-colorful": "^5.6.1",
    "react-dom": "^18.3.1",
    "sonner": "^1.5.0",
    "tailwind-merge": "^2.4.0",
    "tailwindcss-animate": "^1.0.7",
    "update-electron-app": "^3.0.0",
    "vaul": "^0.9.1",
    "zod-to-json-schema": "^3.23.1",
    "zustand": "^4.5.4"
  }
}
@niklauslee
Copy link
Author

More test results:

  • Ubuntu 24.04 : Failed
  • Ubuntu 22.04 : Failed
  • Fedora 40 : Success

@bcdrme
Copy link

bcdrme commented Nov 9, 2024

Additionally:

  • Fedora 41 : Failed

@egalanos
Copy link

egalanos commented Nov 29, 2024

Fedora 41 not working appears to be due to https://github.com/electron-userland/electron-installer-redhat not being compatible with rpm 4.2 changes.

electron-installer-redhat sets app files to be installed under BUILD/usr. Meanwhile rpm 4.2 sets up the build directory to be under a sub directory.

The cause of breaking changes: rpm-software-management/rpm#2078

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants