FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build, win: vcbuild improvements by bzoz · Pull Request #17015 · nodejs/node · GitHub

/ node Public

build, win: vcbuild improvements - #17015

Closed
bzoz wants to merge 3 commits into
nodejs:masterfrom
JaneaSystems:bartek-nice-vcbuild
Closed

build, win: vcbuild improvements#17015
bzoz wants to merge 3 commits into
nodejs:masterfrom
JaneaSystems:bartek-nice-vcbuild

Conversation

bzoz commented Nov 14, 2017

Copy link
Copy Markdown
Contributor

Adds extra a check for proper Python version. If it is not found, vcbuild will exit early.

If no VS2017 installation is found, vswhere_usability_wrapper.cmd would print could not find "vswhere". This removes that message, making output look nicer for VS2015 compilation.

Finally, this adds support for DEBUG_HELPER to vcbuild.bat. Similar to vswhere_usability_wrapper.cmd and find_python.cmd, if DEBUG_HELPER environment variable is set, echo off will not be called, making debugging easier.

Fixes: #16864

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

build

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 Nov 14, 2017

bzoz commented Nov 14, 2017

Copy link
Copy Markdown
Contributor Author

bzoz commented Nov 16, 2017

Copy link
Copy Markdown
Contributor Author

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

seishun commented Nov 16, 2017

Copy link
Copy Markdown
Contributor

This removes that message, making output look nicer for VS2015 compilation.

Will it still be relevant once #16969 is merged?

bzoz commented Nov 16, 2017

Copy link
Copy Markdown
Contributor Author

Yes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can we keep this. Or upstream to https://github.com/node4good/msvs-com-helper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This removes that message, making output look nicer for VS2015 compilation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

we just dropped "official" VS2015 support 🤷‍♂️

If you still want to keep output clean, I'd rather you change the call in vcbuild

call tools\msvs\vswhere_usability_wrapper.cmd
to:

if defined DEBUG_HELPER (call tools\msvs\vswhere_usability_wrapper.cmd)
else (call tools\msvs\vswhere_usability_wrapper.cmd > nul)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

If you still want to keep output clean, I'd rather you change the call in vcbuild

I'd prefer to keep vcbuild clean too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Even without 2015, if no VS2017 is found, it will look like this:

Looking for Visual Studio 2017
could not find "vswhere"
Failed to find a suitable Visual Studio installation.
Try to run in a "Developer Command Prompt" or consult
https://github.com/nodejs/node/blob/master/BUILDING.md#windows-1

I don't think it looks good, and the could not find "vswhere" is only helpful if you know vcbuild internals. We can use DEBUG_HELPER to debug vcbuild if needed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Ok, I'll move it upstream.

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

YAASS! (I have this floating in all my workspaces, and I keep forgetting to upstream it)

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
  1. :run-python will echo Could not find python2 so IMHO no need to echo again. (L561)
  2. should end subroutine with either exit /b or goto :EOF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Agree, let's not duplicate the validation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

