-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
node: warn if cwd is inaccessible during bootstrap #12022
Conversation
cee2c9b
to
f381a70
Compare
|
Ah ok, will write a test in a bit. |
lib/internal/bootstrap_node.js
Outdated
@@ -374,6 +374,9 @@ | |||
threw = false; | |||
} finally { | |||
if (threw) { | |||
process.emitWarning('The Current Working Directory was inaccessible.\n', |
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.
Can you lowercase Current Working Directory.
lib/internal/bootstrap_node.js
Outdated
@@ -374,6 +374,9 @@ | |||
threw = false; | |||
} finally { | |||
if (threw) { | |||
process.emitWarning('The Current Working Directory was inaccessible.\n', | |||
'Falling back to the executable\'s directory...', |
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.
Can you drop the last two dots.
lib/internal/bootstrap_node.js
Outdated
@@ -374,6 +374,9 @@ | |||
threw = false; | |||
} finally { | |||
if (threw) { | |||
process.emitWarning('The Current Working Directory was inaccessible.\n', |
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.
comma at the end of this line... did you mean to put a +
here instead?
ok, looks like there's more to it than this. Something loads
|
I think the solution there would probably be to overload |
f381a70
to
f14c96f
Compare
The cwd being removed is only supported for evaluating code. Not running "normally." I added a known issue test in #12343. We could add a better message for other scenarios, or set the cwd like we do for eval script. |
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Refs: nodejs#12022 PR-URL: nodejs#12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Ping @Fishrock123 |
Closing this due to a long inactivity. Please feel free to reopen if you want to follow up on this @Fishrock123 |
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Refs: nodejs#12022 PR-URL: nodejs#12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Backport-PR-URL: #15479 Refs: #12022 PR-URL: #12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
If the current working directory is removed, Node cannot start normally because the module system calls uv_cwd(). Backport-PR-URL: #15479 Refs: #12022 PR-URL: #12343 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
bootstrap
This was added/fixed in 2c6f79c and seems like it could be quite confusing, so... maybe we should warn? ¯\_(ツ)_/¯
I don't really know how to trigger this though, so no test... for now?
cc @bnoordhuis, maybe this isn't a good idea, idk.