electron-userland / electron-installer-snap Goto Github PK
View Code? Open in Web Editor NEWBuild Snap packages for Electron applications
License: Apache License 2.0
Build Snap packages for Electron applications
License: Apache License 2.0
Hey,
I am trying to build a snap on Ubuntu and am running into a problem. I tried using electron-installer-snap
both as the standalone version, as well as part of Electron Forge. I am running into the exact same issue with the module, possibly conflicting with the module cross-spawn-promise
.
Here's the console output:
electron-installer-snap --src=build/TestApp-linux-x64
Snapcraft failed (2)
Re-run with the environment variable DEBUG=electron-installer-snap:snapcraft for details.
(node:16964) UnhandledPromiseRejectionWarning: Error: Exited with status 2
at closeArgsToError (/home/meh/Documents/Projects/TestApp/node_modules/cross-spawn-promise/lib/index.js:20:16)
at ChildProcess.<anonymous> (/home/meh/Documents/Projects/TestApp/node_modules/cross-spawn-promise/lib/index.js:76:19)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
(node:16964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:16964) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handledwill terminate the Node.js process with a non-zero exit code.```
I am unaware as to how to address this issue. Please suggest how this problem can be fixed, or if there is a workaround. Thank you!
inb4 sorry for not following the issue template, but it's not necessarily an issue, just discussion
How to use this package in 2024?
found errors in file output: unusual mode 'rwsr-xr-x' for entry './project-name/chrome-sandbox' security-snap-v2_squashfs_files
I see a bunch of issues and PRs related to topic of sandboxing issues, it seems to be merged, but it doesn't work (at lest now), an no one ever in the comments confirmed it did, not even a single thumb up.
Is topic publishing app for Linux that niche, that no one care whether it works or not?
Is there some other user friendly (which means I don't have to get master degree in snapcraft.yaml to make a snap) way to publish Electron app as a Snap package or do I really have to do it like VS Code and handle everything manually, since no one maintains it anymore?
Please describe your issue:
I am trying to convert my Electron app that was built by electron-packager on Linux x64, but it fails.
Console output when you run electron-installer-snap with the environment variable DEBUG='electron-installer-snap:*'
. Please include the stack trace if one exists.
codey@codey:~/Desktop/electronpw/PenguinWorld-linux-x64$ npx electron-installer-snap DEBUG='electron-installer-snap:*'
npx: installed 76 in 4.627s
Cloning into '/tmp/electron-snap-307026TRYHqIGjFtT/parts/desktop-gtk3/src'...
remote: Enumerating objects: 37, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 1387 (delta 9), reused 20 (delta 2), pack-reused 1350
Receiving objects: 100% (1387/1387), 261.40 KiB | 966.00 KiB/s, done.
Resolving deltas: 100% (715/715), done.
(node:30702) UnhandledPromiseRejectionWarning: Error: Exited with status 2
at closeArgsToError (/home/codey/.npm/_npx/30702/lib/node_modules/electron-installer-snap/node_modules/cross-spawn-promise/lib/index.js:20:16)
at ChildProcess.<anonymous> (/home/codey/.npm/_npx/30702/lib/node_modules/electron-installer-snap/node_modules/cross-spawn-promise/lib/index.js:76:19)
at Object.onceWrapper (events.js:277:13)
at ChildProcess.emit (events.js:189:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
(node:30702) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:30702) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the snap()
function?
npx electron-installer-snap
in the packaged directory
Am I missing or not doing something correctly?
Builds the {app's name}.snap in out/make/snap/x64.
I've configured build to .deb, zip and snap. They build sucefully except snap, which gives this error:
✖ 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):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/user/app/out/make/snap/x64/app_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/user/app/out/make/snap/x64/app_1.0.0_amd64.snap
at ChildProcess.<anonymous> (/home/user/app/node_modules/@malept/cross-spawn-promise/src/index.ts:155:16)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
As you see, this error says nothing.
I know it seems fixed in electron/forge#1531, but snapcraft apt package has been depercated (maybe because it now uses Multipass snap).
Repo:
https://github.com/humanoide123/app
Clone, yarn install and yarn run make (or do the same with npm)
Manual:
yarn create electron-app app-name --template=typescript-webpack
(I'm using yarn, but guess it's not important)@electron-forge/maker-snap
as devDependency (yarn add -D @electron-forge/maker-snap
)package.json
:{
name: '@electron-forge/maker-snap'
config: {
summary: 'Pretty Awesome'
}
}
yarn run make
or node_modules/bin/electron-forge make
Making for target: snap - On platform: linux - For arch: x64An error occurred with the instance when trying to delete 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):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/user/app/out/make/snap/x64/app_1.0.0_amd64.snap
Error: Command failed with a non-zero return code (2):
/snap/bin/snapcraft snap --target-arch=amd64 --output=/home/user/app/out/make/snap/x64/app_1.0.0_amd64.snap
at ChildProcess.<anonymous> (/home/user/app/node_modules/@malept/cross-spawn-promise/src/index.ts:155:16)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.EventEmitter.emit (domain.js:482:12)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
It seems not important except for the message "An error ocurred with the instance... Ensure that Multipass is setup correctly and try again". Seems like a problem when invoking Multipass (i've already used snapcraft on another project, so I'm sure Multipass problem is not mine)
"forge": {
"packagerConfig": {
"executableName": "app"
},
{
"name": "@electron-forge/maker-zip",
"platforms": [
"darwin",
"linux"
]
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-snap",
"config": {
"summary": "lorem ipsum dominum"
}
}
],
"plugins": [
[
"@electron-forge/plugin-webpack",
{
"mainConfig": "./webpack.main.config.js",
"renderer": {
"config": "./webpack.renderer.config.js",
"entryPoints": [
{
"html": "./src/index.html",
"js": "./src/renderer.ts",
"name": "main_window"
}
]
}
}
]
]
}
Please describe your issue:
Hello!
As the title says snapcraft is unable to resolve absolute paths when trying to build a snap with lxd as provider.
I am building the electorn app using github actions, where kvm and multipass are unavailable, so i'm setting lxd as a provider like this:
- name: Install Snapcraft
if: matrix.os.name == 'linux'
run: |
sudo snap install snapcraft --classic
echo /snap/bin >> $GITHUB_PATH
sudo /snap/bin/lxd waitready
sudo /snap/bin/lxd init --auto
sudo snap set lxd daemon.group=adm
sudo snap restart lxd
sudo snap set snapcraft provider=lxd
sudo iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o lxdbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
Then I run yarn publish
in my electron.forge app.
What happens next is snapcraft is resolving the absolute path of the source /home/user/app/out/
relative to the tmp directory created by this package. This also applies to the --output flag.
I created a patch for myself where i copy the source to the tmp directory and provide the relative path to snapcraft.
The output is also set to the tmp directory and then i copy it back to my project.
Here is the patch:
diff --git a/src/index.js b/src/index.js
index a6d50fa2acb44a7356c8a74797dd8ca89956c774..5b33c83bfe5238c5ed2f158ed18341d34f0cb3aa 100644
--- a/src/index.js
+++ b/src/index.js
@@ -92,7 +92,20 @@ class SnapCreator {
await copyLauncher(snapDir, this.config)
await createYamlFromTemplate(snapDir, this.packageDir, this.config)
await copyHooks(snapMetaDir, this.config)
- await this.snapcraft.run(snapDir, 'snap', this.snapcraftOptions)
+
+ await fs.copy(path.dirname(this.packageDir), path.join(snapDir, 'out'), {
+ recursive: true,
+ });
+
+ await fs.ensureDir(path.join(snapDir, 'make'));
+
+ await this.snapcraft.run(snapDir, 'snap', {
+ ...this.snapcraftOptions,
+ output: 'make/snap.build',
+ })
+
+ await fs.copy(path.join(snapDir, 'make', 'snap.build'), this.snapcraftOptions.output);
+
return this.snapDestPath
}
diff --git a/src/yaml.js b/src/yaml.js
index a71ea23724230c30f535460b9829f36c06b89514..7f3f2deccddd23a81d284c67d7ffd6462499df42 100644
--- a/src/yaml.js
+++ b/src/yaml.js
@@ -193,7 +193,7 @@ class SnapcraftYAML {
}
transformParts (packageDir) {
- this.parts.source = path.dirname(packageDir)
+ this.parts.source = 'out';
this.parts.organize = {}
this.parts.organize[path.basename(packageDir)] = this.data.name
Console output when you run electron-installer-snap with the environment variable DEBUG='electron-installer-snap:*'
. Please include the stack trace if one exists.
The first error i encountered was that snapcraft required multipass to be installed, which is not possible in a github action. It is fixed by setting lxd as provider as seen above (it might be nice to add it to some docs because I lost a lot of time trying to set it up)
Afterwards snapcraft was unable to determine the source-type of the source (because it couldn't resolve the directory). If source-type was then set to local it complained that the source is not a directory.
With the patch i provided above everything is working as expected.
Put the console output here
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the snap()
function?
I used @electron-forge/maker-snap
and the javascript api ofelectron-installer-snap
directly.
Put the arguments or parameters here
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.
Please describe your issue:
Thanks for this work! Setting it up takes some investment, but it should pay off for the automation.
Building my Electron Forge app on Ubuntu 18.04 worked fine with "devmode"
, but when I tried using { "confinement": "classic" }
, snapcraft
exited with an error.
Console output when you run electron-installer-snap with the environment variable DEBUG='electron-installer-snap:*'
. Please include the stack trace if one exists.
Everything looked good (sorry, I don't have the logs right now but will post later if you need them) until:
Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
File "/usr/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft==2.43.1+18.4.1', 'console_scripts', 'snapcraft')()
File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 136, in snap
project = _execute(steps.PRIME, parts=[], **kwargs)
File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute
lifecycle.execute(step, project_config, parts)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute
executor.run(step, part_names)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run
self._create_meta(step, processed_part_names)
File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 359, in _create_meta
self.config.validator.schema,
File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 109, in create_snap_packaging
packaging.write_snap_yaml()
File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 313, in write_snap_yaml
snap_yaml = self._compose_snap_yaml()
File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 517, in _compose_snap_yaml
snap_yaml["apps"] = self._wrap_apps(self._config_data["apps"])
File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 624, in _wrap_apps
self._wrap_app(app, apps[app])
File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 632, in _wrap_app
app[k] = self._wrap_exe(app[k], "{}-{}".format(k, name))
File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 603, in _wrap_exe
with open(exepath, "rb") as exefile:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/electron-snap-6898rPhJrY5qIgxl/prime/bin/electron-launch'
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the snap()
function?
{ "confinement": "classic" }
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.
Adding the following part to the generated snapcraft.yaml
,
parts:
electron-launch:
plugin: dump
source: ./bin
organize:
electron-launch: bin/electron-launch
and rerunning:
/usr/bin/snapcraft snap --target-arch=amd64 --output=/media/psf/Home/agoric/Pledger-u18/packages/app-electron/out/make/snap/x64/pledger_0.2.0_amd64.snap
made things work just fine. I suspect that the electron-launch
part just needs to be turned on for "classic"
confinement, but I don't know the best way to do that in the code.
I just published it to my private repo and it worked. So I guess a version bump and a republish will do the trick.
Please describe your issue:
Question about the following DEBUG output:
Native builds aren't supported on Raspbian GNU/Linux. You can however use 'snapcraft cleanbuild' with a container.
I would like to create a snap of an Electron App that I have been successful packaging and distributing as a .deb. So far, I have been packaging and making this successfully in the environment that the package is targeted at. The app is a purpose built IoT app and will only ever be distributed on the same architecture as the build environment (armv7L).
I've successfully installed snapd and lxd on the build environment and I am able to create lxc with no problems.
I got this error message in the debug output after running 'npm run make' which uses electron-forge make configured for 'snap' as the make target.
I would like help or perhaps a little bit of guidance on what steps I would likely need to do next in order to get this snap created. I've read lots of documentation on snapcraft and lxd. I will likely be placing this build process into a CI/CD cloud solution, so it seems like I may need to go ahead and create an LXD on the build server from an armv7L architecture.
From there, I am not sure where to go. Is this something I can configure in Electron-Forge? Will I still be able to initialize making with npm?
Thanks in advance for any additional guidance, links, instructions or help you may offer.
Console output when you run electron-packager with the environment variable DEBUG='electron-forge:*'
. Please include the stack trace if one exists.
pi@raspberrypi:~/RebelSyntax/dev $ npm run make
> [email protected] make /home/pi/RebelSyntax/dev
> DEBUG=electron-forge:* electron-forge make
WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle
electron-forge:lifecycle Process Started: Checking your system +0ms
electron-forge:lifecycle Process Succeeded: Checking your system +1s
electron-forge:runtime-config setting key: verbose to value: false +0ms
WARNING: DEBUG environment variable detected. Progress indicators will be sent over electron-forge:lifecycle
electron-forge:lifecycle Process Started: Resolving Forge Config +0ms
electron-forge:project-resolver searching for project in: /home/pi/RebelSyntax/dev +0ms
electron-forge:project-resolver electron-forge compatible package.json found in /home/pi/RebelSyntax/dev/package.json +32ms
electron-forge:lifecycle Process Succeeded: Resolving Forge Config +58ms
electron-forge:require-search searching [ '../makers/linux/snap.js',
'../makers/generic/snap.js',
'electron-forge-maker-snap',
'snap',
'/home/pi/RebelSyntax/dev/snap',
'/home/pi/RebelSyntax/dev/node_modules/snap',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/makers/linux/snap.js',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/makers/generic/snap.js',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api/electron-forge-maker-snap',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api/snap',
'/home/pi/RebelSyntax/dev/snap',
'/home/pi/RebelSyntax/dev/node_modules/snap',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api/makers/linux/snap.js',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api/makers/generic/snap.js',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api/node_modules/electron-forge-maker-snap',
'/home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api/node_modules/snap',
'/home/pi/RebelSyntax/dev/snap',
'/home/pi/RebelSyntax/dev/node_modules/snap' ] relative to /home/pi/RebelSyntax/dev/node_modules/electron-forge/dist/api +0ms
electron-forge:require-search testing ../makers/linux/snap.js +13ms
We need to package your application before we can make it
electron-forge:lifecycle Process Started: Preparing to Package Application for arch: armv7l +59ms
electron-forge:project-resolver searching for project in: /home/pi/RebelSyntax/dev +82ms
electron-forge:project-resolver electron-forge compatible package.json found in /home/pi/RebelSyntax/dev/package.json +3ms
electron-forge:hook could not find hook: generateAssets +0ms
electron-forge:hook could not find hook: prePackage +1ms
electron-forge:packager packaging with options { asar: true,
overwrite: true,
packageManager: 'npm',
afterCopy: [ [Function] ],
afterExtract: [ [Function] ],
afterPrune: [ [Function] ],
dir: '/home/pi/RebelSyntax/dev',
arch: 'armv7l',
platform: 'linux',
out: '/home/pi/RebelSyntax/dev/out',
electronVersion: '1.7.11',
quiet: true } +0ms
electron-forge:lifecycle Process Succeeded: Preparing to Package Application for arch: armv7l +2m
electron-forge:lifecycle Process Started: Compiling Application +2ms
electron-forge:lifecycle Process Succeeded: Compiling Application +7s
electron-forge:lifecycle Process Started: Preparing native dependencies +56s
electron-forge:lifecycle Process Succeeded: Preparing native dependencies +57s
electron-forge:lifecycle Process Started: Packaging Application +1ms
electron-forge:hook could not find hook: postPackage +5m
electron-forge:lifecycle Process Succeeded: Packaging Application +47s
Making for the following targets:
electron-forge:hook could not find hook: preMake +3ms
electron-forge:lifecycle Process Started: Making for target: snap - On platform: linux - For arch: armv7l +5ms
Snapcraft failed (2)
Re-run with the environment variable DEBUG=electron-installer-snap:snapcraft for details.
electron-forge:lifecycle Process Failed: Making for target: snap - On platform: linux - For arch: armv7l +9s
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Exited with status 2
Error: Exited with status 2
at closeArgsToError (/home/pi/RebelSyntax/dev/node_modules/cross-spawn-promise/lib/index.js:20:16)
at ChildProcess.<anonymous> (/home/pi/RebelSyntax/dev/node_modules/cross-spawn-promise/lib/index.js:76:19)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: `DEBUG=electron-forge:* electron-forge make`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2018-03-29T14_48_09_435Z-debug.log
pi@raspberrypi:~/RebelSyntax/dev $ npm run make
> [email protected] make /home/pi/RebelSyntax/dev
> DEBUG=electron-installer-snap:* electron-forge make
✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: armv7l
✔ Compiling Application
✔ Preparing native dependencies: 2 / 2
✔ Packaging Application
Making for the following targets:
⠙ Making for target: snap - On platform: linux - For arch: armv7l electron-installer-snap:default_args Loading package.json defaults from /home/pi/RebelSyntax/dev/out/RebelSyntax-linux-armv7l/resources/app.asar +0ms
⠹ Making for target: snap - On platform: linux - For arch: armv7l electron-installer-snap:yaml Loading YAML template /home/pi/RebelSyntax/dev/node_modules/electron-installer-snap/resources/snapcraft.yaml +0ms
electron-installer-snap:yaml Writing new YAML file /tmp/electron-snap-63124pKJzFtyUAAj/snap/snapcraft.yaml +35ms
⠸ Making for target: snap - On platform: linux - For arch: armv7l electron-installer-snap:snapcraft Running '/snap/bin/snapcraft snap --target-arch=armhf --output=/home/pi/RebelSyntax/dev/out/make/IoT-App_1.1.0_armhf.snap' in /tmp/electron-snap-63124pKJzFtyUAAj +0ms
⠼ Making for target: snap - On platform: linux - For arch: armv7lSetting target machine to 'armhf'
⠴ Making for target: snap - On platform: linux - For arch: armv7lNative builds aren't supported on Raspbian GNU/Linux. You can however use 'snapcraft cleanbuild' with a container.
⠇ Making for target: snap - On platform: linux - For arch: armv7lSnapcraft failed (2)
✖ Making for target: snap - On platform: linux - For arch: armv7l
An unhandled error has occurred inside Forge:
An error occured while making for target: snap
Exited with status 2
Error: Exited with status 2
at closeArgsToError (/home/pi/RebelSyntax/dev/node_modules/cross-spawn-promise/lib/index.js:20:16)
at ChildProcess.<anonymous> (/home/pi/RebelSyntax/dev/node_modules/cross-spawn-promise/lib/index.js:76:19)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] make: `DEBUG=electron-installer-snap:* electron-forge make`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2018-03-29T14_36_51_962Z-debug.log
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the snap()
function?
None
Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.
I will take the time to create a repro if it's really needed. I think in this case, the formality will not be necessary since that is question and not a bug report. Thanks!
I opened an issue here electron/forge#1678 but perhaps this repo is the more appropriate place for it. When I build snapcraft builds and upload them to the Snap Store, I always get auto rejected with the following error:
checksums do not match. Please ensure the snap is created with either 'snapcraft pack <DIR>' (using snapcraft >= 2.38) or 'mksquashfs <dir> <snap> -noappend -comp xz -all-root -no-xattrs -no-fragments'.
If using electron-builder, please upgrade to latest stable (>= 20.14.7). See https://forum.snapcraft.io/t/automated-reviews-and-snapcraft-2-38/4982/17 for details.
security-snap-v2_squashfs_repack_checksum What does this mean?
found errors in file output: unusual mode 'rwsr-xr-x' for entry './swach/chrome-sandbox' security-snap-v2_squashfs_files
human review required due to 'deny-connection' constraint (interface attributes). If using a chromium webview, you can disable the internal sandbox (eg, use --no-sandbox) and remove the 'allow-sandbox' attribute instead.
For QtWebEngine webviews, export QTWEBENGINE_DISABLE_SANDBOX=1 to disable its internal sandbox.
declaration-snap-v2_plugs_connection (browser-sandbox, browser-support)
I see browserSandbox
is turned on by default when on Electron >= 5.0.0, but this error message sounds like we should be disabling the sandbox and instead using confinement
. I have tried adding --no-sandbox
to my electron app's args and setting browserSandbox: false
but the error still persists.
Any tips on fixing this problem or is there no possible way to build an Electron app for Snap that does not need manual review?
Layouts are a feature for strictly confined snaps that modify the execution environment.
With layouts, you can make elements in $SNAP, $SNAP_DATA, $SNAP_COMMON accessible from locations such as /usr, /var and /etc. This helps when using pre-compiled binaries and libraries that expect to find files and directories outside of locations referenced by $SNAP or $SNAP_DATA.
Given our existing support for custom plugs and slots, we can use a similar framework to optionally add layouts if they are provided by the user. Layouts do not need to be included by default.
Layouts are only supported on core18 and higher.
defaultArgsFromApp
returns a Promise and we're not using async/await.
From #1.
Please describe your issue:
Config, note already install @electron-forge/maker-snap.
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-snap",
"config": {
"name": "testing"
}
},
{
"name": "@electron-forge/maker-deb",
"config": {}
}
]
}
}
Console output when you run electron-packager with the environment variable DEBUG='electron-forge:*'
. Please include the stack trace if one exists.
> electron-forge make
✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: x64
✔ Preparing native dependencies
✔ Packaging Application
Making for the following targets: snap, deb
⠋ 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: x64Cloning into '/tmp/electron-snap-118146s11f3JFNyOr/parts/desktop-gtk3/src'...
⠸ Making for target: snap - On platform: linux - For arch: x64remote: Enumerating objects: 33, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (23/23), done. h: x64remote: Compressing objects: 30% (7/23)
remote: Total 1334 (delta 11), reused 23 (delta 9), pack-reused 1301
Receiving objects: 100% (1334/1334), 241.65 KiB | 4.74 MiB/s, done.
Resolving deltas: 100% (690/690), done.
⠸ Making for target: snap - On platform: linux - For arch: x64Snapcraft failed (2)
Re-run with the environment variable DEBUG=electron-installer-snap:snapcraft for details.
✖ 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
Exited with status 2
Error: Exited with status 2
at closeArgsToError (/home/andres/testing/node_modules/cross-spawn-promise/lib/index.js:12:17)
at ChildProcess.closeArgsToError (/home/andres/testing/node_modules/cross-spawn-promise/lib/index.js:66:21)
at Object.onceWrapper (events.js:317:30)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
npm ERR! Linux 4.15.0-1030-gcp
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "make"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] make: `electron-forge make`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] make script 'electron-forge make'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the testing package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron-forge make
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs testing
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls testing
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/andres/testing/npm-debug.log
What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the snap()
function?
npm run make
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.