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

build,windows: Implement python detection #13900

Merged
merged 1 commit into from
Jun 28, 2017

Conversation

refack
Copy link
Contributor

@refack refack commented Jun 24, 2017

According to PEP 514

Fixes: #13882

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

build,tools,windows

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. install Issues and PRs related to the installers. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform. labels Jun 24, 2017
@refack refack self-assigned this Jun 24, 2017
@refack
Copy link
Contributor Author

refack commented Jun 24, 2017

@refack
Copy link
Contributor Author

refack commented Jun 24, 2017

New CI: https://ci.nodejs.org/job/node-compile-windows/10007/

/cc @nodejs/build @nodejs/platform-windows

vcbuild.bat Outdated
@@ -513,8 +519,9 @@ rem ***************
set NODE_VERSION=
set TAG=
set FULLVERSION=

for /F "usebackq tokens=*" %%i in (`python "%~dp0tools\getnodeversion.py"`) do set NODE_VERSION=%%i
:: Call as subrutine for validation of python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subroutine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

@refack
Copy link
Contributor Author

refack commented Jun 27, 2017

ping @nodejs/build @nodejs/platform-windows @nodejs/python @benjamingr @tniessen
Anyone wants to review

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the suggested changes. I think we should just deploy it and wait for people to complain about build problems, it is the only way to find out if there are any incompatibilities. It won't make things worse than they are as python will still be used if it is in the PATH.

:: Helper subroutine to handle quotes in %1
:find-main-branch
SET main_key="%~1\Python\PythonCore"
REG QUERY %main_key% /s | findstr "2." | findstr InstallPath > NUL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prints error messages to my console before finding the correct key... Maybe add 2>&1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

)
EXIT /B 1

:: Check if %p% hold a path to a real python2 executable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

holdholds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack.

@refack
Copy link
Contributor Author

refack commented Jun 27, 2017

LGTM with the suggested changes. I think we should just deploy it and wait for people to complain about build problems, it is the only way to find out if there are any incompatibilities. It won't make things worse than they are as python will still be used if it is in the PATH.

Just an FYI, there are quite a few downstream builders, all sort of projects that build their own node.exe. Just one (not favorable) example — http://blog.sec-consult.com/2017/04/application-whitelisting-application.html
I agree this should only make things better, since first thing we look in the path (the current status quo)

@refack refack merged commit 614dbbd into nodejs:master Jun 28, 2017
@refack refack deleted the vcbuild-detect-python branch June 28, 2017 15:51
@refack
Copy link
Contributor Author

refack commented Jun 28, 2017

@@ -550,7 +557,4 @@ if not "%DISTTYPE%"=="custom" (
set TAG=%DISTTYPE%%DATESTRING%%COMMIT%
)
set FULLVERSION=%NODE_VERSION%-%TAG%

:exit
if not defined DISTTYPEDIR set DISTTYPEDIR=%DISTTYPE%
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@refack I was not able to do a careful review of this PR, but this line caught my eye. Is there a good reason for completely removing this? I believe this will completely break or release process, if DISTTYPEDIR is not set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this breaks. Will try a fix in the build script instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops. Opening a reversion PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I removed it because of :exit is redefined from L511
Fix PR #13969

@refack refack mentioned this pull request Jun 28, 2017
2 tasks
addaleax pushed a commit that referenced this pull request Jun 29, 2017
@addaleax addaleax mentioned this pull request Jun 29, 2017
refack added a commit to refack/node that referenced this pull request Jun 30, 2017
* rename :exit to :distexit

PR-URL: nodejs#13969
Refs: nodejs#13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
@refack
Copy link
Contributor Author

refack commented Jun 30, 2017

Land with #13969

addaleax pushed a commit to addaleax/node that referenced this pull request Jul 3, 2017
* rename :exit to :distexit

PR-URL: nodejs#13969
Refs: nodejs#13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
addaleax pushed a commit that referenced this pull request Jul 11, 2017
addaleax pushed a commit that referenced this pull request Jul 11, 2017
* rename :exit to :distexit

PR-URL: #13969
Refs: #13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
addaleax pushed a commit that referenced this pull request Jul 18, 2017
addaleax pushed a commit that referenced this pull request Jul 18, 2017
* rename :exit to :distexit

PR-URL: #13969
Refs: #13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
@MylesBorins
Copy link
Contributor

Should this be backported to v6.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

Please include all patches needed to make this atomic change work

refack added a commit to refack/node that referenced this pull request Aug 15, 2017
refack added a commit to refack/node that referenced this pull request Aug 15, 2017
* rename :exit to :distexit

PR-URL: nodejs#13969
Refs: nodejs#13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
@refack
Copy link
Contributor Author

refack commented Aug 15, 2017

Backport PR #14842

MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
Backport-PR-URL: #14842
PR-URL: #13900
Fixes: #13882
Reviewed-By: Tobias Nießen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Aug 16, 2017
* rename :exit to :distexit

Backport-PR-URL: #14842
PR-URL: #13969
Refs: #13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Aug 16, 2017
MylesBorins pushed a commit that referenced this pull request Sep 5, 2017
Backport-PR-URL: #14842
PR-URL: #13900
Fixes: #13882
Reviewed-By: Tobias Nießen <[email protected]>
MylesBorins pushed a commit that referenced this pull request Sep 5, 2017
* rename :exit to :distexit

Backport-PR-URL: #14842
PR-URL: #13969
Refs: #13900 (review)
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: João Reis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
@refack refack removed their assignment Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. install Issues and PRs related to the installers. tools Issues and PRs related to the tools directory. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

build,windows: vcbuild.bat should try to detect location of python.exe
7 participants