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

Building for Linux Arm64 snap will fail #8167

Open
coreybruce opened this issue Apr 5, 2024 · 6 comments
Open

Building for Linux Arm64 snap will fail #8167

coreybruce opened this issue Apr 5, 2024 · 6 comments

Comments

@coreybruce
Copy link

coreybruce commented Apr 5, 2024

  • Electron-Builder Version:
    24.13.3
  • Node Version:
    v21.6.2

29.1.0

  • Target:
    Linux Arm64

When I build for Arm64 it will give a error failing to build for snap, I don't care about snaps and It still builds a appimage successfully but the warning and errors are annoying

x64 build log

./node_modules/.bin/electron-builder --linux --x64  

  • electron-builder  version=24.13.3 os=6.6.19-1-MANJARO
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=x64 electron=29.2.0 appOutDir=dist/linux-unpacked
  • building        target=snap arch=x64 file=dist/GoogleKeep_1.0.5_amd64.snap
  • building        target=AppImage arch=x64 file=dist/GoogleKeep-1.0.5.AppImage
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux

Arm64 build log

./node_modules/.bin/electron-builder --linux --arm64

  • electron-builder  version=24.13.3 os=6.6.19-1-MANJARO
  • writing effective config  file=dist/builder-effective-config.yaml
  • packaging       platform=linux arch=arm64 electron=29.2.0 appOutDir=dist/linux-arm64-unpacked
  • building        target=snap arch=arm64 file=dist/GoogleKeep_1.0.5_arm64.snap
  • building        target=AppImage arch=arm64 file=dist/GoogleKeep-1.0.5-arm64.AppImage
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  • application Linux category is set to default "Utility"  reason=linux.category is not set and cannot map from macOS docs=https://www.electron.build/configuration/linux
  ⨯ snapcraft is not installed, please: sudo snap install snapcraft --classic  
  ⨯ /home/corey/Stuff/git/GoogleKeep/application/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1  failedTask=build stackTrace=Error: /home/corey/Stuff/git/GoogleKeep/application/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/corey/Stuff/git/GoogleKeep/application/node_modules/builder-util/src/util.ts:252:14)
    at Object.onceWrapper (node:events:634:26)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
@coreybruce coreybruce changed the title Building for Linux Arm64 will try and build snap when it shouldn't Building for Linux Arm64 snap will fail Apr 5, 2024
@mmaietta
Copy link
Collaborator

mmaietta commented Apr 5, 2024

This is why it's failing.
snapcraft is not installed, please: sudo snap install snapcraft --classic
snapcraft is a huge package and is why it's not installed in the base docker image by default. You'll need to install it locally

@mmaietta mmaietta closed this as completed Apr 5, 2024
@coreybruce
Copy link
Author

coreybruce commented Apr 6, 2024

This is why it's failing. snapcraft is not installed, please: sudo snap install snapcraft --classic snapcraft is a huge package and is why it's not installed in the base docker image by default. You'll need to install it locally

Sorry but why did you close this? did you look at my logs at all? you can clearly see the difference between the log building x64 and Arm64..

I never told it to do snap on either of them and when I told it to do x64 it didn't do snap nor did it give me the error but as soon as I did Arm64 it tried to do snap and gave me that error even tho I never told it to do a snap package

I never said I was even using a docker container, please re open this issue and read the issue post.

@mmaietta mmaietta reopened this Apr 8, 2024
@mmaietta
Copy link
Collaborator

mmaietta commented Apr 8, 2024

Apologies. Can you please post your full electron-builder config file, your build command w/ args, and/or a minimum reproducible repo that I can investigate further with? Not sure why yours is building snap if you're not specifically requesting it via config.

@coreybruce
Copy link
Author

coreybruce commented Apr 9, 2024

I'm actually not using a electron-builder config file but here is a example of one of my package.json files

{
  "name": "Youtube",
  "version": "1.1.1",
  "pkgrel": "3",
  "description": "Youtube desktop app",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  },
  "repository": "",
  "keywords": [
    "Youtube"
  ],
  "author": "Corey Bruce",
  "license": "GPL",
  "devDependencies": {
    "electron": "^29.1.0",
    "electron-builder": "^24.13.3",
    "electron-packager": "^17.1.2"
  },
  "dependencies": {
    "electron-context-menu": "^3.6.1"
  }
}

Not sure why it tries to build a snap package when I tell it to do arm64 but not x64 I'm sure we can figure out the bug

@mmaietta
Copy link
Collaborator

mmaietta commented Apr 9, 2024

Having an electron-builder config in your package.json would probably help significantly. What's your build command though? I don't see anything in the scripts for electron-builder.

The default targets for linux include snap

get defaultTarget(): Array<string> {
return ["snap", "appimage"]
}

@coreybruce
Copy link
Author

Yeh but I don't need a electron-builder config

The default targets for linux include snap

But it doesn't give this error when building for x64 and only Arm64, why is it different between the two architectures and give this error for Arm64 but doesn't on x64 when I don't have the snap packages and don't want to build for snap??

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

No branches or pull requests

2 participants