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: illegal hardware instruction #217

Open
3 tasks done
mrusme opened this issue Aug 24, 2023 · 12 comments
Open
3 tasks done

AppImage: illegal hardware instruction #217

mrusme opened this issue Aug 24, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@mrusme
Copy link

mrusme commented Aug 24, 2023

Have you read a contributing guide?

  • I have read CONTRIBUTING.md
  • I have searched the existing issues and didn't find any that were similar
  • I have considered creating a pull request with fixes instead of a bug report and want to proceed

Current Behavior

Running the AppImage (compiled on my own, and the official download) leads to the following command line output:

[1]    24938 illegal hardware instruction  ./Anytype-0.34.3.AppImage

Expected Behavior

The AnyType client should start.

Steps To Reproduce

  1. Download the official AppImage or build it using the instructions given here
  2. Run ./Anytype-0.34.3.AppImage

Environment

- OS: Gentoo Linux
- Version: 0.34.3

Anything else?

No response

@mrusme mrusme added the bug Something isn't working label Aug 24, 2023
@ra3orblade
Copy link
Contributor

What machine do you have? How do you build it locally?

@mrusme
Copy link
Author

mrusme commented Aug 24, 2023

@ra3orblade

Linux cbrspc7 6.3.8-gentoo #2 SMP PREEMPT_DYNAMIC Mon Aug 14 21:32:55 EST 2023 x86_64 AMD Ryzen 9 5950X 16-Core Processor AuthenticAMD GNU/Linux

I built it according to the official documentation, anytype-heart and then anytype-ts. But as I stated, I tried the official AppImage as well and it leads to the same output.

Is there any strace or something I can provide you with to help debugging this?

@mrusme
Copy link
Author

mrusme commented Aug 25, 2023

FYI: Just for testing purposes I downloaded the official AppImage on a freshly installed, up to date OpenSuSE Tumbleweed VM and ran it. It kind of works there, although this message keeps popping up every now and then:

screenshot_2023-08-24-201344

Even without doing anything in the app, this message pops up every once in a while. This is probably an issue that it separate from the one I'm encountering on Gentoo? I can open a dedicated issue if you'd like me to.

@mrusme
Copy link
Author

mrusme commented Aug 28, 2023

Just tested it with https://github.com/anyproto/anytype-ts/releases/tag/v0.34.4-alpha -- same thing happens, illegal hardware instruction.

@ra3orblade
Copy link
Contributor

Yeah, nothing changed in that part, I think this is some electron Gentoo drivers problem or something like this.

@mrusme
Copy link
Author

mrusme commented Aug 28, 2023

FYI: On a freshly installed Fedora 38 VM everything seems to work fine, using the RPM package that you provide. No illegal hardware instruction and neither the weird message that I get on OpenSuSE.

@ra3orblade
Copy link
Contributor

You can try upgrading to Electron ^25 but there are some CSS tweaks needed to be done in order for the top buttons to work as they have fixed a bug with drag region and it stopped working. Here is the link with the above fixes: https://github.com/anyproto/anytype-ts/pull/59/files#diff-a73f294eadd8261bdc4235e0bdb875677c618e1e2d35d7f22c1ec30e6f64f75b

@ra3orblade
Copy link
Contributor

I will update Electron to latest with the release after next, wanna test it a bit more internally.

@mrusme
Copy link
Author

mrusme commented Jan 31, 2024

I tried to get AnyType running with pretty much every release you guys had so far, unfortunately no success, with this error still popping up. Hence I decided to give it a try and build it myself:

> anytype@0.38.0 dist:linux
> npm run build:deps && webpack --mode=production --node-env=production && DATE=`date '+%Y-%m-%d_%H_%M'` GIT_COMMIT=`git rev-parse --short HEAD` electron-builder --linux --arm64 --x64


> anytype@0.38.0 build:deps
> webpack --config webpack.node.config.js --stats detailed | grep 'node_modules' | sed -E 's/.*(node_modules[\/][^\\/[:space:]]{1,})[\\/].*/\1/' | uniq | node save-node-deps.js