:run-python is very verbose, especially if no Python is found (see #16864). Stdout and stderr is redirected to nul, to keep it clean.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Then maybe :run-python should be fixed. I was planning to do it myself, I think it's a simple error in the code.

bzoz commented Nov 22, 2017

Copy link
Copy Markdown
Contributor Author

Updated, PTAL

Comment thread vcbuild.bat Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is ugly. Basically, we run tools\getnodeversion.py, ignore the output, exit if it failed, then run it again, this time directly using a variable that's supposed to be internal to find_python.cmd.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

could change the fake call to call :run-python --version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It would still be a hacky workaround for the limitation of run-python.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No argument here. This file has a lot of cmdism hacks, mainly because you can't redirect stdout into a variable.
I'll check if there's a way to use call as the for command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I've checked before, there isn't. So a subroutine doesn't work as a replacement for the python command.

An alternative would be to replace run-python with find-python that would just populate a variable to be used instead of python. But then one would have to make sure that find-python is run before the first usage of Python and that it's not run if Python isn't needed, whenever a significant change is introduced into vcbuild.bat.

Honestly, I'd prefer to just revert 614dbbd since it introduces a lot of complexity in order to support an edge case that has never affected anyone to my knowledge. IMO it was landed prematurely (only one approval and not thoroughly tested).

bzoz commented Nov 29, 2017

Copy link
Copy Markdown
Contributor Author

Updated, PTAL.

bzoz commented Dec 4, 2017

Copy link
Copy Markdown
Contributor Author

ping?

seishun commented Dec 4, 2017

Copy link
Copy Markdown
Contributor

Unfortunately, my comment in #17298 (comment) applies here as well, so I cannot approve this.

bnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not the resident domain expert but LGTM, FWIW.

bzoz commented Dec 7, 2017

Copy link
Copy Markdown
Contributor Author

@seishun it does not fix all issues, but at least makes vcbuild slightly more user friendly without breaking anything. IMO it will be better to wait for proper python fix with this version, rather that the one from master.

bzoz commented Dec 21, 2017

Copy link
Copy Markdown
Contributor Author

If nobody oposes, I will land this tomorrow

seishun left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Blocking until either #17293 or #17804 lands due to the aforementioned reasons.

Removes extra erroor messages when Python is not installed. Removes
"vswhere not found" message when no VS2017 installation is found.
Adds support for DEBUG_HELPER to vcbuild.bat.

Fixes: nodejs#16864
bzoz force-pushed the bartek-nice-vcbuild branch from 141e517 to 766aa49 Compare February 15, 2018 10:19
seishun dismissed their stale review February 15, 2018 10:22

#18621 has landed

BridgeAR added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Feb 17, 2018

Copy link
Copy Markdown
Member

Comment thread vcbuild.bat Outdated
call tools\msvs\find_python.cmd
if errorlevel 1 echo Could not find python2 & goto :exit
echo Looking for Python 2.x
call tools\msvs\find_python.cmd > NUL 2> NUL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can the noise not be fixed inside find_python.cmd itself?

Comment thread vcbuild.bat Outdated
if errorlevel 1 echo Could not find python2 & goto :exit
echo Looking for Python 2.x
call tools\msvs\find_python.cmd > NUL 2> NUL
if errorlevel 1 echo Could not find Python installation & goto :exit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd drop "installation".

BridgeAR removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Feb 17, 2018

bzoz commented Feb 19, 2018

Copy link
Copy Markdown
Contributor Author

bzoz commented Feb 19, 2018

Copy link
Copy Markdown
Contributor Author

I've moved error messages to find_python.cmd. This way we can have special error message when we find Python, but the version is incorrect.

bzoz commented Feb 21, 2018

Copy link
Copy Markdown
Contributor Author

CI after update: https://ci.nodejs.org/job/node-test-pull-request/13300/

Can I get +1?

seishun commented Feb 21, 2018

Copy link
Copy Markdown
Contributor

I don't really see the point in separating error messages for "No Python found at all" and "Python 2.x specifically not found". Isn't the action to be taken by the user the same in both cases?

bzoz commented Feb 21, 2018

Copy link
Copy Markdown
Contributor Author

Its mostly for the new people, like in Code + Learn, etc. If they have Python 3 installed, vcbuild complaining about "no python" will be confusing for some people. Telling them "I've found python but the version is wrong" makes it clear whats the problem.

gibfahn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Generally LGTM, but would be good to get another review from @nodejs/platform-windows

seishun commented Feb 21, 2018

Copy link
Copy Markdown
Contributor

If they have Python 3 installed, vcbuild complaining about "no python" will be confusing for some people.

I'd say "No Python 2.x" is sufficient for both cases. Mentioning a Python 3.x installation seems excessive, it's just a different product (i.e. you can have both installed).

bzoz commented Feb 21, 2018

Copy link
Copy Markdown
Contributor Author

Sure, saying "you don't have python2.x" is sufficient. But saying "you have wrong python version" is more helpful.

seishun commented Feb 21, 2018

Copy link
Copy Markdown
Contributor

It's also misleading because it suggests it should be replaced with python 2.x.

gibfahn commented Feb 21, 2018

Copy link
Copy Markdown
Member

It's also misleading because it suggests it should be replaced with python 2.x.

In that case wouldn't the answer be to be more specific rather than less, i.e. something like:

Found Python 3 but not Python 2. Please install Python 2.6 or 2.7.

?

bzoz commented Feb 22, 2018

Copy link
Copy Markdown
Contributor Author

It will say Python found in [...], but it is not v2.x..

Again, this is to help out new people on the project, like in Code + Learn. The more info we provide the better. And easier for people running such workshops to get everyone started with developing Node.

I would like to land this, @seishun are you -1 on this?

seishun commented Feb 22, 2018

Copy link
Copy Markdown
Contributor

I can't imagine a situation where this extra info would help new people. If anything, it's confusing because they might think they should uninstall Python 3.x.

I'm -0 on this.

bzoz commented Feb 22, 2018

Copy link
Copy Markdown
Contributor Author

I'm gonna land this then.

bzoz commented Feb 22, 2018

Copy link
Copy Markdown
Contributor Author

Landed in 887a2ba

bzoz closed this Feb 22, 2018
bzoz added a commit that referenced this pull request Feb 22, 2018
Removes extra erroor messages when Python is not installed. Removes
"vswhere not found" message when no VS2017 installation is found.
Adds support for DEBUG_HELPER to vcbuild.bat.

Fixes: #16864

PR-URL: #17015
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
addaleax pushed a commit to addaleax/node that referenced this pull request Feb 26, 2018
Removes extra erroor messages when Python is not installed. Removes
"vswhere not found" message when no VS2017 installation is found.
Adds support for DEBUG_HELPER to vcbuild.bat.

Fixes: nodejs#16864

PR-URL: nodejs#17015
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
addaleax pushed a commit that referenced this pull request Feb 26, 2018
Removes extra erroor messages when Python is not installed. Removes
"vswhere not found" message when no VS2017 installation is found.
Adds support for DEBUG_HELPER to vcbuild.bat.

Fixes: #16864

PR-URL: #17015
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
addaleax mentioned this pull request Feb 27, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Removes extra erroor messages when Python is not installed. Removes
"vswhere not found" message when no VS2017 installation is found.
Adds support for DEBUG_HELPER to vcbuild.bat.

Fixes: nodejs#16864

PR-URL: nodejs#17015
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>

Copy link
Copy Markdown
Contributor

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

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

vcbuild explodes is Python is not installed

8 participants


Back | FazBrowse Home | New Git URL