Uh oh!
There was an error while loading. Please reload this page.
module,win: fix long path resolve - #53294
Conversation
targos
commented
Jun 3, 2024
@nodejs/platform-windows |
3ee742c to
27a4505CompareI actually need more time to take a look, I think the implementation will solve the problem but I want to test in which cases we should include the UNC path, since we didn't do this in all paths in the toNamespacedPath.
H4ad
commented
Jun 3, 2024
There are some conditions to include the Lines 632 to 645 in 58711c2 Although the condition could be matched, I think it would be better to wait for the migration of Maybe we could include the @anonrig What do you think? |
nodejs-github-bot
commented
Jun 3, 2024
anonrig
left a comment
There was a problem hiding this comment.
I prefer to land this after the toNamespacedPath migration to C++. Unfortunately, I don't have the time to pursue this at the moment (afaict, there is only one failing test). I appreciate if you could took over that PR and apply these changes in a follow up PR.
MoLow
commented
Jun 3, 2024
in that case, can you convert the blocking "request changes" into a simple suggestion/friendly ask? I don't think this PR should be blocked on a PR that is not being currently worked on |
nodejs-github-bot
commented
Jun 4, 2024
huseyinacacak-janea
commented
Jun 5, 2024
Sure, no problem, I'll take over your PR and start working on it. |
27a4505 to
42b88bfCompare42b88bf to
14a1de0Comparenodejs-github-bot
commented
Jul 4, 2024
huseyinacacak-janea
commented
Jul 5, 2024
@anonrig I've rebased this PR to use toNamespacedPath. Could you please review it? |
huseyinacacak-janea
commented
Jul 15, 2024
Is there anything else I can do to help this PR move forward? |
| switch (FilePathIsFile(env, file_path)) { | ||
| Local<Value> local_file_path = | ||
| Buffer::Copy( | ||
| env->isolate(), file_path.c_str(), strlen(file_path.c_str())) |
There was a problem hiding this comment.
| env->isolate(), file_path.c_str(), strlen(file_path.c_str())) | |
| env->isolate(), file_path.c_str(), file_path.size()) |
There was a problem hiding this comment.
Fixed. Thanks.
| switch (FilePathIsFile(env, file_path)) { | ||
| Local<Value> local_file_path = | ||
| Buffer::Copy( | ||
| env->isolate(), file_path.c_str(), strlen(file_path.c_str())) |
| // Check if the path has a trailing slash. If so, add it after | ||
| // ToNamespacedPath() as it will be deleted by ToNamespacedPath() | ||
| bool slashCheck = !path_value.ToString().empty() && | ||
| path_value.ToString().back() == |
There was a problem hiding this comment.
| path_value.ToString().back() == | |
| path_value.ToStringView().ends_with |
| // Check if the path has a trailing slash. If so, add it after | ||
| // ToNamespacedPath() as it will be deleted by ToNamespacedPath() | ||
| bool slashCheck = !path_value.ToString().empty() && | ||
| path_value.ToString().back() == |
| bool slashCheck = !path_value.ToString().empty() && | ||
| path_value.ToString().back() == | ||
| std::filesystem::path::preferred_separator; | ||
| path_value.ToStringView().ends_with( |
There was a problem hiding this comment.
The previous line is not needed path_value.ToString() creates an unnecessary string.
Can you also remove this in other places?
Uh oh!
There was an error while loading. Please reload this page.
huseyinacacak-janea
commented
Jul 26, 2024
I've fixed the suggestions. Is there anything else I can do to help this PR move forward? |
QuantumQuin
commented
Aug 7, 2024
@anonrig Is there anything else we can do to help this PR move forward? I'm having many issues with long paths on Windows and am eager to get this fixed. |
nodejs-github-bot
commented
Aug 7, 2024
nodejs-github-bot
commented
Aug 8, 2024
nodejs-github-bot
commented
Aug 8, 2024
huseyinacacak-janea
commented
Aug 9, 2024
The failing test in the CI is a known flaky test. |
nodejs-github-bot
commented
Aug 9, 2024
nodejs-github-bot
commented
Aug 10, 2024
Landed in 37f9eca |
Several issues were encountered with module loading due to extended path lengths on Windows. These have been addressed with corrections implemented across four distinct code locations, accompanied by the addition of a corresponding test case for each to ensure functionality.
Additionally, I've moved
es-module/test-GH-50753.jstoes-module/test-esm-long-path-win.jsas the tests cover more cases than specified in that issue.Fixes: #50753