0

This issue is very similar to "fatal error: bits/libc-header-start.h: No such file or directory" while compiling HTK, however it occurs during Electron package rebuilding on linux:

┌──(kali♥kali)-[~/Desktop/.../NodeJs/Terminal]  10:51 
└─$ node build.js                                                     
Packaging app for platform win32 ia32 using electron v7.3.3
Well, sometimes you are not so lucky: gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@16.16.0 | linux | x64
gyp info find Python using Python version 3.10.4 found at "/usr/bin/python3"
(node:136591) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/kali/.electron-gyp/7.3.3/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/kali/.electron-gyp/7.3.3',
gyp info spawn args   '-Dnode_gyp_dir=/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/kali/.electron-gyp/7.3.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp/build'
  CXX(target) Release/obj.target/bindings/src/serialport.o
In file included from /usr/include/c++/12/stdlib.h:36,
                 from ../src/./serialport.h:12,
                 from ../src/serialport.cpp:1:
/usr/include/c++/12/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory
   41 | #include <bits/c++config.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [bindings.target.mk:110: Release/obj.target/bindings/src/serialport.o] Error 1
make: Leaving directory '/tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/kali/Desktop/.../NodeJs/Terminal/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.16.0-kali7-amd64
gyp ERR! command "/usr/local/bin/node" "/home/kali/Desktop/.../NodeJs/Terminal/node_modules/.bin/node-gyp" "rebuild" "--target=7.3.3" "--arch=ia32" "--dist-url=https://www.electronjs.org/headers" "--build-from-source"
gyp ERR! cwd /tmp/electron-packager/win32-ia32/Bridge-win32-ia32/resources/app/node_modules/@serialport/bindings-cpp
gyp ERR! node -v v16.16.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok

I've downgraded my nodejs to v16.16.0, as it seemed like a valid solution to a previous issue related to

npm ERR! gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in ../node-addon-api/node_api.gyp while loading dependencies of binding.gyp while trying to load binding.gyp

Currently using following deps: (They were based on an already existing project)

"devDependencies": {
    "electron": "^1.7.5",
    "electron-packager": "^12.2.0",
    "electron-rebuild": "^1.8.2",
    "electron-winstaller": "^2.7.0"
  },

I've tried installing gcc-multilib, using the newest versions of deps and also removing the -m32 flag from configurations. None of it worked unfortunately.

Vidar S. Ramdal
  • 1,164
  • 1
  • 14
  • 38
krysto
  • 211
  • 5

1 Answers1

1

I do think it is more project-to-project based issue, but there are steps that have helped me solve it:

As mentioned, installing gcc-multilib, but also

apt-get install g++-multilib
sudo dpkg --add-architecture i386
apt install wine
apt install mono-devel

Downgrading serailport package to 8.0.0 (used in the application), adding project's package description, slightly editing the electron-rebuild packager attribute name, because the application was built in a different folder than its contents, and restarting all services + reinstalling node modules. (note: kali-rolling 2022.2)

krysto
  • 211
  • 5