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

[flatpak/snap] Error when building flatpak and snap makers on Ubuntu 20.04 #2862

Closed
3 tasks done
raphael10-collab opened this issue Jun 5, 2022 · 5 comments
Closed
3 tasks done

Comments

@raphael10-collab
Copy link

raphael10-collab commented Jun 5, 2022

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

6.0.0-beta.63

Electron version

Electron 17.4.7

Operating system

Ubuntu 20.04 Desktop

Last known working Electron Forge version

No response

Expected behavior

no errors

Actual behavior

(base) raphy@pc:~/NEW/ForgeTypescriptReactWebpack$ yarn make
yarn run v1.22.18
$ electron-forge make
✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing native dependencies
✔ Compiling Main Process Code
✔ Compiling Renderer Template
✔ Preparing to Package Application for arch: x64
✔ Preparing native dependencies
⠋ Packaging Applicationwarn: Couldn't detect Electron version, assuming v0.1.0. Defaults have probably changed for your actual version, please check manually.
42 check(s) successfully loaded: 6 global, 36 atomic
████████████████████████████████████████ 100% | 7/7
⠸ Packaging ApplicationReleases list is up to date.
┌─────────────────────────────────────────┬───────────────┬──────────┬──────────────────────────────────────────────────┐
│ Check ID                                │ Affected File │ Location │ Issue Description                                │
├─────────────────────────────────────────┼───────────────┼──────────┼──────────────────────────────────────────────────┤
│ CSP_GLOBAL_CHECK                        │ N/A           │ 0:0      │ https://git.io/JeuMe                             │
│ MEDIUM | CERTAIN                        │               │          │                                                  │
├─────────────────────────────────────────┼───────────────┼──────────┼──────────────────────────────────────────────────┤
│ LIMIT_NAVIGATION_GLOBAL_CHECK           │ N/A           │ 0:0      │ https://git.io/JeuMs                             │
│ HIGH | CERTAIN                          │               │          │                                                  │
├─────────────────────────────────────────┼───────────────┼──────────┼──────────────────────────────────────────────────┤
│ PERMISSION_REQUEST_HANDLER_GLOBAL_CHECK │ N/A           │ 0:0      │ https://git.io/JeuM0                             │
│ MEDIUM | CERTAIN                        │               │          │                                                  │
└─────────────────────────────────────────┴───────────────┴──────────┴──────────────────────────────────────────────────┘
✔ Packaging Application
Making for the following targets: deb, flatpak, snap, zip, rpm
✔ Making for target: deb - On platform: linux - For arch: x64
✖ Making for target: flatpak - On platform: linux - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: flatpak
flatpak failed with status code 1
Error: flatpak failed with status code 1
    at ChildProcess.<anonymous> (/home/raphy/NEW/ForgeTypescriptReactWebpack/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

snap issue :

(base) raphy@pc:~/NEW/ForgeTypescriptReactWebpack$ yarn make
yarn run v1.22.18
$ electron-forge make
✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing native dependencies
✔ Compiling Main Process Code
✔ Compiling Renderer Template
✔ Compiling Renderer Preload: main_window
✔ Preparing to Package Application for arch: x64
✔ Preparing native dependencies
✔ Packaging Application
Making for the following targets: deb, snap, zip, rpm
✔ Making for target: deb - On platform: linux - For arch: x64
⠋ Making for target: snap - On platform: linux - For arch: x64The browser-sandbox feature will trigger a manual review in the Snap store.
⠏ Making for target: snap - On platform: linux - For arch: x64Ignoring '--target-arch' flag.  This flag requires --destructive-mode and is unsupported with Multipass and LXD build providers.
Build environment is in unknown state, cleaning first.
⠋ Making for target: snap - On platform: linux - For arch: x64/snap/multipass/7174/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
⠙ Making for target: snap - On platform: linux - For arch: x64/snap/multipass/7174/bin/launch-multipass: 3: export: /usr/sbin: bad variable name
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.
✖ Making for target: snap - On platform: linux - For arch: x64

An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/home/raphy/NEW/ForgeTypescriptReactWebpack/out/make/snap/x64/forgetypescriptreactwebpack_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/usr/bin/snapcraft snap --target-arch=amd64 --output=/home/raphy/NEW/ForgeTypescriptReactWebpack/out/make/snap/x64/forgetypescriptreactwebpack_1.0.0_amd64.snap
    at ChildProcess.<anonymous> (/home/raphy/NEW/ForgeTypescriptReactWebpack/node_modules/@malept/cross-spawn-promise/src/index.ts:172:16)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess.emit (node:domain:475:12)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
error Command failed with exit code 1.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce

You can reproduce the error git cloning this repo: https://github.com/raphael10-collab/ForgeTypescriptReactWebpack -> yarn -> yarn run (to make sure the plain simple app works -> yarn make

  • OLDpackage.json : flatpak issue
  • package.json: snap multipass issue

Additional information

"@electron-forge/cli": "^6.0.0-beta.63",
"@electron-forge/maker-deb": "^6.0.0-beta.63",
"@electron-forge/maker-flatpak": "^6.0.0-beta.63",
"@electron-forge/maker-rpm": "^6.0.0-beta.63",
"@electron-forge/maker-snap": "^6.0.0-beta.63",
"@electron-forge/maker-squirrel": "^6.0.0-beta.63",
"@electron-forge/maker-zip": "^6.0.0-beta.63",
"@electron-forge/plugin-electronegativity": "^6.0.0-beta.63",
"@electron-forge/plugin-webpack": "6.0.0-beta.63",
@raphael10-collab raphael10-collab changed the title Error at /node_modules/@malept/flatpak-bundler/index.js:71:16 Error at /node_modules/@malept/flatpak-bundler/index.js:71:16 + Error at /node_modules/@malept/cross-spawn-promise/src/index.ts:172:16 Jun 6, 2022
@VerteDinde VerteDinde self-assigned this Jun 9, 2022
@VerteDinde VerteDinde changed the title Error at /node_modules/@malept/flatpak-bundler/index.js:71:16 + Error at /node_modules/@malept/cross-spawn-promise/src/index.ts:172:16 [flatpak/snap] Error when building flatpak and snap makers on Ubuntu 20.04 Jun 9, 2022
@VerteDinde
Copy link
Member

Hey @raphael10-collab, thanks for reporting this issue and sorry you're running into this! I'm not sure what's causing the flatpak failures, but I think the snap issue is the same one reported here: electron-userland/electron-installer-snap#83

I'll take a look at snap first and see if I can determine what's going on for you 🙇‍♀️ If you're blocked, there's a workaround mentioned in that issue that may at least get you unblocked while we solve this problem.

@VerteDinde
Copy link
Member

snap errors: This should be resolved in electron-installer-snap 5.20. See #144 in electron-snap-installer

flatpak errors: The root of these issues is that the remote endpoints for downloading several of the refs no longer exist. These remotes are referenced for the runtime, the sdk and the base. I'm putting up a PR to make sure those can be downloaded here ( flatpak-bundler ), but you can fix the error in the meantime by doing the following:

flatpak install flathub org.freedesktop.Sdk//19.08
flatpak install flathub org.freedesktop.Platform//19.08
flatpak install flathub org.electronjs.org.Electron2.BaseApp//stable

@raphael10-collab Let me know if the above solution for flatpak doesn't work for you and I'll re-open this!

@raphael10-collab
Copy link
Author

@VerteDinde what am I missing or doing wrong?

raphy@pc:~$ flatpak install flathub org.freedesktop.Sdk//19.08
Looking for matches…
error: No remote refs found similar to ‘flathub’
raphy@pc:~$ flatpak install flathub org.freedesktop.Platform//19.08
Looking for matches…
error: No remote refs found similar to ‘flathub’
raphy@pc:~$ flatpak install flathub org.electronjs.org.Electron2.BaseApp//stable
Looking for matches…
error: No remote refs found similar to ‘flathub’

in bashrc :

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

export PATH="$HOME/var/lib/flatpak/exports/share:$PATH"
export PATH="$HOME/home/raphy/.local/share/flatpak/exports/share:$PATH"

@VerteDinde
Copy link
Member

@raphael10-collab Make sure you have flathub installed - try this:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

@raphael10-collab
Copy link
Author

raphael10-collab commented Jul 28, 2022

@VerteDinde

raphy@pc:~$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

raphy@pc:~$ flatpak install flathub org.freedesktop.Sdk//19.08
Looking for matches…
Info: org.freedesktop.Sdk is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version
Info: org.freedesktop.Sdk.Locale is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version
Info: org.freedesktop.Platform.GL.default is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version


        ID                                                        Branch             Op             Remote             Download
 1. [✓] org.freedesktop.Platform.GL.default                       19.08              i              flathub             88,6 MB / 89,1 MB
 2. [✓] org.freedesktop.Platform.GL.nvidia-470-129-06             1.4                i              flathub            272,6 MB / 273,0 MB
 3. [✓] org.freedesktop.Platform.openh264                         2.0                i              flathub              1,5 MB / 1,5 MB
 4. [✓] org.freedesktop.Sdk.Locale                                19.08              i              flathub              3,2 MB / 322,4 MB
 5. [✓] org.gtk.Gtk3theme.Yaru-light                              3.22               i              flathub            136,2 kB / 191,5 kB
 6. [✓] org.freedesktop.Sdk                                       19.08              i              flathub            514,5 MB / 578,9 MB

Installation complete.

raphy@pc:~$ flatpak install flathub org.freedesktop.Platform//19.08
Looking for matches…
Info: org.freedesktop.Platform is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version
Info: org.freedesktop.Platform.Locale is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version
Info: org.freedesktop.Platform.GL.default is end-of-life, with reason: The Freedesktop SDK 19.08 runtime is no longer supported as of September 1, 2021. Please ask your application developer to migrate to a supported version


        ID                                        Branch           Op           Remote            Download
 1. [✓] org.freedesktop.Platform.Locale           19.08            i            flathub           20,0 kB / 318,3 MB
 2. [✓] org.freedesktop.Platform                  19.08            i            flathub           31,5 MB / 238,5 MB

Installation complete.

raphy@pc:~$ flatpak install flathub org.electronjs.org.Electron2.BaseApp//stable
Looking for matches…
error: Nothing matches org.electronjs.org.Electron2.BaseApp in remote flathub

In package.json :

  "makers": [
    {
      "name": "@electron-forge/maker-squirrel",
      "config": {
        "name": "forgetypescriptreactwebpack"
      }
    },
    {
      "name": "@electron-forge/maker-zip",
      "platforms": [
        "darwin"
      ]
    },
    {
      "name": "@electron-forge/maker-deb",
      "config": {
        "maintainer": "Raphael Stonehorse"
      }
    },
    {
      "name": "@electron-forge/maker-zip"
    },
    {
      "name": "@electron-forge/maker-rpm",
      "config": {}
    },
    {
      "name": "@electron-forge/maker-flatpak",
      "config": {}
    }

Output of the yarn make execution :

raphy@pc:~/FPlayground$ yarn make
yarn run v1.22.19
$ electron-forge make
✔ Checking your system
✔ Resolving Forge Config

An unhandled rejection has occurred inside Forge:
Error: Cannot make for flatpak, the following external binaries need to be installed: flatpak-builder, eu-strip

Electron Forge was terminated. Location:
{}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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

2 participants