Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
build: allow running configure from any directory#17321
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
jasnell commented Nov 26, 2017
One thing: this should either chdir back to the original directory or should print a warning to the console that the directory was changed, just as a friendly heads up to the user. |
bnoordhuis left a comment
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.
@jasnell Not necessary, the pwd is a per-process property.
(That's coincidentally why cd is always a shell built-in, you can't implement it as a separate binary.)
jasnell commented Nov 26, 2017
heh... oh bah, that's right ;-) ... |
refack commented Nov 27, 2017
@jasnell might have been thinking about batch files, or shell scripts. |
configure Outdated
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.
You're shifting from rel-path to abs for root_dir, it might have impact WRT spaces or unicode in the base path, and it's hard to test...
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.
Good point.
I tried it with spaces+UTF-8, and it works on macOS, could you maybe try something similar for windows?
~/wrk/诺 德/node
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.
D:\code\node-u诺 德github-desktop$ vcbuild x64 Looking for Visual Studio 2017 Found MSVS version 15.0 "C:\bin\dev\python27\python.exe" configure --dest-cpu=x64 --tag= Traceback (most recent call last): File "configure", line 40, in <module> os.chdir(root_dir) WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\code\\node-u? ?github-desktop' Failed to create vc project files. With or without PYTHONIOENCODING=UTF-8
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.
I've tried messing around with this, but didn't find the right incantation.
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.
So that works with the relative path but not the absolute one? If so I guess we should go back to relative paths.
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.
Well, this works:
root_dir=os.path.dirname(__file__) root_dirandos.chdir(root_dir)
gibfahnNov 28, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
That doesn't work for me unless you then unset root_dir. Pushed a commit with that change.
▶▶▶ node/configure~/wrk/comTraceback (mostrecentcalllast): File"node/configure", line49, in<module>fromgyp.commonimportGetFlavorImportError: Nomodulenamedgyp.commonjasnell commented Nov 27, 2017
I was :) |
gibfahn commented Nov 28, 2017
Okay, so AFAICT we don't need |
refack left a comment
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.
nice
refack commented Nov 28, 2017
That's a great proof that if we figure out path idiosyncrasies in |
configure Outdated
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.
You could write this as:
os.chdir(os.path.dirname(__file__) or'.')Which might make it more obvious that os.path.dirname('configure') == ''.
Or maybe that's just me.
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.
I like it, added.
gibfahn commented Dec 10, 2017
PR-URL: nodejs#17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: #17321 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
build