-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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: Fix python path resolution in configure #16460
Conversation
@digitalinfinity what's the use case? Are you using a shebang simulating mechanism? IMHO on windows we should use |
Or you can call https://github.com/nodejs/node/blob/master/tools/msvs/find_python.cmd (Windows FTW!) BTW in the new "Opinionated dev shell" I'm writing we won't need that ;) |
There is a discrepancy between the paths derived through As an aside, I'm a python neophyte so if there is a better way in python to do this, happy to update the PR Edit: formatting |
So I'll push a suggestion. |
/cc @nodejs/platform-windows |
I like your suggestion better- I'd just add a check in |
configure
Outdated
@@ -1460,7 +1460,8 @@ if options.prefix: | |||
|
|||
config = '\n'.join(map('='.join, config.iteritems())) + '\n' | |||
|
|||
bin_override = get_bin_override() | |||
# On Windows there's no reason to search for a differnt python binary |
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.
differnt -> different (@refack)
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.
Aside: the function is not well-named. It suggests it just looks up something but it does all kinds of things as a side effect. Maybe make_bin_override()
?
Thanks @refack - the new changes look good to me! |
I won't ✔️ my own code, so we need a 3rd party 😃 |
def get_bin_override(): | ||
def make_bin_override(): | ||
if sys.platform == 'win32': | ||
raise Exception('make_bin_override should not be called on win32.') |
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.
Does WSL's sys.platform
identify as win32
?
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.
It says linux2
PR-URL: nodejs#16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: nodejs/node#16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: nodejs/node#16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: #16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: nodejs/node#16460 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
The check to validate whether the current python process is the same as
the one resolved from the current path fails if the paths differ by case
which can happen on an operating system with case insensitive file
system behavior like Windows. Canonicalize it by converting both to
lower case if running on Windows.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
build