-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: fix generation of path objects in Windows #56696
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56696 +/- ##
==========================================
- Coverage 89.21% 89.21% -0.01%
==========================================
Files 662 662
Lines 191934 191936 +2
Branches 36945 36942 -3
==========================================
+ Hits 171227 171228 +1
- Misses 13543 13550 +7
+ Partials 7164 7158 -6
|
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.
A similar already landed last August: #54653
We should use ToU8StringView()
rather than introducing a new API.
Thanks for the review! However, there is a problem with the u8string approach. Therefore, I provided and used an API to handle wstrings without using ToU8StringView. |
I recommend improving existing solution to fit both cases rather than implementing a new solution. |
What are "both cases" presented here? I am sure that ToU8StringView is not used in current codebase. I don't think that trying hard to use u8string in path is a better way to go.... |
fix: #56650
ref: #56657
This PR fixes a problem that caused a segmentation fault in module resolution when creating a require object with multibyte characters in a non-English environment.
Since the issue occurred when generating a std::filesystem::path object, some patches were applied to the changed areas in the following PR.
a7dad43
Since the issue was reproduced only in different locales, such as ja-JP on Windows, I rewrote the locale in the CI of coverage-windows to run the test.
https://github.com/yamachu/node/pull/2/files#diff-29094741d50149aa772b3e577ad509116bad722ad2de85689b6cb2c01e806a46
.github/workflows/coverage-windows.yml
The previous PR did not solve the problem when using unicode, so the process was separated for windows and the path object was generated.
The part where std::filesystem::path is used can be fixed by changing this PR.
The results of the test conducted in a Japanese environment can be seen below.
https://github.com/yamachu/node/actions/runs/12903928231/job/35980111577#step:12:16844