No native build was found for `runtime=electron abi=115 platform=linuxglibc arch=x64`
I'm attempting to use pprof-it to profile the TypeScript language server (TS v5). I get the error below which I believe means it needs to be built for the Electron runtime env:
Error: No native build was found for runtime=electron abi=115 platform=linuxglibc arch=x64
at load.path (/home/coder/.local/lib/node_modules/pprof-it/node_modules/node-gyp-build/index.js:59:9)
at load (/home/coder/.local/lib/node_modules/pprof-it/node_modules/node-gyp-build/index.js:19:30)
at Object.<anonymous> (/home/coder/.local/lib/node_modules/pprof-it/node_modules/@datadog/pprof/out/src/heap-profiler-bindings.js:44:18)
at Module._compile (node:internal/modules/cjs/loader:1529:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
at Module.load (node:internal/modules/cjs/loader:1275:32)
at Module._load (node:internal/modules/cjs/loader:1096:12)
at Module.require (node:internal/modules/cjs/loader:1298:19)
at require (node:internal/modules/helpers:182:18)
at Object.<anonymous> (/home/coder/.local/lib/node_modules/pprof-it/node_modules/@datadog/pprof/out/src/heap-profiler.js:19:34)
How hard would it be to add this? any suggested workarounds?
I can't really do anything about it since it's Datadog's package I depend on (Google's is basically unmaintained), however you can technically patch the package to just swap out "electron" for "node" and it should "just work", at least it has worked for me in the past when I was attempting to profile Electron-based code.
Error: No native build was found for runtime=node abi=137 platform=linuxglibc arch=x64
@jakebailey i wonder if datadog borked it here because i even get a similar message on plain old WSL
and i get a similar one on my M2 macbook air (but ofc different platform)
Error: No native build was found for runtime=node abi=137 platform=linuxglibc arch=x64
@jakebailey i wonder if datadog borked it here because i even get a similar message on plain old WSL
and i get a similar one on my M2 macbook air (but ofc different
platform)
Just fixed this.
Not sure if I can fix the electron problem, though. That might require some goofy patching, or at worst a fork.
@mjames-c Can you try out https://github.com/jakebailey/pprof-it/pull/79#issuecomment-3182507667 to see if that works? (I have not tested myself.)
I tested it myself and it did not work, but at least I can reproduce it.
I kinda got it to work, but then:
Error: The module '/home/jake/work/pprof-it/node_modules/@datadog/pprof/prebuilds/linuxglibc-x64/node-127.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 127. This version of Node.js requires
NODE_MODULE_VERSION 136. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
So, even if I defeat node-gyp-build's detection to choose the "right" version for the node inside Electron, it still complains. I am not sure this is fixable without asking datadog to also build electron binaries.
I thought maybe https://github.com/electron/rebuild would help, but there's no source code published with pprof to make it work on the fly.