microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.46k stars 235 forks source link

Build failed on Raspberry 3B+ #519

Closed matlinuxer2 closed 2 years ago

matlinuxer2 commented 2 years ago

Environment details

Issue description

I ran the electron-rebuild (v3.2.5) to rebuild this module. It passed on my laptop (x86_64) but failed on Raspberry 3B+(arm). Here I attached both successfull and failed logs for analysis below:

2021-12-24_node-pty_electron_rebuild_error.log.x86_64.txt 2021-12-24_node-pty_electron_rebuild_error.log.arm.txt

I noticed the different parts are be:

⠹ Building module: node-pty, Completed: 0In file included from /home/pi/.electron-gyp/16.0.5/include/node/v8-local-handle.h:12,
                 from /home/pi/.electron-gyp/16.0.5/include/node/v8-array-buffer.h:12,
                 from /home/pi/.electron-gyp/16.0.5/include/node/v8.h:25,
                 from /home/pi/.electron-gyp/16.0.5/include/node/node.h:63,
                 from ../../nan/nan.h:58,
                 from ../src/unix/pty.cc:20:
/home/pi/.electron-gyp/16.0.5/include/node/v8-internal.h:113:27: error: static assertion failed: Pointer compression can be enabled only for 64-bit architectures
  113 |     kApiSystemPointerSize == kApiInt64Size,
      |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/pi/.electron-gyp/16.0.5/include/node/v8-internal.h:471:68: warning: left shift count >= width of type [-Wshift-count-overflow]
  471 |   static constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32;
      |                                                          ~~~~~~~~~~^~~~~
/home/pi/.electron-gyp/16.0.5/include/node/v8-internal.h:471:68: error: right operand of shift expression ‘(1 << 32)’ is greater than or equal to the precision 32 of the left operand [-fpermissive]
/home/pi/.electron-gyp/16.0.5/include/node/v8-internal.h:472:66: warning: left shift count >= width of type [-Wshift-count-overflow]
  472 |   static constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32;
      |                                                        ~~~~~~~~~~^~~~~
/home/pi/.electron-gyp/16.0.5/include/node/v8-internal.h:472:66: error: right operand of shift expression ‘(1 << 32)’ is greater than or equal to the precision 32 of the left operand [-fpermissive]
⠹ Building module: node-pty, Completed: 0In file included from /home/pi/.electron-gyp/16.0.5/include/node/v8.h:53,
                 from /home/pi/.electron-gyp/16.0.5/include/node/node.h:63,
                 from ../../nan/nan.h:58,
                 from ../src/unix/pty.cc:20:
/home/pi/.electron-gyp/16.0.5/include/node/v8-script.h:230:79: warning: ‘using ResolveCallback = class v8::MaybeLocal<v8::Module> (*)(class v8::Local<v8::Context>, class v8::Local<v8::String>, class v8::Local<v8::Module>)’ is deprecated: Use ResolveModuleCallback [-Wdeprecated-declarations]
  230 |                                                       ResolveCallback callback);
      |                                                                               ^
/home/pi/.electron-gyp/16.0.5/include/node/v8-script.h:212:9: note: declared here
  212 |   using ResolveCallback V8_DEPRECATE_SOON("Use ResolveModuleCallback") =
      |         ^~~~~~~~~~~~~~~

Could it be electron newer version causing the 64-bit compatibililty issue? or node-pty need to do some compatibility patch?

In addition, it works on older environment below:

Tyriar commented 2 years ago

I think this is https://github.com/microsoft/node-pty/issues/438 as newer Electron is on a newer version of node