| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@nodejs/platform-windows |
Sorry, something went wrong.
I 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.
|
There are some conditions to include the UNC that you are not following: Lines 632 to 645 in 58711c2 Although the condition could be matched, I think it would be better to wait for the migration of toNamespacedPath to C++. Maybe we could include the ToNamespacePath port in this PR, and then leave that other PR just to remove the JS version and rewrite the places they are used. @anonrig What do you think? |
Sorry, something went wrong.
Sorry, something went wrong.
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.
Sorry, something went wrong.
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 |
Sorry, something went wrong.
Sorry, something went wrong.
Sure, no problem, I'll take over your PR and start working on it. |
Sorry, something went wrong.
Sorry, something went wrong.
@anonrig I've rebased this PR to use toNamespacedPath. Could you please review it? |
Sorry, something went wrong.
|
Is there anything else I can do to help this PR move forward? |
Sorry, something went wrong.
| 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()) |
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed. Thanks.
Sorry, something went wrong.
| 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.
ditto
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
| // 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 |
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
| // 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.
ditto
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
| 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?
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed.
Sorry, something went wrong.
|
I've fixed the suggestions. Is there anything else I can do to help this PR move forward? |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
The failing test in the CI is a known flaky test. |
Sorry, something went wrong.
Sorry, something went wrong.
The old comment blamed a Node bug: package.json read silently failing past
MAX_PATH, so `{"type":"module"}` was missed and ESM parsed as CJS. That was
fixed in Node 22.7.0 (nodejs/node#53294, which namespaces fs, ESM resolution
and package.json reads) and this package requires >=22.9.0, so the mechanism
the comment described cannot be why we need the setting.
The reason that does hold up is headroom, measured on this lockfile: the
longest path relative to the repo root is 115 characters hoisted against 190
isolated (at Windows' default virtualStoreDirMaxLength of 60). An ordinary
C:\Users\<first>.<last>\IdeaProjects\tomtom-traffic-analytics-mcp checkout is
63 characters, leaving isolated ~6 before MAX_PATH — a OneDrive-redirected
Documents folder or a worktree subdirectory exceeds it. Enabling long paths
instead needs an admin registry value plus a longPathAware manifest node.exe
does not ship (nodejs/node#40641), which a public repo cannot require.
Also records what the setting does and does not cost, since that was the
review question. It costs strict isolation: an undeclared dependency resolves
locally but breaks in the published bundle. It costs nothing measurable
otherwise — 321 MB and equal install times either way (isolated 4.86/6.65/
5.12s against hoisted 5.82/5.77/5.11s, warm store, frozen lockfile), because
the store dedup comes from packageImportMethod, not from nodeLinker.
Comment only; no behaviour change.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
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.js to es-module/test-esm-long-path-win.js as the tests cover more cases than specified in that issue.
Fixes: #50753