prebuild / node-gyp-build

Build tool and bindings loader for node-gyp that supports prebuilds
MIT License
104 stars 37 forks source link

Report more information when a prebuild is not found #54

Open aminya opened 1 year ago

aminya commented 1 year ago

Currently, it is quite hard to understand why a prebuild is not picked up, especially when the log comes from the end user. I think adding a console.log that includes some information like the host's platform, architecture, libc, etc. will help debug the issues.

vweevers commented 1 year ago

We already do:

https://github.com/prebuild/node-gyp-build/blob/0078d7884dfeb0e708477b3e20bfc4f520c1e2f8/index.js#L47-L60

aminya commented 1 year ago

This is not happening when people run npm i. Some examples. See the logs.

https://github.com/zeromq/zeromq.js/issues/526 https://github.com/zeromq/zeromq.js/issues/530#issue-1455476760

vweevers commented 1 year ago

I would guess because of https://github.com/zeromq/zeromq.js/blob/dd72eed5835e321e5c728959744e08f093557beb/package.json#L73 (the additional steps before node-gyp-build).

aminya commented 1 year ago

I added those just right now, and it is not released yet. Those reports are older.

vweevers commented 1 year ago

OK, may need npm i --verbose then. I don't recall.

aminya commented 1 year ago

Looking at the code, the code path is not clear to me. A lot of old-style JS dynamism and prototype assignment is used. Using TypeScript could make it easier to find the reason. Where is the call site of the load function?

https://github.com/prebuild/node-gyp-build/blob/0078d7884dfeb0e708477b3e20bfc4f520c1e2f8/index.js#L18-L25

I also see some ignored error variables.

https://github.com/prebuild/node-gyp-build/blob/0078d7884dfeb0e708477b3e20bfc4f520c1e2f8/bin.js#L9