You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the Code of Conduct that this project adheres to.
I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
I have the Electron in Snap package with classic confinement. When I create an input type file and select a file which has non-ASCII characters inside its name, the whole Electron crashes.
Electron Version:
5.0.9, 6.0.2
Operating System:
Ubuntu 18.04
Last Known Working Electron version:
3.1.12
Expected Behavior
Electron should be able to pick a file with any name.
It looks like something in $SNAP/desktop-common.sh is causing this while it's a classic snap. When the sample above is built as a strict snap, it does not exhibit this issue.
However, as a classic snap, the environment setup by the desktop-init.sh, desktop-common.sh and desktop-gnome-specification.sh scripts appear to cause a conflict between the GTK libraries / environment inside the $SNAP and that outside on the host.
To prove, build the snap, but rather than install it, unpack it and use snap try to "install" the directory as a snap.
Re-run the snap (no need to remove/reinstall or rebuild as with snap try you're editing the files "inside" the snap live). Now the snap works fine, as expected.
Not a solution, but it does point the finger at the scripts used to setup the environment.
LOCPATH causes the system to not use the locale-archive, and instead search out the data files (in my case: /usr/lib/locale/en_US.utf8/LC_* - which is only present if locales-all is installed and the archive is not used.
Otherwise, outputpath is the name of a locale and the compiled
locale data is added to the archive file /usr/lib/locale/locale-
archive. A locale archive is a memory-mapped file which contains
all the system-provided locales; it is used by all localized
programs when the environment variable LOCPATH is not set.
For reference, I do believe the following launcher may be more appropriate for electron-based classic snaps: https://github.com/microsoft/vscode/blob/master/resources/linux/snap/electron-launch
From the Canonical folks' discussion above between @popey, @sergiusens, and @cjp256, it sounds like this issue should be closed in this tracker as a Snappy issue rather than an Electron one. Nice triage work, Canonical.
Activity
popey commentedon Aug 19, 2019
It looks like something in
$SNAP/desktop-common.shis causing this while it's a classic snap. When the sample above is built as astrictsnap, it does not exhibit this issue.However, as a classic snap, the environment setup by the
desktop-init.sh,desktop-common.shanddesktop-gnome-specification.shscripts appear to cause a conflict between the GTK libraries / environment inside the$SNAPand that outside on the host.To prove, build the snap, but rather than install it, unpack it and use
snap tryto "install" the directory as a snap.Remove the snap
$ snap remove electron-quick-startUnsquash the snap
$ unsquashfs electron-quick-start_1.0.0_amd64.snap"Install" the snap from the directory
$ snap install ./squashfs-root/ --classicObserve the command chain
Running the application with
snap run electron-quick-startand choosing a file with non-ASCII name fails as expected.Remove launcher script to test
Edit
./squashfs-root/command.shto remove"$SNAP/desktop-common.sh"and"$SNAP/desktop-gnome-specific.sh"from the command chain.Re-run the snap (no need to remove/reinstall or rebuild as with
snap tryyou're editing the files "inside" the snap live). Now the snap works fine, as expected.Not a solution, but it does point the finger at the scripts used to setup the environment.
sergiusens commentedon Aug 20, 2019
When using classic, most of the scripted logic in these parts should not be used as they will clash with what is on the system
cjp256 commentedon Aug 20, 2019
As @sergiusens pointed out, these scripts weren't meant to be used with the classic builds.
FWICT, what's happening here is LOCPATH is being set to
/usr/share/locale. Note the comment above that suggests all locales needing to be installed:https://github.com/develar/app-builder/blob/master/pkg/package-format/snap/desktop-scripts/desktop-common.sh#L150
I reproduce the behavior of this ticket if I do not have locales-all installed. Once I install it, behavior is as expected.
cjp256 commentedon Aug 21, 2019
LOCPATH causes the system to not use the locale-archive, and instead search out the data files (in my case:
/usr/lib/locale/en_US.utf8/LC_*- which is only present if locales-all is installed and the archive is not used.from http://man7.org/linux/man-pages/man1/localedef.1.html
cjp256 commentedon Aug 21, 2019
For reference, I do believe the following launcher may be more appropriate for electron-based classic snaps:
https://github.com/microsoft/vscode/blob/master/resources/linux/snap/electron-launchckerr commentedon Aug 30, 2019
From the Canonical folks' discussion above between @popey, @sergiusens, and @cjp256, it sounds like this issue should be closed in this tracker as a Snappy issue rather than an Electron one. Nice triage work, Canonical.
cjp256 commentedon Aug 31, 2019
@ckerr It's a combination of electron-builder and its usage of app-builder(-lib), and the process used to generate the pre-built template tarball found @ https://github.com/electron-userland/electron-builder-binaries/releases/tag/snap-template-4.0-2 . The pre-built template tarball appears to be built for use with strict snaps, yet is being used with classic snaps as is done in this case.
Perhaps @develar can point us at the right direction as to where exactly this would be ideally filed and how best appropriate to handle this? :)