You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a better idea: let's stop using Python to build native modules for Node.js. It's kind of a shame that we have to install Python to do this, as if Node.js was incapable of doing it at all.
GYP was crafted by Google to fit their needs at the moment, and it's declining ever since. Currently it's close to impossible to build native Node.js modules on non-latin windows, because of Python 2 lack of proper support for Unicode and GYP being built on top of it.
The way more popular and stable solution is cmake. Consider using it, please.
Hello @polkovnikov-ph and thank you for your comment.
For the record, we don't just use python for scaffolding native-addons, we actually use it as node-core's tooling runtime (see /tools/).
For native-addons (via node-gyp) we are considering alternatives such as gyp.js, and I'll take a look at node-cmake.
GYP was crafted by Google to fit their needs at the moment, and it's declining ever since.
We've recently forked GYP, and I have plans of freshening it up (and maybe incrementally improve it). First item on the list is python3 support, and we're almost there.
as for:
Currently it's close to impossible to build native Node.js modules on non-latin windows, because of Python 2 lack of proper support for Unicode
There are workarounds (discussed in #12786) and being compatible with python3 should resolve this.
The way more popular and stable solution is cmake.
The big hindrance is that currently native addons are scaffolded with binding.gyp files. Replacing the meta-build system will require migrating every native-addon out there.
It might be possible to have cmake as an opt-in alternative formula for node-gyp, but that should be discussed in https://github.com/nodejs/node-gyp...
(keep in mind that for the end user who just wants to npm install some package, there is no way to know if some downstream dependency requires cmake to be built, and a failure will come as a surprise)
You can close this if it is a duplicate, but I don't know how 4 months old issue can be duplicate of 1 month old issue 🤔. It is OK, but I just want to know what is this 😁.
but I don't know how 4 months old issue can be duplicate of 1 month old issue. 🤔
I'm sorry @filips123 it's not personal 😇. It's just that the other issue was brought to my attention first. I am working on this FR irregardless of this issue or that.
Activity
targos commentedon Jul 15, 2018
We'd need gyp to support Python 3 first. See https://bugs.chromium.org/p/gyp/issues/detail?id=36
seishun commentedon Jul 15, 2018
Let's be realistic, GYP will never support Python 3. We should instead move towards a different build system.
chux0519 commentedon Jul 16, 2018
@seishun like gn
mscdex commentedon Jul 16, 2018
Possibly relevant discussion here: #21410
cfanoulis commentedon Jul 18, 2018
I just want to drop this here...
https://docs.python.org/3/howto/pyporting.html
refack commentedon Nov 11, 2018
There has been some major progress on this.
reverofevil commentedon Nov 11, 2018
I have a better idea: let's stop using Python to build native modules for Node.js. It's kind of a shame that we have to install Python to do this, as if Node.js was incapable of doing it at all.
GYP was crafted by Google to fit their needs at the moment, and it's declining ever since. Currently it's close to impossible to build native Node.js modules on non-latin windows, because of Python 2 lack of proper support for Unicode and GYP being built on top of it.
The way more popular and stable solution is cmake. Consider using it, please.
FYI: https://github.com/cjntaylor/node-cmake
refack commentedon Nov 11, 2018
Hello @polkovnikov-ph and thank you for your comment.
For the record, we don't just use python for scaffolding native-addons, we actually use it as node-core's tooling runtime (see
/tools/).For native-addons (via
node-gyp) we are considering alternatives such as gyp.js, and I'll take a look atnode-cmake.We've recently forked GYP, and I have plans of freshening it up (and maybe incrementally improve it). First item on the list is python3 support, and we're almost there.
as for:
There are workarounds (discussed in #12786) and being compatible with python3 should resolve this.
The big hindrance is that currently native addons are scaffolded with
binding.gypfiles. Replacing the meta-build system will require migrating every native-addon out there.It might be possible to have
cmakeas an opt-in alternative formula fornode-gyp, but that should be discussed in https://github.com/nodejs/node-gyp...(keep in mind that for the end user who just wants to
npm installsome package, there is no way to know if some downstream dependency requirescmaketo be built, and a failure will come as a surprise)refack commentedon Nov 15, 2018
I'm going to close this as a duplicate of #23659
filips123 commentedon Nov 16, 2018
You can close this if it is a duplicate, but I don't know how 4 months old issue can be duplicate of 1 month old issue 🤔. It is OK, but I just want to know what is this 😁.
refack commentedon Nov 16, 2018
I'm sorry @filips123 it's not personal 😇. It's just that the other issue was brought to my attention first. I am working on this FR irregardless of this issue or that.
filips123 commentedon Nov 16, 2018
@refack It is OK. I'm not sad or something like this 😄. I just wanted to know what was this 😁.