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

Revert "build,windows: implement PEP514 python detection" by seishun · Pull Request #17293 · nodejs/node · GitHub

/ node Public

Revert "build,windows: implement PEP514 python detection" - #17293

Closed
seishun wants to merge 1 commit into
nodejs:masterfrom
seishun:revert-13900
Closed

Revert "build,windows: implement PEP514 python detection"#17293
seishun wants to merge 1 commit into
nodejs:masterfrom
seishun:revert-13900

Conversation

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor

This reverts commit 614dbbd.

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 25, 2017

Copy link
Copy Markdown
Member

Can you add more detail to the commit log?

This reverts commit 614dbbd.

A subroutine does not work as a replacement for the `python` command
since one cannot use a subroutine call in a `for /F` loop. As a
workaround, that commit introduced code that calls :run-python just to
populate an internal variable, then uses it directly. That sacrifices
clarity to support a rare use case and causes surprising behavior when
Python is not found.

Fixes: #16864

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

@bnoordhuis done, PTAL.

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

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

Thanks, LGTM.

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

Requesting fast-track since this is a revert.

seishun added the fast-track PRs that do not need to wait for 48 hours to land. label Nov 25, 2017

Copy link
Copy Markdown
Member

Go for it.

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

@evanlucas do you approve just the pull request, or also the fast-tracking request?

The pull request can be landed once 2 or more collaborators approve both the pull request and the fast-tracking request, and the necessary CI testing is done.

Copy link
Copy Markdown
Contributor

@seishun both, sorry, I should have clarified. +1 to fast tracking

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

Thanks, going to land in 24 hours if there are no objections.

refack 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

I think the motivation is low nither for a revert of a commit that landed 5 months ago, nor for fast-track.

refack 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

I think the motivation is low nither for a revert of a commit that landed 5 months ago, nor for fast-track.

refack commented Nov 25, 2017

Copy link
Copy Markdown
Contributor

That sacrifices clarity to support a rare use case and causes surprising behavior when Python is not found.

