-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
lib: don't parse windows drive letters as schemes #50580
lib: don't parse windows drive letters as schemes #50580
Conversation
We were incorrectly parsing windows drive letters as schemes. This was polluting the source map cache with malformed file paths. Fixes: nodejs#50523
@bcoe @cspotcode Any thoughts? Thanks in advance. |
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 looks like a reasonable fix to me. I'm not a maintainer but giving my 👍
Hello, is anyone paying attention to this small fix? I am expecting this to be merged and backported to 18.x as soon as possible. Thank you guys. Pinging some members with source-map-cache review experience. Hope this doesn't bothers much. |
This looks like a trivial fix but I think it would be better to raise the issue to https://github.com/tc39/source-map-rfc as well. |
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.
LGTM with the comment change
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
The failure doesn't seem related to this PR. sequential.test-watch-mode-inspect was marked flaky. |
Thank you for your contribution! |
Commit Queue failed- Loading data for nodejs/node/pull/50580 ✔ Done loading data for nodejs/node/pull/50580 ----------------------------------- PR info ------------------------------------ Title lib: don't parse windows drive letters as schemes (#50580) Author 华 (@PaperStrike, first-time contributor) Branch PaperStrike:abs-win-path-sources -> nodejs:main Labels author ready, needs-ci, source maps Commits 3 - lib: don't parse windows drive letters as schemes - lib: typo fixes - lib: update sourcesToAbsolute comment Committers 1 - 华 PR-URL: https://github.com/nodejs/node/pull/50580 Fixes: https://github.com/nodejs/node/issues/50523 Reviewed-By: Chengzhong Wu ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/50580 Fixes: https://github.com/nodejs/node/issues/50523 Reviewed-By: Chengzhong Wu -------------------------------------------------------------------------------- ℹ This PR was created on Mon, 06 Nov 2023 15:38:17 GMT ✔ Approvals: 1 ✔ - Chengzhong Wu (@legendecas) (TSC): https://github.com/nodejs/node/pull/50580#pullrequestreview-1764032021 ✔ Last GitHub CI successful ℹ Last Full PR CI on 2023-12-05T06:11:16Z: https://ci.nodejs.org/job/node-test-pull-request/56095/ - Querying data for job/node-test-pull-request/56095/ ✔ 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 50580 From https://github.com/nodejs/node * branch refs/pull/50580/merge -> FETCH_HEAD ✔ Fetched commits as 9def0a9f94f0..f41d75815fa4 -------------------------------------------------------------------------------- Auto-merging lib/internal/source_map/source_map_cache.js [main 6a092ac015] lib: don't parse windows drive letters as schemes Author: 华 Date: Mon Nov 6 12:22:41 2023 +0000 4 files changed, 49 insertions(+) create mode 100644 test/fixtures/source-map/ts-node-win32.js create mode 100644 test/fixtures/source-map/ts-node.ts [main 0bbf0ed739] lib: typo fixes Author: 华 Date: Sat Nov 25 10:40:29 2023 +0000 3 files changed, 4 insertions(+), 4 deletions(-) Auto-merging lib/internal/source_map/source_map_cache.js [main 6865310b7c] lib: update sourcesToAbsolute comment Author: 华 Date: Wed Nov 29 17:09:19 2023 +0000 1 file changed, 1 insertion(+) ✔ Patches applied There are 3 commits in the PR. Attempting autorebase. Rebasing (2/6)https://github.com/nodejs/node/actions/runs/7097155769 |
Landed in 77e3dfc |
The windows drive letters are incorrectly parsed as schemes, which pollutes the source map cache with malformed file paths.
Fixes: #50523