Skip to content

Conversation

@anonrig
Copy link
Member

Ref: #49148

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/startup

@anonriganonrig mentioned this pull request Aug 18, 2023
8 tasks
@nodejs-github-botnodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Aug 18, 2023
@anonriganonrigforce-pushed the allow-absolute-paths-for-dotenv branch 3 times, most recently from 430d035 to 6b9587bCompareAugust 18, 2023 19:40
@anonriganonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 18, 2023
@anonriganonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 19, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 19, 2023
@nodejs-github-bot
Copy link
Collaborator

Copy link
Contributor

@aduh95aduh95 left a 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.

Copy link
Member

@MoLowMoLow left a 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

@anonrig
Copy link
MemberAuthor

anonrig commented Aug 21, 2023

@nodejs/build It seems ubuntu 18.04 does not have the proper declarations for std::filesystem. Quick google search recommended: make LDLIBS=-lstdc++fs.

Any suggestions on the correct path to take?

Referencing build logs:

00:07:49.449 node.cc:(.text+0x2ee4): undefined reference to `std::filesystem::__cxx11::path::has_root_directory() const' 00:07:49.482 /home/iojs/build/workspace/node-test-commit-arm/out/Release/obj.target/libnode/src/node_dotenv.o: In function `node::Dotenv::GetPathFromArgs(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)': 

@anonriganonrigforce-pushed the allow-absolute-paths-for-dotenv branch from 6b9587b to 127d263CompareAugust 21, 2023 15:14
@anonriganonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 21, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 21, 2023
@nodejs-github-bot
Copy link
Collaborator

@anonrig
Copy link
MemberAuthor

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

@anonriganonrig added the blocked PRs that are blocked by other issues or PRs. label Aug 29, 2023
@GeoffreyBoothGeoffreyBooth added the cli Issues and PRs related to the Node.js command line interface. label Sep 2, 2023
@benjamingr
Copy link
Member

@nodejs/build any chance anyone can take a look at the GCC version on the buiild machine?

@anonrig
Copy link
MemberAuthor

Blocked by nodejs/build#3317

@anonriganonrigforce-pushed the allow-absolute-paths-for-dotenv branch from e9fa8c9 to 1e0ca25CompareOctober 10, 2023 13:45
@anonrig
Copy link
MemberAuthor

Fixed conflicts, rebased and force pushed.

@anonriganonrig added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 10, 2023
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 10, 2023
@nodejs-github-bot
Copy link
Collaborator

@anonriganonrig removed the blocked PRs that are blocked by other issues or PRs. label Oct 10, 2023
@nikelborm
Copy link

Hi! Is there anything blocking this pr from being merged? The feature will be quite useful in scripts.

@anonrig
Copy link
MemberAuthor

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.

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<filesystem>
Copy link
Member

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)

Comment on lines -861 to +867
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);
}
Copy link
Member

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?

Copy link
Member

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.

@anonrig
Copy link
MemberAuthor

Closing in favor of #51425

@anonriganonrig closed this Jan 12, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++Issues and PRs that require attention from people who are familiar with C++.cliIssues and PRs related to the Node.js command line interface.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@anonrig@nodejs-github-bot@benjamingr@nikelborm@jasnell@GeoffreyBooth@tniessen@UlisesGascon@MoLow@aduh95