The "rare use case" has been reported by many first time users (nodejs/CTC#147 (comment)), and has not been reported since.

P.S. this PR does not CC the relevant parties @nodejs/build @nodejs/platform-windows

seishun commented Nov 25, 2017

Copy link
Copy Markdown
Contributor Author

The report you linked looks like hearsay. It might as well have been a misunderstanding. Either way:

In particular, BUILDING.md on Windows does not elaborate on adding Python to the path file..

That should be fixed. Running tests already requires tools from Git for Windows to be in PATH, so requiring Python as well seems reasonable.

refack commented Nov 25, 2017

Copy link
Copy Markdown
Contributor

#17298 has a proposed fix that improves the error message without losing PEP514 detection

Copy link
Copy Markdown
Member

That should be fixed. Running tests already requires tools from Git for Windows to be in PATH, so requiring Python as well seems reasonable.

For what it's worth, not a single first timer had issues with git in path (since they typically used git bash to build anyway) - but a few had issues with Python.

I'm not expressing an opinion about whether or not Node.js should help users in such cases - it was clear though.

seishun commented Nov 26, 2017

Copy link
Copy Markdown
Contributor Author

since they typically used git bash to build anyway

vcbuild doesn't work in Git Bash though.

gibfahn commented Nov 26, 2017

Copy link
Copy Markdown
Member

Requesting fast-track since this is a revert.

I don't think revert automatically means fast-track.

Fixes #16864

Isn't that just a case of an unhelpful error message? Python is required to actually build and test node right?

That sacrifices clarity to support a rare use case and causes surprising behavior when Python is not found.

We landed changes to configure to do similar things to help users confused by the python2 python3 thing, this doesn't seem that different.

node/configure

Lines 3 to 12 in 9de15de

# Locate python2 interpreter and re-execute the script. Note that the
# mix of single and double quotes is intentional, as is the fact that
# the ] goes on a new line.
_=[ 'exec' '/bin/sh' '-c' '''
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
which python2 >/dev/null && exec python2 "$0" "$@"
exec python "$0" "$@"
''' "$0" "$@"
]
del _

I think trying to help users out on Windows is a good thing to do, so I'd rather we fix the issue (e.g. with #17298) than just revert.

The report you linked looks like hearsay. It might as well have been a misunderstanding. Either way:

Are you saying you think there is no scenario in which this change helps people?

seishun commented Nov 26, 2017

Copy link
Copy Markdown
Contributor Author

I don't think revert automatically means fast-track.

No, but it means I can request it.

We landed changes to configure to do similar things to help users confused by the python2 python3 thing, this doesn't seem that different.
Are you saying you think there is no scenario in which this change helps people?

I think we're talking about different things. I'm all for helpful error messages, but going out of our way to locate Python when it's not in PATH seems excessive.

gibfahn commented Nov 26, 2017

Copy link
Copy Markdown
Member

Requesting fast-track since this is a revert.
No, but it means I can request it.

Okay, I guess I misunderstood what you meant by since (I hadn't seen the latest update to the Collaborator Guide).

I think we're talking about different things. I'm all for helpful error messages, but going out of our way to locate Python when it's not in PATH seems excessive.

If it can be made to work, and it makes life easier for users, and it's not too difficult to maintain, I don't see the harm in it. In my experience people who install things through GUIs (e.g. me before I started using Linux 😁 ) rarely have experience manually modifying their paths, so why not help them?

seishun commented Nov 26, 2017

Copy link
Copy Markdown
Contributor Author

If it can be made to work, and it makes life easier for users, and it's not too difficult to maintain, I don't see the harm in it.

It does add a maintenance burden, at least in the current form: #17298 (comment)

rarely have experience manually modifying their paths, so why not help them?

The Python installer has an option to add it to PATH. I suppose we could mention that.

gibfahn commented Nov 26, 2017

Copy link
Copy Markdown
Member

If it can be made to work, and it makes life easier for users, and it's not too difficult to maintain

It does add a maintenance burden, at least in the current form: #17298 (comment)

I'm hoping @refack can get #17298 to a point where everyone is happy with it.

The Python installer has an option to add it to PATH. I suppose we could mention that.

Probably, although I think #17046 should make life much easier for people who don't already have it installed. This seems more for people who already have it, but didn't tick that box.

seishun commented Nov 26, 2017

Copy link
Copy Markdown
Contributor Author

This seems more for people who already have it, but didn't tick that box.

As in, people who have already been using Python for some time, but somehow never added it to PATH? That seems an unlikely combination.

benjamingr commented Nov 26, 2017
edited
Loading

Copy link
Copy Markdown
Member

As in, people who have already been using Python for some time, but somehow never added it to PATH? That seems an unlikely combination.

Again - this is something that's been happening in practice. I'm fine with mentioning it in the guide, having an FAQ, or taking a different approach than @refack's fix.

I'm less fine with fast-tracking non-breaking changes in development setup without giving the collaborator who landed them chance to respond. It's not your fault since you followed protocol - we should probably PR the collaborator guide and amend that.

refack commented Nov 26, 2017

Copy link
Copy Markdown
Contributor

The root cause is that the GUI installer does not add python to PATH by default (because of the adoption of PEP514):

So we should keep changes around this in coordination with #17046 (a silent install will probably not add python to PATH)

seishun commented Nov 27, 2017

Copy link
Copy Markdown
Contributor Author

Git for Windows doesn't add Unix tools required for vcbuild test to PATH by default either:

The Boxstarter script in #17046 uses the /GitAndUnixToolsOnPath parameter, perhaps there's something similar for Python?

bzoz commented Nov 27, 2017

Copy link
Copy Markdown
Contributor

Boxstarter python is added to the PATH

seishun commented Dec 28, 2017

Copy link
Copy Markdown
Contributor Author

@nodejs/collaborators we need to decide whether to merge this PR or #17804. The reasons why I prefer this one are mentioned in #17804. This PR has 3 approvals and 1 change request (not sure if it's still relevant? cc @refack), the other one has 2 approvals, so the opinions seem divided.

tniessen removed the fast-track PRs that do not need to wait for 48 hours to land. label Jan 7, 2018
BridgeAR requested a review from a team January 31, 2018 02:17

BridgeAR commented Feb 7, 2018

Copy link
Copy Markdown
Member

I am closing this as it seems like a decision is needed. This was blocked by @refack and there is a alternative without real complaints. @seishun if you feel differently, please reopen.

seishun commented Feb 7, 2018

Copy link
Copy Markdown
Contributor Author

I would prefer to keep this open until either #17804 or #18621 lands.

seishun reopened this Feb 7, 2018

Copy link
Copy Markdown
Member

I am going to close this since a mentioned alternative has landed. @seishun if this is not correct, please reopen.

BridgeAR closed this Feb 16, 2018
seishun deleted the revert-13900 branch February 16, 2018 19:00
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

Back | FazBrowse Home | New Git URL