-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56696 +/- ##
==========================================
- Coverage 89.21% 89.20% -0.01%
==========================================
Files 662 662
Lines 191945 191978 +33
Branches 36948 36953 +5
==========================================
+ Hits 171238 171258 +20
- Misses 13549 13555 +6
- Partials 7158 7165 +7
|
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.... |
The base branch is still bf59539 , so the associated test seems to be fail. (experimental flag) |
Yes, thank you. |
0697f02
to
cba8830
Compare
I had to rush to write my comments before work. I have rebased and force pushed the file, so please check with CI. I would have liked to have been able to do this beforehand, but I looked over the entire code. Lines 3149 to 3160 in d978610
This was exactly what I was looking for. |
src/node_modules.cc
Outdated
@@ -326,6 +330,22 @@ const BindingData::PackageConfig* BindingData::TraverseParent( | |||
return nullptr; | |||
} | |||
|
|||
#ifdef _WIN32 | |||
std::wstring ConvertToWideString(const std::string& str) { | |||
auto cp = GetACP(); |
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.
This section was copied from node_file.cc, but this GetACP
is particularly important.
As shown in the description, when the Windows locale is changed and executed, if the original UTF-8 code is left here, the strings cannot be handled properly.
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 wonder if this utility function can be moved to util-inl.h
? so that the same implementation (taking into account GetACP
) is used both here and in node_file.cc
without duplication. I think this is also what @anonrig is requesting.
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.
If we do the same for node_fs, test-fs-cp.mjs will falil...
It is very strange, but I have found that if I run the failed path(utf/~~~) in addition to the test-require-~ , it can be handled correctly.
It may be that the pre or post-process (if there is one) regarding path generation in node_fs is having an effect.
Therefore, this time I confined the implementation within node_modules instead of applying it to the whole system.
The following is the error log when applied to the entire system.
https://github.com/yamachu/node/actions/runs/12941644792/job/36098035649?pr=3#step:7:5033
code diff
yamachu@0041793
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 was thinking about making cp
a function parameter and use CP_UTF8
in node_file.cc
and GetACP()
here. Does it make sense?
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.
Ah, I see.
Do you mean to make these changes?
util-inl.h
#ifdef _WIN32
inline std::wstring ConvertToWideString(const std::string& str, UINT cp) {
int size_needed = MultiByteToWideChar(
cp, 0, &str[0], static_cast<int>(str.size()), nullptr, 0);
std::wstring wstrTo(size_needed, 0);
MultiByteToWideChar(
cp, 0, &str[0], static_cast<int>(str.size()), &wstrTo[0], size_needed);
return wstrTo;
}
#endif // _WIN32
node_file.cc
#define BufferValueToPath(str) \
std::filesystem::path(ConvertToWideString(str.ToString(), CP_UTF8))
I thought that this implementation would certainly have less impact and could be implemented with less code duplication.
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.
Yes, exactly. FWIW, I'm also ok with this as is.
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.
apply 👍 : ef0ade1
https://github.com/yamachu/node/actions/runs/12933259601/job/36071441238#step:12:16876 Test has passed on SJIS Windows |
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.
RSLGTM
Can you please squash the last 3 commits into the second or everything into one? |
24ac7b9
to
ea943d8
Compare
I squashed and added a test case for the newly found problem. |
ea943d8
to
4ddd7ae
Compare
4ddd7ae
to
ef0ade1
Compare
Can you please squash (last commit) again? |
Commit Queue failed- Loading data for nodejs/node/pull/56696 ✔ Done loading data for nodejs/node/pull/56696 ----------------------------------- PR info ------------------------------------ Title src: fix generation of path objects in Windows (#56696) Author Yusuke Yamada <[email protected]> (@yamachu, first-time contributor) Branch yamachu:fix-windows-path-string -> nodejs:main Labels c++, needs-ci, commit-queue-rebase Commits 2 - test: added test that uses multibyte for path and resolves modules - src: fix to generate path from wchar_t via wstring. Committers 1 - yamachu <[email protected]> PR-URL: https://github.com/nodejs/node/pull/56696 Fixes: https://github.com/nodejs/node/issues/56650 Refs: https://github.com/nodejs/node/pull/56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/56696 Fixes: https://github.com/nodejs/node/issues/56650 Refs: https://github.com/nodejs/node/pull/56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> -------------------------------------------------------------------------------- ℹ This PR was created on Wed, 22 Jan 2025 11:36:15 GMT ✔ Approvals: 3 ✔ - James M Snell (@jasnell) (TSC): https://github.com/nodejs/node/pull/56696#pullrequestreview-2567707728 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/56696#pullrequestreview-2573055602 ✔ - Luigi Pinca (@lpinca): https://github.com/nodejs/node/pull/56696#pullrequestreview-2573469880 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2025-01-25T06:27:37Z: https://ci.nodejs.org/job/node-test-pull-request/64736/ - Querying data for job/node-test-pull-request/64736/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ No git cherry-pick in progress ✔ No git am in progress ✔ No git rebase in progress -------------------------------------------------------------------------------- - Bringing origin/main up to date... From https://github.com/nodejs/node * branch main -> FETCH_HEAD ✔ origin/main is now up-to-date - Downloading patch for 56696 From https://github.com/nodejs/node * branch refs/pull/56696/merge -> FETCH_HEAD ✔ Fetched commits as 4a5d2c7538b4..76bd5d181020 -------------------------------------------------------------------------------- [main a02abddc1f] test: added test that uses multibyte for path and resolves modules Author: yamachu <[email protected]> Date: Wed Jan 22 20:21:46 2025 +0900 2 files changed, 27 insertions(+) create mode 100644 "test/fixtures/copy/utf/\346\226\260\345\273\272\346\226\207\344\273\266\345\244\271/experimental.json" create mode 100644 test/parallel/test-module-create-require-multibyte.js Auto-merging src/node_modules.cc [main beb75f0ce4] src: fix to generate path from wchar_t via wstring. Author: yamachu <[email protected]> Date: Wed Jan 22 20:24:38 2025 +0900 3 files changed, 37 insertions(+), 18 deletions(-) ✔ Patches applied There are 2 commits in the PR. Attempting autorebase. Rebasing (2/4) Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- test: added test that uses multibyte for path and resolves moduleshttps://github.com/nodejs/node/actions/runs/12962955769 |
PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Landed in 97a3a82...1760024. |
PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: nodejs#56696 Fixes: nodejs#56650 Refs: nodejs#56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: nodejs#56696 Fixes: nodejs#56650 Refs: nodejs#56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: nodejs#56696 Fixes: nodejs#56650 Refs: nodejs#56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: nodejs#56696 Fixes: nodejs#56650 Refs: nodejs#56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
Take a similar approach to node_file and allow the creation of paths code point must be specified to convert from wchar_t to utf8. PR-URL: #56696 Fixes: #56650 Refs: #56657 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [node](https://nodejs.org) ([source](https://github.com/nodejs/node)) | minor | `23.6.1` -> `23.7.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>nodejs/node (node)</summary> ### [`v23.7.0`](https://github.com/nodejs/node/releases/tag/v23.7.0): 2025-01-30, Version 23.7.0 (Current), @​aduh95 [Compare Source](nodejs/node@v23.6.1...v23.7.0) ##### Notable Changes - \[[`36dd9ecc41`](nodejs/node@36dd9ecc41)] - **crypto**: update root certificates to NSS 3.107 (Node.js GitHub Bot) [#​56566](nodejs/node#56566) - \[[`9414d3cbf1`](nodejs/node@9414d3cbf1)] - **(SEMVER-MINOR)** **fs**: allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) [#​56489](nodejs/node#56489) - \[[`9c5c3b3115`](nodejs/node@9c5c3b3115)] - **(SEMVER-MINOR)** **module**: add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) [#​56610](nodejs/node#56610) - \[[`1e201fd5fd`](nodejs/node@1e201fd5fd)] - **(SEMVER-MINOR)** **sqlite**: support TypedArray and DataView in `StatementSync` (Alex Yang) [#​56385](nodejs/node#56385) - \[[`48c813fb67`](nodejs/node@48c813fb67)] - **(SEMVER-MINOR)** **src**: add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) [#​56441](nodejs/node#56441) - \[[`cf16123785`](nodejs/node@cf16123785)] - **(SEMVER-MINOR)** **src,worker**: add isInternalWorker (Carlos Espa) [#​56469](nodejs/node#56469) - \[[`13bdd9c961`](nodejs/node@13bdd9c961)] - **(SEMVER-MINOR)** **test_runner**: add TestContext.prototype.waitFor() (Colin Ihrig) [#​56595](nodejs/node#56595) - \[[`00a1943858`](nodejs/node@00a1943858)] - **(SEMVER-MINOR)** **test_runner**: add t.assert.fileSnapshot() (Colin Ihrig) [#​56459](nodejs/node#56459) - \[[`3143566045`](nodejs/node@3143566045)] - **(SEMVER-MINOR)** **test_runner**: add assert.register() API (Colin Ihrig) [#​56434](nodejs/node#56434) ##### Commits - \[[`334a3ac7c6`](nodejs/node@334a3ac7c6)] - **assert**: make myers_diff function more performant (Giovanni Bucci) [#​56303](nodejs/node#56303) - \[[`eb2bf460b7`](nodejs/node@eb2bf460b7)] - **assert**: make partialDeepStrictEqual work with urls and File prototypes (Giovanni Bucci) [#​56231](nodejs/node#56231) - \[[`d184453b90`](nodejs/node@d184453b90)] - **assert**: show diff when doing partial comparisons (Giovanni Bucci) [#​56211](nodejs/node#56211) - \[[`4aa1afd607`](nodejs/node@4aa1afd607)] - **benchmark**: add validateStream to styleText bench (Rafael Gonzaga) [#​56556](nodejs/node#56556) - \[[`8bbdb1203e`](nodejs/node@8bbdb1203e)] - **child_process**: fix parsing messages with splitted length field (Maksim Gorkov) [#​56106](nodejs/node#56106) - \[[`d83d89a08e`](nodejs/node@d83d89a08e)] - **crypto**: add missing return value check (Michael Dawson) [#​56615](nodejs/node#56615) - \[[`36dd9ecc41`](nodejs/node@36dd9ecc41)] - **crypto**: update root certificates to NSS 3.107 (Node.js GitHub Bot) [#​56566](nodejs/node#56566) - \[[`3915152c36`](nodejs/node@3915152c36)] - **crypto**: fix checkPrime crash with large buffers (Santiago Gimeno) [#​56559](nodejs/node#56559) - \[[`c8d1dcb063`](nodejs/node@c8d1dcb063)] - **crypto**: fix warning of ignoring return value (Cheng) [#​56527](nodejs/node#56527) - \[[`1994eaaf52`](nodejs/node@1994eaaf52)] - **crypto**: make generatePrime/checkPrime interruptible (James M Snell) [#​56460](nodejs/node#56460) - \[[`5f1ee05390`](nodejs/node@5f1ee05390)] - **deps**: update corepack to 0.31.0 (Node.js GitHub Bot) [#​56795](nodejs/node#56795) - \[[`9cfac712b8`](nodejs/node@9cfac712b8)] - **deps**: move inspector_protocol to deps (Chengzhong Wu) [#​56649](nodejs/node#56649) - \[[`b2ec816a31`](nodejs/node@b2ec816a31)] - **deps**: macro ENODATA is deprecated in libc++ (Cheng) [#​56698](nodejs/node#56698) - \[[`edd9361499`](nodejs/node@edd9361499)] - **deps**: fixup some minor coverity warnings (James M Snell) [#​56612](nodejs/node#56612) - \[[`9ffe3ad4b1`](nodejs/node@9ffe3ad4b1)] - **deps**: update libuv to 1.50.0 (Node.js GitHub Bot) [#​56616](nodejs/node#56616) - \[[`73ad3ca238`](nodejs/node@73ad3ca238)] - **deps**: update amaro to 0.3.0 (Node.js GitHub Bot) [#​56568](nodejs/node#56568) - \[[`0657f6270a`](nodejs/node@0657f6270a)] - **deps**: update amaro to 0.2.2 (Node.js GitHub Bot) [#​56568](nodejs/node#56568) - \[[`47fad8cbc0`](nodejs/node@47fad8cbc0)] - **deps**: update simdutf to 6.0.3 (Node.js GitHub Bot) [#​56567](nodejs/node#56567) - \[[`c9a211ae29`](nodejs/node@c9a211ae29)] - **diagnostics_channel**: capture console messages (Stephen Belanger) [#​56292](nodejs/node#56292) - \[[`cf5d2d6598`](nodejs/node@cf5d2d6598)] - **doc**: move anatoli to emeritus (Michael Dawson) [#​56592](nodejs/node#56592) - \[[`5dd08d10be`](nodejs/node@5dd08d10be)] - **doc**: fix styles of the expandable TOC (Antoine du Hamel) [#​56755](nodejs/node#56755) - \[[`09fb3adf80`](nodejs/node@09fb3adf80)] - **doc**: add "Skip to content" button (Antoine du Hamel) [#​56750](nodejs/node#56750) - \[[`ad012ca1f3`](nodejs/node@ad012ca1f3)] - **doc**: improve accessibility of expandable lists (Antoine du Hamel) [#​56749](nodejs/node#56749) - \[[`38acdb57eb`](nodejs/node@38acdb57eb)] - **doc**: add note regarding commit message trailers (Dario Piotrowicz) [#​56736](nodejs/node#56736) - \[[`f4a9b134c0`](nodejs/node@f4a9b134c0)] - **doc**: fix typo in example code for util.styleText (Robin Mehner) [#​56720](nodejs/node#56720) - \[[`8a61aaa734`](nodejs/node@8a61aaa734)] - **doc**: fix inconsistencies in `WeakSet` and `WeakMap` comparison details (Shreyans Pathak) [#​56683](nodejs/node#56683) - \[[`4ade128184`](nodejs/node@4ade128184)] - **doc**: add RafaelGSS as latest sec release stewards (Rafael Gonzaga) [#​56682](nodejs/node#56682) - \[[`e1e1200b79`](nodejs/node@e1e1200b79)] - **doc**: clarify cjs/esm diff in `queueMicrotask()` vs `process.nextTick()` (Dario Piotrowicz) [#​56659](nodejs/node#56659) - \[[`57a7b931fb`](nodejs/node@57a7b931fb)] - **doc**: `WeakSet` and `WeakMap` comparison details (Shreyans Pathak) [#​56648](nodejs/node#56648) - \[[`56b21489f4`](nodejs/node@56b21489f4)] - **doc**: mention prepare --security (Rafael Gonzaga) [#​56617](nodejs/node#56617) - \[[`67f39b597a`](nodejs/node@67f39b597a)] - **doc**: tweak info on reposts in ambassador program (Michael Dawson) [#​56589](nodejs/node#56589) - \[[`6381e0761d`](nodejs/node@6381e0761d)] - **doc**: add type stripping to ambassadors program (Marco Ippolito) [#​56598](nodejs/node#56598) - \[[`9bd438acd3`](nodejs/node@9bd438acd3)] - **doc**: improve internal documentation on built-in snapshot (Joyee Cheung) [#​56505](nodejs/node#56505) - \[[`f54118c84a`](nodejs/node@f54118c84a)] - **doc**: correct customization hook types & clarify descriptions (Jacob Smith) [#​56454](nodejs/node#56454) - \[[`6af5053153`](nodejs/node@6af5053153)] - **doc**: document CLI way to open the nodejs/bluesky MR (Antoine du Hamel) [#​56506](nodejs/node#56506) - \[[`4a77a9e1eb`](nodejs/node@4a77a9e1eb)] - **doc**: add history info for Permission Model (Antoine du Hamel) [#​56707](nodejs/node#56707) - \[[`097b8b4889`](nodejs/node@097b8b4889)] - **doc**: add note for features using `InternalWorker` with permission model (Antoine du Hamel) [#​56706](nodejs/node#56706) - \[[`f600466c73`](nodejs/node@f600466c73)] - **doc**: add section about using npx with permission model (Rafael Gonzaga) [#​56539](nodejs/node#56539) - \[[`c2d5a0c629`](nodejs/node@c2d5a0c629)] - **doc**: update gcc-version for ubuntu-lts (Kunal Kumar) [#​56553](nodejs/node#56553) - \[[`202af46793`](nodejs/node@202af46793)] - **doc**: fix parentheses in options (Tobias Nießen) [#​56563](nodejs/node#56563) - \[[`4e4b0c63d0`](nodejs/node@4e4b0c63d0)] - **doc**: fix location of NO_COLOR in CLI docs (Colin Ihrig) [#​56525](nodejs/node#56525) - \[[`92eeeb98a5`](nodejs/node@92eeeb98a5)] - **doc**: include CVE to EOL lines as sec release process (Rafael Gonzaga) [#​56520](nodejs/node#56520) - \[[`233a6a93a1`](nodejs/node@233a6a93a1)] - **doc**: add esm examples to node:trace_events (Alfredo González) [#​56514](nodejs/node#56514) - \[[`d9cff6c73f`](nodejs/node@d9cff6c73f)] - **doc**: reserve NMV 133 for Electron 35 (Keeley Hammond) [#​56513](nodejs/node#56513) - \[[`6047fd7c5c`](nodejs/node@6047fd7c5c)] - **doc**: add message for Ambassadors to promote (Michael Dawson) [#​56235](nodejs/node#56235) - \[[`a4045c9488`](nodejs/node@a4045c9488)] - **doc**: allow request for TSC reviews via the GitHub UI (Antoine du Hamel) [#​56493](nodejs/node#56493) - \[[`dd3f94873e`](nodejs/node@dd3f94873e)] - **esm**: fix jsdoc type refs to `ModuleJobBase` in esm/loader (Jacob Smith) [#​56499](nodejs/node#56499) - \[[`9414d3cbf1`](nodejs/node@9414d3cbf1)] - **(SEMVER-MINOR)** **fs**: allow `exclude` option in globs to accept glob patterns (Daeyeon Jeong) [#​56489](nodejs/node#56489) - \[[`4202045673`](nodejs/node@4202045673)] - **http2**: omit server name when HTTP2 host is IP address (islandryu) [#​56530](nodejs/node#56530) - \[[`f48a562776`](nodejs/node@f48a562776)] - **inspector**: roll inspector_protocol (Chengzhong Wu) [#​56649](nodejs/node#56649) - \[[`9a954fbf4a`](nodejs/node@9a954fbf4a)] - **inspector**: add undici http tracking support (Chengzhong Wu) [#​56488](nodejs/node#56488) - \[[`f185e8a34a`](nodejs/node@f185e8a34a)] - **inspector**: report loadingFinished until the response data is consumed (Chengzhong Wu) [#​56372](nodejs/node#56372) - \[[`2fb007fdce`](nodejs/node@2fb007fdce)] - **lib**: allow skipping source maps in node_modules (Chengzhong Wu) [#​56639](nodejs/node#56639) - \[[`2f69dc2659`](nodejs/node@2f69dc2659)] - **meta**: move one or more collaborators to emeritus (Node.js GitHub Bot) [#​56580](nodejs/node#56580) - \[[`0d869963e0`](nodejs/node@0d869963e0)] - **meta**: add codeowners of security release document (Rafael Gonzaga) [#​56521](nodejs/node#56521) - \[[`59510ab819`](nodejs/node@59510ab819)] - **module**: fix bad `require.resolve` with option paths for `.` and `..` (Dario Piotrowicz) [#​56735](nodejs/node#56735) - \[[`58d2dad67d`](nodejs/node@58d2dad67d)] - **module**: integrate TypeScript into compile cache (Joyee Cheung) [#​56629](nodejs/node#56629) - \[[`9f99a6acb5`](nodejs/node@9f99a6acb5)] - **module**: use more defensive code when handling SWC errors (Antoine du Hamel) [#​56646](nodejs/node#56646) - \[[`7347d34053`](nodejs/node@7347d34053)] - **module**: fixing url change in load sync hook chain (Vitalii Akimov) [#​56402](nodejs/node#56402) - \[[`9c5c3b3115`](nodejs/node@9c5c3b3115)] - **(SEMVER-MINOR)** **module**: add ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX (Marco Ippolito) [#​56610](nodejs/node#56610) - \[[`afd1f91a1e`](nodejs/node@afd1f91a1e)] - **module**: fix jsdoc for `format` parameter in cjs/loader (pacexy) [#​56501](nodejs/node#56501) - \[[`86d783fa51`](nodejs/node@86d783fa51)] - **module**: rethrow amaro error message (Marco Ippolito) [#​56568](nodejs/node#56568) - \[[`7b6df4a97a`](nodejs/node@7b6df4a97a)] - **process**: fix symbol key and mark experimental new `node:process` methods (Antoine du Hamel) [#​56517](nodejs/node#56517) - \[[`21362cc4f4`](nodejs/node@21362cc4f4)] - **punycode**: limit deprecation warning (Colin Ihrig) [#​56632](nodejs/node#56632) - \[[`93f60a1c15`](nodejs/node@93f60a1c15)] - **sqlite**: disable memstatus APIs at build time (Colin Ihrig) [#​56541](nodejs/node#56541) - \[[`1e201fd5fd`](nodejs/node@1e201fd5fd)] - **(SEMVER-MINOR)** **sqlite**: support TypedArray and DataView in `StatementSync` (Alex Yang) [#​56385](nodejs/node#56385) - \[[`3aca628a11`](nodejs/node@3aca628a11)] - **sqlite**: enable SQL math functions (Colin Ihrig) [#​56447](nodejs/node#56447) - \[[`575251ae6a`](nodejs/node@575251ae6a)] - **src**: add nullptr handling from X509\_STORE_new() (Burkov Egor) [#​56700](nodejs/node#56700) - \[[`8fb03d8f43`](nodejs/node@8fb03d8f43)] - **src**: move more crypto to ncrypto (James M Snell) [#​56653](nodejs/node#56653) - \[[`55a0135261`](nodejs/node@55a0135261)] - **src**: add default value for RSACipherConfig mode field (Burkov Egor) [#​56701](nodejs/node#56701) - \[[`83c56da328`](nodejs/node@83c56da328)] - **src**: fix build with GCC 15 (tjuhaszrh) [#​56740](nodejs/node#56740) - \[[`872d68d87c`](nodejs/node@872d68d87c)] - **src**: fix to generate path from wchar_t via wstring (yamachu) [#​56696](nodejs/node#56696) - \[[`2b6a82dcea`](nodejs/node@2b6a82dcea)] - **src**: replace NoArrayBufferZeroFillScope with v8 option (James M Snell) [#​56658](nodejs/node#56658) - \[[`a5f9023297`](nodejs/node@a5f9023297)] - **src**: initialize FSReqWrapSync in path that uses it (Michaël Zasso) [#​56613](nodejs/node#56613) - \[[`90f70ed8dd`](nodejs/node@90f70ed8dd)] - **src**: use cppgc to manage ContextifyContext (Joyee Cheung) [#​56522](nodejs/node#56522) - \[[`0b1ac9653e`](nodejs/node@0b1ac9653e)] - **src**: handle duplicate paths granted (Rafael Gonzaga) [#​56591](nodejs/node#56591) - \[[`33f5345002`](nodejs/node@33f5345002)] - **src**: update ECKeyPointer in ncrypto (James M Snell) [#​56526](nodejs/node#56526) - \[[`c7b95fcf95`](nodejs/node@c7b95fcf95)] - **src**: update ECPointPointer in ncrypto (James M Snell) [#​56526](nodejs/node#56526) - \[[`c008b15108`](nodejs/node@c008b15108)] - **src**: update ECGroupPointer in ncrypto (James M Snell) [#​56526](nodejs/node#56526) - \[[`5673dc7de7`](nodejs/node@5673dc7de7)] - **src**: update ECDASSigPointer implementation in ncrypto (James M Snell) [#​56526](nodejs/node#56526) - \[[`87ba48b2c6`](nodejs/node@87ba48b2c6)] - **src**: cleaning up more crypto internals for ncrypto (James M Snell) [#​56526](nodejs/node#56526) - \[[`48c813fb67`](nodejs/node@48c813fb67)] - **(SEMVER-MINOR)** **src**: add --disable-sigusr1 to prevent signal i/o thread (Rafael Gonzaga) [#​56441](nodejs/node#56441) - \[[`50c65eed78`](nodejs/node@50c65eed78)] - **src**: fix undefined script name in error source (Chengzhong Wu) [#​56502](nodejs/node#56502) - \[[`b3c66d2493`](nodejs/node@b3c66d2493)] - **src**: refactor --trace-env to reuse option selection and handling (Joyee Cheung) [#​56293](nodejs/node#56293) - \[[`17d59efe3c`](nodejs/node@17d59efe3c)] - **src**: minor cleanups on OneByteString usage (James M Snell) [#​56482](nodejs/node#56482) - \[[`3e6e0106f6`](nodejs/node@3e6e0106f6)] - **src**: move more crypto impl detail to ncrypto dep (James M Snell) [#​56421](nodejs/node#56421) - \[[`5e1ddd5d4c`](nodejs/node@5e1ddd5d4c)] - **src**: fixup more ToLocalChecked uses in node_file (James M Snell) [#​56484](nodejs/node#56484) - \[[`aa3fd2f58f`](nodejs/node@aa3fd2f58f)] - **src**: make some minor ToLocalChecked cleanups (James M Snell) [#​56483](nodejs/node#56483) - \[[`7dd8165b0b`](nodejs/node@7dd8165b0b)] - **src**: lock the thread properly in snapshot builder (Joyee Cheung) [#​56327](nodejs/node#56327) - \[[`edafab7248`](nodejs/node@edafab7248)] - **src**: drain platform tasks before creating startup snapshot (Chengzhong Wu) [#​56403](nodejs/node#56403) - \[[`e1887d2c58`](nodejs/node@e1887d2c58)] - **src**: use LocalVector in more places (James M Snell) [#​56457](nodejs/node#56457) - \[[`cf16123785`](nodejs/node@cf16123785)] - **(SEMVER-MINOR)** **src,worker**: add isInternalWorker (Carlos Espa) [#​56469](nodejs/node#56469) - \[[`df78515664`](nodejs/node@df78515664)] - **stream**: fix typo in ReadableStreamBYOBReader.readIntoRequests (Mattias Buelens) [#​56560](nodejs/node#56560) - \[[`4ff79fb22a`](nodejs/node@4ff79fb22a)] - **test**: reduce number of written chunks (Luigi Pinca) [#​56757](nodejs/node#56757) - \[[`2e7b7b7674`](nodejs/node@2e7b7b7674)] - **test**: fix invalid common.mustSucceed() usage (Luigi Pinca) [#​56756](nodejs/node#56756) - \[[`0af368ce5e`](nodejs/node@0af368ce5e)] - **test**: use strict mode in global setters test (Rich Trott) [#​56742](nodejs/node#56742) - \[[`e49f3e944c`](nodejs/node@e49f3e944c)] - **test**: cleanup and simplify test-crypto-aes-wrap (James M Snell) [#​56748](nodejs/node#56748) - \[[`85f7bbf4e4`](nodejs/node@85f7bbf4e4)] - **test**: do not use common.isMainThread (Luigi Pinca) [#​56768](nodejs/node#56768) - \[[`36b02bf1b1`](nodejs/node@36b02bf1b1)] - **test**: make some requires lazy in common/index (James M Snell) [#​56715](nodejs/node#56715) - \[[`bcb35c3fb7`](nodejs/node@bcb35c3fb7)] - **test**: add test that uses multibyte for path and resolves modules (yamachu) [#​56696](nodejs/node#56696) - \[[`917f98b29c`](nodejs/node@917f98b29c)] - **test**: replace more uses of `global` with `globalThis` (James M Snell) [#​56712](nodejs/node#56712) - \[[`bf34a49206`](nodejs/node@bf34a49206)] - **test**: make common/index slightly less node.js specific (James M Snell) [#​56712](nodejs/node#56712) - \[[`ef2ed71389`](nodejs/node@ef2ed71389)] - **test**: rely less on duplicative common test harness utilities (James M Snell) [#​56712](nodejs/node#56712) - \[[`e654c8b84a`](nodejs/node@e654c8b84a)] - **test**: simplify common/index.js (James M Snell) [#​56712](nodejs/node#56712) - \[[`a62345e73b`](nodejs/node@a62345e73b)] - **test**: move hasMultiLocalhost to common/net (James M Snell) [#​56716](nodejs/node#56716) - \[[`6edf04ee5e`](nodejs/node@6edf04ee5e)] - **test**: move crypto related common utilities in common/crypto (James M Snell) [#​56714](nodejs/node#56714) - \[[`c7a132229f`](nodejs/node@c7a132229f)] - **test**: add missing test for env file (Jonas) [#​56642](nodejs/node#56642) - \[[`2a219eddf6`](nodejs/node@2a219eddf6)] - **test**: enforce strict mode in test-zlib-const (Rich Trott) [#​56689](nodejs/node#56689) - \[[`f885496d9c`](nodejs/node@f885496d9c)] - **test**: fix localization data for ICU 74.2 (Antoine du Hamel) [#​56661](nodejs/node#56661) - \[[`eb3148fb5c`](nodejs/node@eb3148fb5c)] - **test**: use --permission instead of --experimental-permission (Rafael Gonzaga) [#​56685](nodejs/node#56685) - \[[`86d7ba09c4`](nodejs/node@86d7ba09c4)] - **test**: test-stream-compose.js doesn't need internals (Meghan Denny) [#​56619](nodejs/node#56619) - \[[`676276889e`](nodejs/node@676276889e)] - **test**: add maxCount and gcOptions to gcUntil() (Joyee Cheung) [#​56522](nodejs/node#56522) - \[[`5b7a012144`](nodejs/node@5b7a012144)] - **test**: add line break at end of file (Rafael Gonzaga) [#​56588](nodejs/node#56588) - \[[`27cfec619f`](nodejs/node@27cfec619f)] - **test**: mark test-worker-prof as flaky on smartos (Joyee Cheung) [#​56583](nodejs/node#56583) - \[[`7e58da68c1`](nodejs/node@7e58da68c1)] - **test**: update ts eval snapshots (Marco Ippolito) [#​56568](nodejs/node#56568) - \[[`b1c54439ae`](nodejs/node@b1c54439ae)] - **test**: update test-child-process-bad-stdio to use node:test (Colin Ihrig) [#​56562](nodejs/node#56562) - \[[`0d772a963e`](nodejs/node@0d772a963e)] - **test**: disable openssl 3.4.0 incompatible tests (Jelle van der Waa) [#​56160](nodejs/node#56160) - \[[`6fa6d699ff`](nodejs/node@6fa6d699ff)] - **test**: make test-crypto-hash compatible with OpenSSL > 3.4.0 (Jelle van der Waa) [#​56160](nodejs/node#56160) - \[[`90e12f2945`](nodejs/node@90e12f2945)] - **test**: clarify fork inherit permission flags (Rafael Gonzaga) [#​56523](nodejs/node#56523) - \[[`323f96f7b3`](nodejs/node@323f96f7b3)] - **test**: add error only reporter for node:test (Carlos Espa) [#​56438](nodejs/node#56438) - \[[`cbbcaf9108`](nodejs/node@cbbcaf9108)] - **test**: mark test-http-server-request-timeouts-mixed as flaky (Joyee Cheung) [#​56503](nodejs/node#56503) - \[[`295db19ba2`](nodejs/node@295db19ba2)] - **test**: update error code in tls-psk-circuit for for OpenSSL 3.4 (sebastianas) [#​56420](nodejs/node#56420) - \[[`f7563780a6`](nodejs/node@f7563780a6)] - **test**: update compiled sqlite tests to match other tests (Colin Ihrig) [#​56446](nodejs/node#56446) - \[[`8feb2737e7`](nodejs/node@8feb2737e7)] - **test**: add initial test426 coverage (Chengzhong Wu) [#​56436](nodejs/node#56436) - \[[`b9cd7895c0`](nodejs/node@b9cd7895c0)] - **test**: update test-set-http-max-http-headers to use node:test (Colin Ihrig) [#​56439](nodejs/node#56439) - \[[`332ce548cb`](nodejs/node@332ce548cb)] - **test**: update test-child-process-windows-hide to use node:test (Colin Ihrig) [#​56437](nodejs/node#56437) - \[[`e2668c0e00`](nodejs/node@e2668c0e00)] - **test_runner**: print failing assertion only once with spec reporter (Pietro Marchini) [#​56662](nodejs/node#56662) - \[[`f97cd5b02b`](nodejs/node@f97cd5b02b)] - **test_runner**: remove unused errors (Pietro Marchini) [#​56607](nodejs/node#56607) - \[[`13bdd9c961`](nodejs/node@13bdd9c961)] - **(SEMVER-MINOR)** **test_runner**: add TestContext.prototype.waitFor() (Colin Ihrig) [#​56595](nodejs/node#56595) - \[[`00a1943858`](nodejs/node@00a1943858)] - **(SEMVER-MINOR)** **test_runner**: add t.assert.fileSnapshot() (Colin Ihrig) [#​56459](nodejs/node#56459) - \[[`c4979ebfb2`](nodejs/node@c4979ebfb2)] - **test_runner**: run single test file benchmark (Pietro Marchini) [#​56479](nodejs/node#56479) - \[[`839a06e908`](nodejs/node@839a06e908)] - **test_runner**: differentiate test types in enqueue dequeue events (Eddie Abbondanzio) [#​54049](nodejs/node#54049) - \[[`3143566045`](nodejs/node@3143566045)] - **(SEMVER-MINOR)** **test_runner**: add assert.register() API (Colin Ihrig) [#​56434](nodejs/node#56434) - \[[`3aa864904f`](nodejs/node@3aa864904f)] - **test_runner**: finish marking snapshot testing as stable (Colin Ihrig) [#​56425](nodejs/node#56425) - \[[`b7b0768cda`](nodejs/node@b7b0768cda)] - **tls**: fix error stack conversion in cryptoErrorListToException() (Joyee Cheung) [#​56554](nodejs/node#56554) - \[[`8f59f5ba47`](nodejs/node@8f59f5ba47)] - **tools**: update doc to new version (Node.js GitHub Bot) [#​56259](nodejs/node#56259) - \[[`ebf4527730`](nodejs/node@ebf4527730)] - **tools**: update inspector_protocol roller (Chengzhong Wu) [#​56649](nodejs/node#56649) - \[[`649cf0c0f6`](nodejs/node@649cf0c0f6)] - **tools**: do not throw on missing `create-release-proposal.sh` (Antoine du Hamel) [#​56704](nodejs/node#56704) - \[[`69cb44e315`](nodejs/node@69cb44e315)] - **tools**: fix tools-deps-update (Daniel Lemire) [#​56684](nodejs/node#56684) - \[[`02f36ca11b`](nodejs/node@02f36ca11b)] - **tools**: do not throw on missing `create-release-proposal.sh` (Antoine du Hamel) [#​56695](nodejs/node#56695) - \[[`bcc1c65066`](nodejs/node@bcc1c65066)] - **tools**: fix permissions in `lint-release-proposal` workflow (Antoine du Hamel) [#​56614](nodejs/node#56614) - \[[`ab4cfef600`](nodejs/node@ab4cfef600)] - **tools**: remove github reporter (Carlos Espa) [#​56468](nodejs/node#56468) - \[[`477e674a2a`](nodejs/node@477e674a2a)] - **tools**: edit `create-release-proposal` workflow (Antoine du Hamel) [#​56540](nodejs/node#56540) - \[[`5f6785b1cb`](nodejs/node@5f6785b1cb)] - **tools**: validate commit list as part of `lint-release-commit` (Antoine du Hamel) [#​56291](nodejs/node#56291) - \[[`2a0fbd8731`](nodejs/node@2a0fbd8731)] - **tools**: fix loong64 build failed (Xiao-Tao) [#​56466](nodejs/node#56466) - \[[`aea088f79e`](nodejs/node@aea088f79e)] - **tools**: disable unneeded rule ignoring in Python linting (Rich Trott) [#​56429](nodejs/node#56429) - \[[`7a0dd2d04f`](nodejs/node@7a0dd2d04f)] - **tools**: use a configurable value for number of open dependabot MRs (Antoine du Hamel) [#​56427](nodejs/node#56427) - \[[`c249c9715a`](nodejs/node@c249c9715a)] - **tools**: bump the eslint group in /tools/eslint with 4 updates (dependabot\[bot]) [#​56426](nodejs/node#56426) - \[[`a9d332a16f`](nodejs/node@a9d332a16f)] - **util**: inspect: do not crash on an Error stack that contains a Symbol (Jordan Harband) [#​56573](nodejs/node#56573) - \[[`6a16012fd7`](nodejs/node@6a16012fd7)] - **util**: inspect: do not crash on an Error with a regex `name` (Jordan Harband) [#​56574](nodejs/node#56574) - \[[`c7f16192f4`](nodejs/node@c7f16192f4)] - **util**: rename CallSite.column to columnNumber (Chengzhong Wu) [#​56584](nodejs/node#56584) - \[[`e652781934`](nodejs/node@e652781934)] - **util**: do not crash on inspecting function with `Symbol` name (Jordan Harband) [#​56572](nodejs/node#56572) - \[[`d066acfcf9`](nodejs/node@d066acfcf9)] - **util**: expose CallSite.scriptId (Chengzhong Wu) [#​56551](nodejs/node#56551) - \[[`e1b0f44d19`](nodejs/node@e1b0f44d19)] - **watch**: reload env file for --env-file-if-exists (Jonas) [#​56643](nodejs/node#56643) - \[[`538e19489f`](nodejs/node@538e19489f)] - **worker**: refactor stdio to improve performance (Matteo Collina) [#​56630](nodejs/node#56630) - \[[`aab53e6965`](nodejs/node@aab53e6965)] - **worker**: flush stdout and stderr on exit (Matteo Collina) [#​56428](nodejs/node#56428) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNDMuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE0My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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