-
Notifications
You must be signed in to change notification settings - Fork 30k
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,win: replace find-python subroutine with PYTHON variable #17804
Conversation
A subroutine does not work as a replacement for the `python` command since one cannot use a subroutine call in a `for /F` loop.
CI: https://ci.nodejs.org/job/node-test-pull-request/12247/ cc @nodejs/build @nodejs/platform-windows |
@@ -232,7 +235,8 @@ goto run | |||
if defined noprojgen goto msbuild | |||
|
|||
@rem Generate the VS project. | |||
call :run-python configure %configure_flags% | |||
echo configure %configure_flags% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%PYTHON%
in here would be nice
@@ -448,7 +452,8 @@ if defined no_cctest echo Skipping cctest because no-cctest was specified && got | |||
echo running 'cctest %cctest_args%' | |||
"%config%\cctest" %cctest_args% | |||
:run-test-py | |||
call :run-python tools\test.py %test_args% | |||
echo running 'python tools\test.py %test_args%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, running '%PYTHON% ...
This approach sgtm, I don't really see the problem here though @seishun:
You have it at the top of the file, just under arg parsing, so any major changes are going to have to be above that line and it's not highly likely those changes would have a use for python above there anyway. To be extra sure you could just add a comment in the file to explain why it's being called so future committers have a warning at least. |
Ping @seishun |
@bzoz If you mean the scenario where Python is installed but not added to PATH, then it doesn't work too well - it prints some error messages before proceeding with the build, then leaks PATH modifications to the
Since no one has reported these issues, I suspect very few people, if any, rely on this scenario. |
#17015 will fix the error messages, I guess we do not get reports, because after all compilation works, and those error messages are covered by miles of compilation output. Since the code is already here, it works, and it is not a chore to maintain I don't see a reason to drop a supported scenario. |
It does carry a maintenance burden as explained in OP. Whether it's greater than the usefulness of this scenario is subjective, so we probably won't convince each other. Unless TSC chimes in, I'll just land the PR that gains more approvals. |
The other PR has -1 from @refack, so only this PR can land. |
There was a lot of discussion after he requested changes. I asked him if it's still relevant in #17293 (comment) and didn't get a response. |
I think it is still relevant and I'm also -1 for that PR. If you trace #13900 it is a fix for a real issue described in nodejs/CTC#147 (comment). |
@seishun would you be so kind and address the comments? As soon as that is done I would go ahead and land this. |
I am going to close this since a mentioned alternative has landed. @seishun if this is not correct, please reopen. |
A subroutine does not work as a replacement for the
python
commandsince one cannot use a subroutine call in a
for /F
loop.Similarly to #17298 and #17015, this introduces a maintenance burden: namely, whenever significant changes are introduced in
vcbuild.bat
, one has to make surefind_python.cmd
is called before the first Python usage. Consequently, I would prefer #17293 to be landed instead.Checklist
Affected core subsystem(s)
build