Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gyp Python 3 fixes for Windows #29897

Closed
wants to merge 3 commits into from
Closed

Conversation

@targos
Copy link
Member

targos commented Oct 9, 2019

Commits:

tools: port Python 3 compat patches from node-gyp to gyp

Refs: https://github.com/nodejs/node-gyp/pull/1820
Refs: https://github.com/nodejs/node-gyp/pull/1843


build: always use strings for compiler version in gyp files

If GYP finds a string variable that can be converted to an integer,
it will do it when the variable is expanded. Use "0.0" instead of "0"
to force strings and be able to use comparison operations such as
`gas_version >= "2.26"` in Python 3.


tools: fix GYP MSVS solution generator for Python 3

/cc @nodejs/python

@targos targos requested a review from cclauss Oct 9, 2019
@targos targos added Python and removed openssl labels Oct 9, 2019
@targos

This comment has been minimized.

Copy link
Member Author

targos commented Oct 9, 2019

Note: with this change and #29898, I'm able to build Node on Windows with VS 2019 and Python 3.7.

@nodejs-github-bot

This comment has been minimized.

node.gyp Outdated Show resolved Hide resolved
@sam-github

This comment has been minimized.

Copy link
Member

sam-github commented Oct 9, 2019

Does tools: fix GYP MSVS solution generator for Python 3 needs to be ported back to node-gyp?

I'd RSLGTM it, but it failed in CI. I resumed in case the failures were ephemeral.

@nodejs-github-bot

This comment has been minimized.

@richardlau

This comment has been minimized.

Copy link
Member

richardlau commented Oct 9, 2019

Use "0.0" instead of "0" to force strings and be able to use comparison operations such as
gas_version >= "2.26" in Python 3.

Is that a safe comparison? e.g. What if gas_version is "2.3"?

@targos

This comment has been minimized.

Copy link
Member Author

targos commented Oct 9, 2019

Use "0.0" instead of "0" to force strings and be able to use comparison operations such as
gas_version >= "2.26" in Python 3.

Is that a safe comparison? e.g. What if gas_version is "2.3"?

I have no idea. gas_version has always been string like that, unless it had the integer value 0.

tools/gyp/pylib/gyp/MSVSNew.py Outdated Show resolved Hide resolved
tools/gyp/pylib/gyp/MSVSNew.py Outdated Show resolved Hide resolved
tools/gyp/pylib/gyp/MSVSNew.py Outdated Show resolved Hide resolved
tools/gyp/pylib/gyp/generator/make.py Show resolved Hide resolved
tools/gyp/pylib/gyp/generator/make.py Show resolved Hide resolved
tools/gyp/pylib/gyp/generator/make.py Show resolved Hide resolved
targos added 2 commits Oct 9, 2019
If GYP finds a string variable that can be converted to an integer,
it will do it when the variable is expanded. Use "0.0" instead of "0"
to force strings and be able to use comparison operations such as
`gas_version >= "2.26"` in Python 3.
@nodejs-github-bot

This comment has been minimized.

@sam-github

This comment has been minimized.

Copy link
Member

sam-github commented Oct 11, 2019

I'd be willing to rubber stamp this once @cclauss or someone more up to date on python weighs in.

Once question, @targos , is this CI-able? Do we have a windows CI machine with py3? I think that even if it did, we might currently "prefer" py2, so mere existence of py3 isn't enough yet.

I wonder, can Travis do a py3-only windows build?

@targos

This comment has been minimized.

Copy link
Member Author

targos commented Oct 11, 2019

is this CI-able? Do we have a windows CI machine with py3?

I don't know. I could try to add a github action to this PR that runs on Windows and remove it before landing.

  • py2 is tested in our CI and the results are OK
  • py3 was tested by me on my PC
@sam-github

This comment has been minimized.

Copy link
Member

sam-github commented Oct 11, 2019

If py3 works for you, that's good enough for now -- adding and removing an action to prove it isn't necessary from my perspective.

@cclauss

This comment has been minimized.

Copy link
Contributor

cclauss commented Oct 13, 2019

can Travis do a py3-only windows build?
Yes.

Copy link
Contributor

cclauss left a comment

Nice! Thanks for this.

targos added a commit that referenced this pull request Oct 13, 2019
Refs: nodejs/node-gyp#1820
Refs: nodejs/node-gyp#1843

PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Oct 13, 2019
If GYP finds a string variable that can be converted to an integer,
it will do it when the variable is expanded. Use "0.0" instead of "0"
to force strings and be able to use comparison operations such as
`gas_version >= "2.26"` in Python 3.

PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Oct 13, 2019
PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
@targos

This comment has been minimized.

Copy link
Member Author

targos commented Oct 13, 2019

Landed in 7de5a55...8728f86

@targos targos closed this Oct 13, 2019
@targos targos deleted the targos:gyp-python3-win branch Oct 13, 2019
targos added a commit that referenced this pull request Nov 8, 2019
Refs: nodejs/node-gyp#1820
Refs: nodejs/node-gyp#1843

PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Nov 8, 2019
If GYP finds a string variable that can be converted to an integer,
it will do it when the variable is expanded. Use "0.0" instead of "0"
to force strings and be able to use comparison operations such as
`gas_version >= "2.26"` in Python 3.

PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Nov 8, 2019
PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Nov 10, 2019
Refs: nodejs/node-gyp#1820
Refs: nodejs/node-gyp#1843

PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Nov 10, 2019
If GYP finds a string variable that can be converted to an integer,
it will do it when the variable is expanded. Use "0.0" instead of "0"
to force strings and be able to use comparison operations such as
`gas_version >= "2.26"` in Python 3.

PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos added a commit that referenced this pull request Nov 10, 2019
PR-URL: #29897
Reviewed-By: Christian Clauss <cclauss@me.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.