-
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
src: allow absolute paths for --env-file
#49232
Conversation
Review requested:
|
430d035
to
6b9587b
Compare
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.
nit: we could limit the number of "magic strings" by using fixtures.path
now that absolute paths are supported. This maybe deserves its own PR to refactor the other tests, so feel free to ignore for this PR.
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.
LGMT. +1 to the comments
@nodejs/build It seems Any suggestions on the correct path to take? Referencing build logs:
|
6b9587b
to
127d263
Compare
This PR is blocked by the Node.js CI machines having old GCC versions, despite the documentation saying GCC>9 is supported. cc @nodejs/build |
@nodejs/build any chance anyone can take a look at the GCC version on the buiild machine? |
Blocked by nodejs/build#3317 |
e9fa8c9
to
1e0ca25
Compare
Fixed conflicts, rebased and force pushed. |
Hi! Is there anything blocking this pr from being merged? The feature will be quite useful in scripts. |
gcc 10 support is missing from certain CI machines. waiting for it to land to unblock this PR. |
@@ -124,6 +124,7 @@ | |||
#include <cstdio> | |||
#include <cstdlib> | |||
#include <cstring> | |||
#include <filesystem> |
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 would recommend adding a comment here that <filesystem>
is imported only to support path-processing operations and not actually performing any file system operations (which should always go through libuv)
std::string path = cwd + kPathSeparator + file_path; | ||
per_process::dotenv_file.ParsePath(path); | ||
if (file_path.is_absolute()) { | ||
per_process::dotenv_file.ParsePath(file_path.string()); | ||
} else { | ||
std::string path = cwd + kPathSeparator + file_path.string(); | ||
per_process::dotenv_file.ParsePath(path); | ||
} |
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.
Could you add a comment explaining why it is necessary to construct an absolute path here?
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 don't see why any of this is necessary, so I've opened #51425 as an alternative.
Closing in favor of #51425 |
Ref: #49148