Repository navigation
Support for Python 3 #21821
Description
Activity
- addedpythonPRs and issues that require attention from people who are familiar with Python.PRs and issues that require attention from people who are familiar with Python.
on Jul 15, 2018 We'd need gyp to support Python 3 first. See https://bugs.chromium.org/p/gyp/issues/detail?id=36
Let's be realistic, GYP will never support Python 3. We should instead move towards a different build system.
Reacted by Nikos Katsos, Marvin Hagemeister, Denys Otrishko, Haroon Khan, peq42, Eric Peden, Jiawen Geng, Tuan Anh Tran and perestoronin- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Jul 15, 2018 @seishun like gn
Possibly relevant discussion here: #21410
I just want to drop this here...
There has been some major progress on this.
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 atnode-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.gypfiles. Replacing the meta-build system will require migrating every native-addon out there.
It might be possible to havecmakeas 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 tonpm installsome package, there is no way to know if some downstream dependency requirescmaketo be built, and a failure will come as a surprise)I'm going to close this as a duplicate of #23659
- addedduplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.
on Nov 15, 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 😁.
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.
@refack It is OK. I'm not sad or something like this 😄. I just wanted to know what was this 😁.
Reacted by Refael Ackermann
Add support for building with Python 3.
Python 2 is very old and it will not be supported in 2020 anymore (https://pythonclock.org/ and python/devguide#344).