[
  { from: 'node_modules/@electron', to: 'node_modules/@electron' },
  { from: 'node_modules/async', to: 'node_modules/async' },
  {
    from: 'node_modules/balanced-match',
    to: 'node_modules/balanced-match'
  },
  {
    from: 'node_modules/brace-expansion',
    to: 'node_modules/brace-expansion'
  },
  {
    from: 'node_modules/builder-util-runtime',
    to: 'node_modules/builder-util-runtime'
  },
  { from: 'node_modules/concat-map', to: 'node_modules/concat-map' },
  { from: 'node_modules/debug', to: 'node_modules/debug' },
  { from: 'node_modules/electron-dl', to: 'node_modules/electron-dl' },
  {
    from: 'node_modules/electron-is-dev',
    to: 'node_modules/electron-is-dev'
  },
  {
    from: 'node_modules/electron-json-storage',
    to: 'node_modules/electron-json-storage'
  },
  {
    from: 'node_modules/electron-log',
    to: 'node_modules/electron-log'
  },
  {
    from: 'node_modules/electron-updater',
    to: 'node_modules/electron-updater'
  },
  {
    from: 'node_modules/electron-util',
    to: 'node_modules/electron-util'
  },
  {
    from: 'node_modules/electron-window-state',
    to: 'node_modules/electron-window-state'
  },
  { from: 'node_modules/ext-list', to: 'node_modules/ext-list' },
  { from: 'node_modules/ext-name', to: 'node_modules/ext-name' },
  { from: 'node_modules/fs-extra', to: 'node_modules/fs-extra' },
  { from: 'node_modules/fs.realpath', to: 'node_modules/fs.realpath' },
  { from: 'node_modules/glob', to: 'node_modules/glob' },
  { from: 'node_modules/graceful-fs', to: 'node_modules/graceful-fs' },
  { from: 'node_modules/has-flag', to: 'node_modules/has-flag' },
  { from: 'node_modules/imurmurhash', to: 'node_modules/imurmurhash' },
  { from: 'node_modules/inflight', to: 'node_modules/inflight' },
  { from: 'node_modules/inherits', to: 'node_modules/inherits' },
  {
    from: 'node_modules/is-plain-obj',
    to: 'node_modules/is-plain-obj'
  },
  { from: 'node_modules/js-yaml', to: 'node_modules/js-yaml' },
  { from: 'node_modules/jsonfile', to: 'node_modules/jsonfile' },
  { from: 'node_modules/keytar', to: 'node_modules/keytar' },
  { from: 'node_modules/lazy-val', to: 'node_modules/lazy-val' },
  { from: 'node_modules/lockfile', to: 'node_modules/lockfile' },
  { from: 'node_modules/lodash', to: 'node_modules/lodash' },
  {
    from: 'node_modules/lodash.escaperegexp',
    to: 'node_modules/lodash.escaperegexp'
  },
  {
    from: 'node_modules/lodash.isequal',
    to: 'node_modules/lodash.isequal'
  },
  { from: 'node_modules/lru-cache', to: 'node_modules/lru-cache' },
  { from: 'node_modules/mime-db', to: 'node_modules/mime-db' },
  { from: 'node_modules/minimatch', to: 'node_modules/minimatch' },
  { from: 'node_modules/mkdirp', to: 'node_modules/mkdirp' },
  {
    from: 'node_modules/modify-filename',
    to: 'node_modules/modify-filename'
  },
  { from: 'node_modules/ms', to: 'node_modules/ms' },
  {
    from: 'node_modules/new-github-issue-url',
    to: 'node_modules/new-github-issue-url'
  },
  { from: 'node_modules/once', to: 'node_modules/once' },
  { from: 'node_modules/path-exists', to: 'node_modules/path-exists' },
  {
    from: 'node_modules/path-is-absolute',
    to: 'node_modules/path-is-absolute'
  },
  { from: 'node_modules/pupa', to: 'node_modules/pupa' },
  { from: 'node_modules/rimraf', to: 'node_modules/rimraf' },
  {
    from: 'node_modules/sanitize-filename',
    to: 'node_modules/sanitize-filename'
  },
  { from: 'node_modules/sax', to: 'node_modules/sax' },
  { from: 'node_modules/semver', to: 'node_modules/semver' },
  { from: 'node_modules/signal-exit', to: 'node_modules/signal-exit' },
  { from: 'node_modules/sort-keys', to: 'node_modules/sort-keys' },
  {
    from: 'node_modules/sort-keys-length',
    to: 'node_modules/sort-keys-length'
  },
  {
    from: 'node_modules/supports-color',
    to: 'node_modules/supports-color'
  },
  {
    from: 'node_modules/truncate-utf8-bytes',
    to: 'node_modules/truncate-utf8-bytes'
  },
  {
    from: 'node_modules/universalify',
    to: 'node_modules/universalify'
  },
  {
    from: 'node_modules/unused-filename',
    to: 'node_modules/unused-filename'
  },
  { from: 'node_modules/wrappy', to: 'node_modules/wrappy' },
  {
    from: 'node_modules/write-file-atomic',
    to: 'node_modules/write-file-atomic'
  },
  { from: 'node_modules/yallist', to: 'node_modules/yallist' }
]
(node:12516) [DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET] DeprecationWarning: Compilation.modules was changed from Array to Set (using Array method 'reduce' is deprecated)
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:12516) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
asset main.js 28.9 MiB [emitted] [big] (name: app) 1 related asset
asset extension/js/main.js 25.1 MiB [emitted] [big] (name: extension) 1 related asset
asset 367.js 4.3 MiB [emitted] [big] 1 related asset
orphan modules 8.21 MiB [orphan] 1978 modules
runtime modules 14.9 KiB 26 modules
built modules 39.2 MiB [built]
  modules by path ./node_modules/ 13.9 MiB 918 modules
  modules by path ./src/ 7.57 MiB 594 modules
  modules by path ./dist/ 11.1 MiB
    javascript modules 9.66 MiB 57 modules
    json modules 1.45 MiB 22 modules
  modules by path ./extension/ 6.58 MiB
    ./extension/entry.tsx + 543 modules 5.73 MiB [built] [code generated]
    ./extension/scss/common.scss 570 bytes [built] [code generated]
    ./extension/scss/popup.scss 569 bytes [built] [code generated]
    + 4 modules
  + 6 modules

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  main.js (28.9 MiB)
  extension/js/main.js (25.1 MiB)
  367.js (4.3 MiB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (28.9 MiB)
      main.js
  extension (25.1 MiB)
      extension/js/main.js


webpack 5.89.0 compiled with 2 warnings in 32450 ms
  • electron-builder  version=24.9.1 os=6.5.7-gentoo
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
[BeforeBuild] platform: linux arch: x64
[BeforeBuild] folder: linux-amd
[BeforeBuild] copy ./linux-amd/anytypeHelper ./dist/anytypeHelper
  • packaging       platform=linux arch=x64 electron=28.2.0 appOutDir=dist/linux-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v28.2.0/electron-v28.2.0-linux-x64.zip size=102 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v28.2.0/electron-v28.2.0-linux-x64.zip duration=16.501s
error: API request failed
  caused by: sentry reported an error: Authentication credentials were not provided. (http status: 401)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
  • skipping "afterSign" hook as no signing occurred, perhaps you intended "afterPack"?
  • building        target=snap arch=x64 file=dist/anytype_0.38.0_amd64.snap
  • building        target=AppImage arch=x64 file=dist/Anytype-0.38.0.AppImage
  • building        target=tar.gz arch=x64 file=dist/anytype-0.38.0.tar.gz
[BeforeBuild] platform: linux arch: arm64
[BeforeBuild] folder: linux-arm
  • packaging       platform=linux arch=arm64 electron=28.2.0 appOutDir=dist/linux-arm64-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v28.2.0/electron-v28.2.0-linux-arm64.zip size=102 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v28.2.0/electron-v28.2.0-linux-arm64.zip duration=5.001s
error: API request failed
  caused by: sentry reported an error: Authentication credentials were not provided. (http status: 401)

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.
  • skipping "afterSign" hook as no signing occurred, perhaps you intended "afterPack"?
  • building        target=snap arch=arm64 file=dist/anytype_0.38.0_arm64.snap
  • building        target=AppImage arch=arm64 file=dist/Anytype-0.38.0-arm64.AppImage
  • building        target=tar.gz arch=arm64 file=dist/anytype-0.38.0-arm64.tar.gz
  ⨯ snapcraft is not installed, please: sudo snap install snapcraft --classic
  • building        target=deb arch=x64 file=dist/anytype_0.38.0_amd64.deb
  • adding autoupdate files for: deb. (Beta feature)  resourceDir=/home/mrus/projects/github/anytype-ts/dist/linux-unpacked/resources
  • building        target=rpm arch=x64 file=dist/anytype-0.38.0.x86_64.rpm
  • adding autoupdate files for: rpm. (Beta feature)  resourceDir=/home/mrus/projects/github/anytype-ts/dist/linux-unpacked/resources
  ⨯ to build rpm, executable rpmbuild is required, please install: sudo apt-get install rpm
  ⨯ Cannot cleanup:

Error #1 --------------------------------------------------------------------------------
Error: /home/mrus/projects/github/anytype-ts/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/util.ts:251:14)
    at Object.onceWrapper (node:events:629:26)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)

