Skip to content
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

path,win: fix bug in resolve and normalize #55623

Conversation

huseyinacacak-janea
Copy link
Contributor

This PR fixes resolving device paths like \\.\PHYSICALDRIVE.
The resolve and normalize functions were adding a trailing backslash, considering that this device path was a UNC path. However, device paths are different than UNC paths.

In addition to fixing this issue, the previous attempt also fixed other inconsistencies. So, this PR only fixes the issue itself.

Previous PR: #54224
Fixes: #54025

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem. labels Oct 31, 2024
@RedYetiDev RedYetiDev added the needs-citgm PRs that need a CITGM CI run. label Oct 31, 2024
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo\\');
assert.strictEqual(path.win32.toNamespacedPath('\\\\?\\foo'), '\\\\?\\foo');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is stripping the / okay? We wouldn't want to repeat that happened with npm 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be OK since this PR doesn't change anything other than this particular path format. But yes, it would be useful to see the citgm test results.

Copy link
Member

@RedYetiDev RedYetiDev Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a CITGM would be nice. I've applied the labels. If possible, could you also run npm's test suite? The CITGM doesn't cover all of it, and IMO we should be extra cautious JIC.

Although, it seems like it should be fine. Just want to confirm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the test in the npm repo locally and didn't encounter any problems.

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.43%. Comparing base (9967080) to head (efe96fc).
Report is 54 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #55623   +/-   ##
=======================================
  Coverage   88.43%   88.43%           
=======================================
  Files         654      654           
  Lines      187698   187729   +31     
  Branches    36126    36135    +9     
=======================================
+ Hits       165986   166024   +38     
  Misses      14953    14953           
+ Partials     6759     6752    -7     
Files with missing lines Coverage Δ
lib/path.js 96.14% <100.00%> (+0.14%) ⬆️
src/path.cc 69.04% <ø> (ø)

... and 31 files with indirect coverage changes

@StefanStojanovic StefanStojanovic added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 1, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 1, 2024
@nodejs-github-bot
Copy link
Collaborator

@aduh95
Copy link
Contributor

aduh95 commented Nov 3, 2024

CITGM (main): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3499/
CITGM (this PR): https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/3501/

SUCCESS: No new failures in 3501 compared to 3499 🎉

@aduh95 aduh95 added baking-for-lts PRs that need to wait before landing in a LTS release. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. and removed needs-citgm PRs that need a CITGM CI run. request-ci Add this label to start a Jenkins CI on a PR. labels Nov 4, 2024
@aduh95 aduh95 added request-ci Add this label to start a Jenkins CI on a PR. commit-queue Add this label to land a pull request using GitHub Actions. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Nov 5, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 5, 2024
@nodejs-github-bot nodejs-github-bot merged commit 7f68e54 into nodejs:main Nov 5, 2024
92 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 7f68e54

aduh95 pushed a commit that referenced this pull request Nov 6, 2024
Fixes: #54025
PR-URL: #55623
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 6, 2024
Fixes: #54025
PR-URL: #55623
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
tpoisseau pushed a commit to tpoisseau/node that referenced this pull request Nov 21, 2024
Fixes: nodejs#54025
PR-URL: nodejs#55623
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. baking-for-lts PRs that need to wait before landing in a LTS release. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. path Issues and PRs related to the path subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

require('fs').openSync('\\\\.\\PhysicalDrive2', fs.constants.O_RDWR) is broken
7 participants