Comment 35 for bug 1779863

Revision history for this message
Nicolas Noble (grumpycoder) wrote :

I must specify something from your statements. The fact the native module doesn't load really is undesired behavior. The normal nodejs behavior is make sure that the module is going to load while installing it, by checking ABI compatibility using various tags. It is expected and supported that nodejs reports its runtime version, and other parameters such as platform it's compiled for, to the external world.

A very typical installation path would then be for example:

    "module_path": "src/node/extension_binary/{node_abi}-{platform}-{arch}-{libc}"

And if a pre-compiled binary doesn't exist there, the installation system will trigger a compilation in order to generate a module that fits. For node8 for instance, {node_abi} will resolve to "node-v57".

The issue here is that you're transparently masquerading as "nodejs" while not really being "nodejs". For instance, Electron, which is a nodejs-like environment, but has a different ABI, will report the {node_abi} parameter completely differently. Instead of reporting "node-v57" as above, the Electron 2 runtime which is also based on node8, will report "electron-v2.0". This makes our lives as npm package maintainers easy, since we can then select the proper binary based on it.

So one another solution I'd then see would be for you to bite the bullet, and stop calling your runtime "nodejs", because, well, it's not really nodejs. More specifically, your "node8" runtime should report "node-debian-v57" instead of "node-v57", so we, npm package maintainers, can do the right thing on our end and either (1) start distributing node-debian specific prebuilt binaries or (2) let the npm install realize this is a different runtime than the prebuilt binaries we have and let it just recompile for this different runtime.

But your obstination on releasing a nodejs runtime that's not really nodejs while 100% masquerading as the official nodejs will eventually force us to discourage our users to use your runtime, because there's nothing we could do to handle the subtle bugs you're introducing on us.