Error #2 --------------------------------------------------------------------------------
Error: /home/mrus/projects/github/anytype-ts/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/util.ts:251:14)
    at Object.onceWrapper (node:events:629:26)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)  failedTask=build stackTrace=Error: Cannot cleanup:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Error #1 --------------------------------------------------------------------------------
Error: /home/mrus/projects/github/anytype-ts/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/util.ts:251:14)
    at Object.onceWrapper (node:events:629:26)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Error #2 --------------------------------------------------------------------------------
Error: /home/mrus/projects/github/anytype-ts/node_modules/app-builder-bin/linux/x64/app-builder process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Exit code:
1
    at ChildProcess.<anonymous> (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/util.ts:251:14)
    at Object.onceWrapper (node:events:629:26)
    at ChildProcess.emit (node:events:514:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
    at throwError (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/asyncTaskManager.ts:88:11)
    at checkErrors (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/asyncTaskManager.ts:53:9)
    at AsyncTaskManager.awaitTasks (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/asyncTaskManager.ts:67:7)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Packager.doBuild (/home/mrus/projects/github/anytype-ts/node_modules/app-builder-lib/src/packager.ts:458:5)
    at executeFinally (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/promise.ts:12:14)
    at Packager._build (/home/mrus/projects/github/anytype-ts/node_modules/app-builder-lib/src/packager.ts:376:31)
    at Packager.build (/home/mrus/projects/github/anytype-ts/node_modules/app-builder-lib/src/packager.ts:337:12)
    at executeFinally (/home/mrus/projects/github/anytype-ts/node_modules/builder-util/src/promise.ts:12:14)

Even though it was a bit of Yak shaving, I managed to get at least an AppImage. Unfortunately with that I'm getting this error:

/tmp/.mount_AnytypcWysVu/anytype: error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory

I assume that it's because apparently Electron is being downloaded as a binary release from GitHub, rather than as source and built during the whole build process. The binary release probably has X11 compiled in, even though from what I remember, Electron can be built without X11 dependencies.

Long story short, is there a way to make npm run dist:linux either download the source release of Electron instead, and build it without X11, or make npm run dist:linux use an installed version of Electron?

Thank you.

@ra3orblade
Copy link
Contributor

No, it does not matter that electron binaries are downloaded. First of all you will have sentry error when trying to build so you need to add ELECTRON_SKIP_SENTRY=1 flag to the build env, second is that you need to try to install dependency:

sudo apt install libXcomposite

@mrusme
Copy link
Author

mrusme commented Feb 14, 2024

Hey there, thanks for getting back!

second is that you need to try to install dependency:

sudo apt install libXcomposite

Well, that's exactly what I'm trying to avoid:

The binary release probably has X11 compiled in, even though from what I remember, Electron can be built without X11 dependencies.

As described here it seems though that it's now possible for Electron apps to run free of X11 dependencies. Adding the whole stack of X11 dependencies to my system solely for the purpose of running AnyType doesn't sound reasonable.

@ra3orblade
Copy link
Contributor

Sorry for long reply, I'm not a linux user myself so it's better to ask on forums, should get answer much faster - I've saw someone used this flags to run the app correctly:

--enable-features=UseOzonePlatform --ozone-platform=wayland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants