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

AppImage build seems corrupted #6624

Closed
mscharley opened this issue Feb 8, 2022 · 11 comments
Closed

AppImage build seems corrupted #6624

mscharley opened this issue Feb 8, 2022 · 11 comments

Comments

@mscharley
Copy link

  • Electron-Builder Version: 23.0.0-alpha.2
  • Node Version: 16.13.1
  • Electron Version: 17.0.0
  • Electron Type (current, beta, nightly): current
  • Target: AppImage

I'm using the alpha version because I was running into #6563 .

This seems to be an issue with electron 17.x, if I roll back to 16.0.8 then it builds and runs fine. I'm building on Arch Linux targeting AppImage. The build runs fine, but when I try to run it I get the following output:

$ electron-builder --publish never

  • electron-builder  version=23.0.0-alpha.2 os=5.15.19-1-lts
  • loaded configuration  file=/home/mscharley/Code/mscharley/app/electron-builder.yml
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=x64 electron=17.0.0 appOutDir=dist/linux-unpacked
  • building        target=AppImage arch=x64 file=dist/app-0.1.0.AppImage
  • default Electron icon is used  reason=application icon is not set

$ ./dist/app-0.1.0.AppImage
Squashfs image uses (null) compression, this version supports only xz, zlib.

Cannot mount AppImage, please check your FUSE setup.
You might still be able to extract the contents of this AppImage
if you run it with the --appimage-extract option.
See https://github.com/AppImage/AppImageKit/wiki/FUSE
for more information
open dir error: No such file or directory
@mmaietta
Copy link
Collaborator

mmaietta commented Feb 9, 2022

Could you please post your snap configuration for electron-builder?

We upgraded to enable lzo compression for snap as the default in #6201
In your snap options, try setting compression: 'xz'

@mscharley
Copy link
Author

No change with the compression option added.

My build-effective-config.yaml:

directories:
  output: dist
  buildResources: build
appId: com.github.mscharley.app
files:
  - filter:
      - '**/*'
      - '!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}'
      - '!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}'
      - '!**/node_modules/*.d.ts'
      - '!**/node_modules/.bin'
      - '!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}'
      - '!.editorconfig'
      - '!**/._*'
      - '!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}'
      - '!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}'
      - '!**/{appveyor.yml,.travis.yml,circle.yml}'
      - '!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}'
linux:
  target: AppImage
  category: Utility
snap:
  compression: "xz"
publish:
  - github
electronVersion: 17.0.0

@mmaietta
Copy link
Collaborator

mmaietta commented Feb 9, 2022

Whoops. Maybe compression: xz is supposed to be under linux? It's a stab in the dark as I haven't used it before

@mscharley
Copy link
Author

I tried under both linux and appImage top level and they both failed the configuration validation and didn't even try to build. Based on the PR you linked above, that's a feature of snap, why would it apply to appimages?

@mscharley
Copy link
Author

Still an issue with the final release of electron-builder 23.0.0 when building against either electron 17.0.1 or 16.0.9.

@mscharley
Copy link
Author

Adding this to the top level gets a working build as it triggers xz encryption:

compression: maximum

But the resulting build is prohibitively slow to run. Neither of the other two valid top level values (normal and store) produce a valid build.

@mscharley
Copy link
Author

I've tried hacking around in node_modules a bit, but I can't seem to find a valid else case for this, which seems to be the root cause: https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/src/targets/AppImageTarget.ts#L90-L92

Either I try lzo and get the following build error:

  ⨯ enum value must be one of xz,gzip, got 'lzo'
  ⨯ /home/mscharley/Code/mscharley/notes-nc/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=build stackTrace=Error: /home/mscharley/Code/mscharley/app/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR
_ELECTRON_BUILDER_CANNOT_EXECUTE

Or I try gzip and I get the following build error:

  ⨯ cannot execute  cause=exit status 1
                    errorOut=/home/mscharley/.cache/electron-builder/appimage/appimage-13.0.0/linux-x64/mksquashfs: Compressor "gzip" is not suppor
ted!
    /home/mscharley/.cache/electron-builder/appimage/appimage-13.0.0/linux-x64/mksquashfs: Compressors available:
        lzo
        xz
        zstd (default)

                    command=/home/mscharley/.cache/electron-builder/appimage/appimage-13.0.0/linux-x64/mksquashfs /home/mscharley/Code/mscharley/not
es-nc/dist/__appImage-x64 /home/mscharley/Code/mscharley/notes-nc/dist/notes-nc-0.1.0.AppImage -offset 189632 -all-root -noappend -no-progress -qui
et -no-xattrs -no-fragments -comp gzip
                    workingDir=/home/mscharley/Code/mscharley/notes-nc/dist/__appImage-x64

The current version which specifies no encryption option generates the broken build.

@mmaietta
Copy link
Collaborator

I'm wondering if compression is no longer optional param. Could you give this patch a try using patch-package? That should unblock you for the interim

app-builder-lib+23.0.1.patch

diff --git a/node_modules/app-builder-lib/out/targets/AppImageTarget.js b/node_modules/app-builder-lib/out/targets/AppImageTarget.js
index 31344b3..0be0fe4 100644
--- a/node_modules/app-builder-lib/out/targets/AppImageTarget.js
+++ b/node_modules/app-builder-lib/out/targets/AppImageTarget.js
@@ -75,13 +75,12 @@ class AppImageTarget extends core_1.Target {
                 fileAssociations: this.packager.fileAssociations,
                 ...options,
             }),
+            "--compression",
+            packager.compression === "maximum" ? "xz" : "zlib",
         ];
         appBuilder_1.objectToArgs(args, {
             license,
         });
-        if (packager.compression === "maximum") {
-            args.push("--compression", "xz");
-        }
         await packager.info.callArtifactBuildCompleted({
             file: artifactPath,
             safeArtifactName: packager.computeSafeArtifactName(artifactName, "AppImage", arch, false),

@mscharley
Copy link
Author

mscharley commented Feb 28, 2022

@mmaietta using that patch:

> electron-builder --publish never

  • electron-builder  version=23.0.1 os=5.15.24-1-lts
  • loaded configuration  file=/home/mscharley/Code/mscharley/notes-nc/electron-builder.yml
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=x64 electron=17.1.0 appOutDir=dist/linux-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v17.1.0/electron-v17.1.0-linux-x64.zip size=99 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v17.1.0/electron-v17.1.0-linux-x64.zip duration=10.948s
  • building        target=AppImage arch=x64 file=dist/notes-nc-0.1.0.AppImage
  • default Electron icon is used  reason=application icon is not set
  ⨯ enum value must be one of xz,gzip, got 'zlib'
  ⨯ /home/mscharley/Code/mscharley/notes-nc/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=build stackTrace=Error: /home/mscharley/Code/mscharley/notes-nc/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

See my comment above where I already tried various values for the compression option. It looks like app-builder-bin and appimage seem to disagree on what the valid values for that option are.

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 2, 2022

Closing as duplicate of #6678 to consolidate convos

@Nantris
Copy link

Nantris commented Mar 2, 2022

@mmaietta I think you forgot to hit close on that comment.

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

3 participants