Read the statement by Michael Teeuw here.
electron-rebuild problems with MagicMirror 2.22.0
-
Hi,
today i tried the new release and had the usual problems with electron-rebuild with my MMM-GPIO-Notifications module. I also tried MMM-Buttons of @sdetweil i copied his approche to handle electron-rebuild to my module some time ago.
As nearly all PIR modules will have the same issues i wanted to discuss possible solutions in public.
I use a fully patched Raspberry OS Bullseye 32Bit.
pi@mirror-eg:~ $ cd MagicMirror/modules/ pi@mirror-eg:~/MagicMirror/modules $ git clone https://github.com/sdetweil/MMM-Buttons.git Klone nach 'MMM-Buttons' ... remote: Enumerating objects: 56, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 56 (delta 0), reused 2 (delta 0), pack-reused 52 Entpacke Objekte: 100% (56/56), Fertig. pi@mirror-eg:~/MagicMirror/modules $ cd MMM-Buttons/ pi@mirror-eg:~/MagicMirror/modules/MMM-Buttons $ npm install > Magic-Mirror-Module-Buttons@1.0.0 postinstall > ./postinstall ⠴ Building module: epoll, Completed: 0make: Verzeichnis „/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build“ wird betreten ⠦ Building module: epoll, Completed: 0 CXX(target) Release/obj.target/epoll/src/epoll.o ⠙ Building module: epoll, Completed: 0In file included from /home/pi/.electron-gyp/22.0.0/include/node/v8-local-handle.h:12, from /home/pi/.electron-gyp/22.0.0/include/node/v8-array-buffer.h:12, from /home/pi/.electron-gyp/22.0.0/include/node/v8.h:24, from ../src/epoll.cc:11: /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:124:62: warning: left shift count >= width of type [-Wshift-count-overflow] constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32; ^~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:124:59: error: right operand of shift expression ‘(1 << 32)’ is >= than the precision of the left operand [-fpermissive] constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32; ~~~~~~~~~~^~~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:125:60: warning: left shift count >= width of type [-Wshift-count-overflow] constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32; ^~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:125:57: error: right operand of shift expression ‘(1 << 32)’ is >= than the precision of the left operand [-fpermissive] constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32; ~~~~~~~~~~^~~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:128:27: error: static assertion failed: Pointer compression can be enabled only for 64-bit architectures kApiSystemPointerSize == kApiInt64Size, ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:186:38: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘1099511627776’ to ‘0’ [-Woverflow] constexpr size_t kSandboxSize = 1ULL << kSandboxSizeLog2; ~~~~~^~~~~~~~~~~~~~~~~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:204:50: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘34359738368’ to ‘0’ [-Woverflow] constexpr size_t kSandboxGuardRegionSize = 32ULL * GB; ~~~~~~^~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:220:56: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘8589934592’ to ‘0’ [-Woverflow] constexpr size_t kSandboxMinimumReservationSize = 8ULL * GB; ~~~~~^~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:230:60: warning: conversion from ‘long long unsigned int’ to ‘size_t’ {aka ‘unsigned int’} changes value from ‘34359738367’ to ‘4294967295’ [-Woverflow] constexpr size_t kMaxSafeBufferSizeForSandbox = 32ULL * GB - 1; ~~~~~~~~~~~^~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:231:44: error: static assertion failed: The maximum allowed buffer size must not be larger than the sandbox's guard regions static_assert(kMaxSafeBufferSizeForSandbox <= kSandboxGuardRegionSize, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:236:48: error: static assertion failed: The maximum size of a BoundedSize must be synchronized with the kMaxSafeBufferSizeForSandbox static_assert(1ULL << (64 - kBoundedSizeShift) == ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ kMaxSafeBufferSizeForSandbox + 1, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pi/.electron-gyp/22.0.0/include/node/v8-internal.h:260:56: error: static assertion failed: kExternalPointerTableReservationSize and kExternalPointerIndexShift don't match static_assert((1 << (32 - kExternalPointerIndexShift)) == kMaxExternalPointers, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ ⠹ Building module: epoll, Completed: 0make: *** [epoll.target.mk:129: Release/obj.target/epoll/src/epoll.o] Fehler 1 make: Verzeichnis „/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build“ wird verlassen ✖ Rebuild Failed An unhandled error occurred inside electron-rebuild node-gyp failed to rebuild '/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/epoll'. For more information, rerun with the DEBUG environment variable set to "electron-rebuild". Error: `make` failed with exit code: 2 Error: node-gyp failed to rebuild '/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/epoll'. For more information, rerun with the DEBUG environment variable set to "electron-rebuild". Error: `make` failed with exit code: 2 at NodeGyp.rebuildModule (/home/pi/MagicMirror/node_modules/electron-rebuild/lib/src/module-type/node-gyp.js:120:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async ModuleRebuilder.rebuildNodeGypModule (/home/pi/MagicMirror/node_modules/electron-rebuild/lib/src/module-rebuilder.js:98:9) at async ModuleRebuilder.rebuild (/home/pi/MagicMirror/node_modules/electron-rebuild/lib/src/module-rebuilder.js:128:14) at async Rebuilder.rebuildModuleAt (/home/pi/MagicMirror/node_modules/electron-rebuild/lib/src/rebuild.js:149:13) at async Rebuilder.rebuild (/home/pi/MagicMirror/node_modules/electron-rebuild/lib/src/rebuild.js:112:17) at async /home/pi/MagicMirror/node_modules/electron-rebuild/lib/src/cli.js:158:9 npm ERR! code 255 npm ERR! path /home/pi/MagicMirror/modules/MMM-Buttons npm ERR! command failed npm ERR! command sh -c ./postinstall npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2023-01-06T11_10_38_105Z-debug-0.log
-
@wishmaster270 on my intel box this worked great
sam@galliumos:~/MagicMirror/modules/MMM-Buttons$ npm install --omit=dev --no-audit --no-fund > Magic-Mirror-Module-Buttons@1.0.0 postinstall > ./postinstall /home/sam/MagicMirror/modules/MMM-Buttons ⠇ Building module: epoll, Completed: 0make: Entering directory '/home/sam/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build' CXX(target) Release/obj.target/epoll/src/epoll.o ⠴ Building module: epoll, Completed: 0 SOLINK_MODULE(target) Release/obj.target/epoll.node ⠏ Building module: epoll, Completed: 0 COPY Release/epoll.node make: Leaving directory '/home/sam/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build' ✔ Rebuild Complete added 6 packages in 31s
worked on on buster
pi@raspberrypi42:~/MagicMirror/modules/MMM-Buttons $ npm install --omit=dev --no-fund --no-audit > Magic-Mirror-Module-Buttons@1.0.0 postinstall > ./postinstall ⠸ Building module: epoll, Completed: 0make: Entering directory '/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build' CXX(target) Release/obj.target/epoll/src/epoll.o ⠇ Building module: epoll, Completed: 0 SOLINK_MODULE(target) Release/obj.target/epoll.node ⠙ Building module: epoll, Completed: 0 COPY Release/epoll.node make: Leaving directory '/home/pi/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build' ✔ Rebuild Complete up to date in 14s pi@raspberrypi42:~/MagicMirror/modules/MMM-Buttons $ grep version ../../package.json "version": "2.22.0",
-
To me this looks like a problem with the
onoff
package. Because if I removeonoff
from thepackage.json
,npm i
works.onoff
also comes with the dependencyepoll
, which appears a lot in the error messages.npm i onoff
andnpm i epoll
produce similar error messages. I think that’s where the main problem is. -
@KristjanESPERANTO the ‘problem’ is that the module installs electron-rebuild in its OWN MODULE folder, and it can no longer figure out what electron version it needs to build for…
the only ‘fix’ is to install electron-rebuild in the MM folder (we should just install it to begin with in my opinion)
and to launch THAT version of eb… -
@KristjanESPERANTO epoll binary is dependent on the Electron version.
no matter which lib drags it in … so you MUST run eb… to get it current…
see my prior post for the troubles…
NOBODY gives a crap about breaking changes anymore…
they all feel if you don’t update, then your code dies. and they don’t care… -
@sdetweil and it succeeded on pi4 w bullseye… I also tested with my
upgrade script and backup/restore
and both those executed and did rebuild on the modules… (using the postinstall script) -
node@raspberrypi:/opt/magic_mirror/modules$ git clone https://github.com/sdetweil/MMM-Buttons.git Cloning into 'MMM-Buttons'... remote: Enumerating objects: 56, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 56 (delta 0), reused 2 (delta 0), pack-reused 52 Receiving objects: 100% (56/56), 11.86 KiB | 1.69 MiB/s, done. Resolving deltas: 100% (25/25), done. node@raspberrypi:/opt/magic_mirror/modules$ cd MMM-Buttons/ node@raspberrypi:/opt/magic_mirror/modules/MMM-Buttons$ ls -la total 40 drwxr-xr-x 3 node node 4096 Jan 6 19:39 . drwxr-xr-x 5 node node 4096 Jan 6 19:39 .. drwxr-xr-x 8 node node 4096 Jan 6 19:39 .git -rw-r--r-- 1 node node 530 Jan 6 19:39 CHANGELOG.md -rw-r--r-- 1 node node 3416 Jan 6 19:39 MMM-Buttons.js -rw-r--r-- 1 node node 5725 Jan 6 19:39 README.md -rw-r--r-- 1 node node 2778 Jan 6 19:39 node_helper.js -rw-r--r-- 1 node node 693 Jan 6 19:39 package.json -rwxr-xr-x 1 node node 179 Jan 6 19:39 postinstall node@raspberrypi:/opt/magic_mirror/modules/MMM-Buttons$ npm install > Magic-Mirror-Module-Buttons@1.0.0 postinstall > ./postinstall /opt/magic_mirror/modules/MMM-Buttons ⠧ Building module: epoll, Completed: 0make: Entering directory '/opt/magic_mirror/modules/MMM-Buttons/node_modules/epoll/build' CXX(target) Release/obj.target/epoll/src/epoll.o ⠙ Building module: epoll, Completed: 0 SOLINK_MODULE(target) Release/obj.target/epoll.node ⠼ Building module: epoll, Completed: 0 COPY Release/epoll.node make: Leaving directory '/opt/magic_mirror/modules/MMM-Buttons/node_modules/epoll/build' ✔ Rebuild Complete added 6 packages, and audited 7 packages in 2m found 0 vulnerabilities
-
@karsten13 yep, looks good…
-
For me it looks like this:
kristjan@debian:~/Infomonitor/MagicMirror/modules$ git clone https://github.com/sdetweil/MMM-Buttons.git Cloning into 'MMM-Buttons'... remote: Enumerating objects: 56, done. remote: Counting objects: 100% (4/4), done. remote: Compressing objects: 100% (4/4), done. remote: Total 56 (delta 0), reused 2 (delta 0), pack-reused 52 Receiving objects: 100% (56/56), 11.86 KiB | 1.69 MiB/s, done. Resolving deltas: 100% (25/25), done. kristjan@debian:~/Infomonitor/MagicMirror/modules$ cd MMM-Buttons/ kristjan@debian:~/Infomonitor/MagicMirror/modules/MMM-Buttons$ npm install npm ERR! code 1 npm ERR! path /home/kristjan/Infomonitor/MagicMirror/modules/MMM-Buttons/node_modules/epoll npm ERR! command failed npm ERR! command sh -c -- node-gyp rebuild npm ERR! make: Entering directory '/home/kristjan/Infomonitor/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build' npm ERR! CXX(target) Release/obj.target/epoll/src/epoll.o npm ERR! SOLINK_MODULE(target) Release/obj.target/epoll.node npm ERR! make: Leaving directory '/home/kristjan/Infomonitor/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build' npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@9.3.1 npm ERR! gyp info using node@16.18.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3" npm ERR! gyp info spawn /usr/bin/python3 npm ERR! gyp info spawn args [ npm ERR! gyp info spawn args '/home/kristjan/Infomonitor/MagicMirror/node_modules/node-gyp/gyp/gyp_main.py', npm ERR! gyp info spawn args 'binding.gyp', npm ERR! gyp info spawn args '-f', npm ERR! gyp info spawn args 'make', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/kristjan/Infomonitor/MagicMirror/modules/MMM-Buttons/node_modules/epoll/build/config.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/kristjan/Infomonitor/MagicMirror/node_modules/node-gyp/addon.gypi', npm ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args '/home/kristjan/.cache/node-gyp/16.18.0/include/node/common.gypi', npm ERR! gyp info spawn args '-Dlibrary=shared_library', npm ERR! gyp info spawn args '-Dvisibility=default', npm ERR! gyp info spawn args '-Dnode_root_dir=/home/kristjan/.cache/node-gyp/16.18.0', npm ERR! gyp info spawn args '-Dnode_gyp_dir=/home/kristjan/Infomonitor/MagicMirror/node_modules/node-gyp', npm ERR! gyp info spawn args '-Dnode_lib_file=/home/kristjan/.cache/node-gyp/16.18.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/kristjan/Infomonitor/MagicMirror/modules/MMM-Buttons/node_modules/epoll', npm ERR! gyp info spawn args '-Dnode_engine=v8', npm ERR! gyp info spawn args '--depth=.', npm ERR! gyp info spawn args '--no-parallel', npm ERR! gyp info spawn args '--generator-output', npm ERR! gyp info spawn args 'build', npm ERR! gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ] npm ERR! gyp info spawn make npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] npm ERR! /usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: unknown type [0x13] section `.relr.dyn' npm ERR! /usr/bin/ld: skipping incompatible /lib/x86_64-linux-gnu/libm.so.6 when searching for /lib/x86_64-linux-gnu/libm.so.6 npm ERR! /usr/bin/ld: cannot find /lib/x86_64-linux-gnu/libm.so.6 npm ERR! /usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: unknown type [0x13] section `.relr.dyn' npm ERR! /usr/bin/ld: skipping incompatible /lib/x86_64-linux-gnu/libm.so.6 when searching for /lib/x86_64-linux-gnu/libm.so.6 npm ERR! /usr/bin/ld: /lib/x86_64-linux-gnu/libmvec.so.1: unknown type [0x13] section `.relr.dyn' npm ERR! /usr/bin/ld: skipping incompatible /lib/x86_64-linux-gnu/libmvec.so.1 when searching for /lib/x86_64-linux-gnu/libmvec.so.1 npm ERR! /usr/bin/ld: cannot find /lib/x86_64-linux-gnu/libmvec.so.1 npm ERR! /usr/bin/ld: /lib/x86_64-linux-gnu/libmvec.so.1: unknown type [0x13] section `.relr.dyn' npm ERR! /usr/bin/ld: skipping incompatible /lib/x86_64-linux-gnu/libmvec.so.1 when searching for /lib/x86_64-linux-gnu/libmvec.so.1 npm ERR! collect2: error: ld returned 1 exit status npm ERR! make: *** [epoll.target.mk:145: Release/obj.target/epoll.node] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (/home/kristjan/Infomonitor/MagicMirror/node_modules/node-gyp/lib/build.js:203:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) npm ERR! gyp ERR! System Linux 5.10.0-20-amd64 npm ERR! gyp ERR! command "/home/kristjan/.nvm/versions/node/v16.18.0/bin/node" "/home/kristjan/Infomonitor/MagicMirror/node_modules/.bin/node-gyp" "rebuild" npm ERR! gyp ERR! cwd /home/kristjan/Infomonitor/MagicMirror/modules/MMM-Buttons/node_modules/epoll npm ERR! gyp ERR! node -v v16.18.0 npm ERR! gyp ERR! node-gyp -v v9.3.1 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /home/kristjan/.npm/_logs/2023-01-06T18_47_25_457Z-debug-0.log kristjan@debian:~/Infomonitor/MagicMirror/modules/MMM-Buttons$ uname -r 5.10.0-20-amd64 kristjan@debian:~/Infomonitor/MagicMirror/modules/MMM-Buttons$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye
-
@wishmaster270 i don’t see any issues for your module either (modified using postinstall script)
sam@galliumos:~/MagicMirror/modules/MMM-GPIO-Notifications$ npm install --omit=dev --no-fund --no-audit npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs > MMM-GPIO-Notifications@0.0.5 postinstall > ./postinstall ⠧ Building module: epoll, Completed: 0make: Entering directory '/home/sam/MagicMirror/modules/MMM-GPIO-Notifications/node_modules/epoll/build' CXX(target) Release/obj.target/epoll/src/epoll.o ⠴ Building module: epoll, Completed: 0 SOLINK_MODULE(target) Release/obj.target/epoll.node ⠧ Building module: epoll, Completed: 0 COPY Release/epoll.node ⠇ Building module: epoll, Completed: 0make: Leaving directory '/home/sam/MagicMirror/modules/MMM-GPIO-Notifications/node_modules/epoll/build' ✔ Rebuild Complete added 170 packages in 20s
npm 8.11.0
node 16.16.0