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

fs: throw errors in JS land in *stat{Sync} APIs #17914

Closed
wants to merge 6 commits into from

Conversation

joyeecheung
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

fs

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. labels Dec 29, 2017
@joyeecheung joyeecheung added the wip Issues and PRs that are still a work in progress. label Dec 29, 2017
@joyeecheung joyeecheung changed the title fs: throw errors in JS land in *stat{Sync} APIs [WIP] fs: throw errors in JS land in *stat{Sync} APIs Dec 29, 2017
@joyeecheung
Copy link
Member Author

joyeecheung commented Dec 29, 2017

CI: https://ci.nodejs.org/job/node-test-pull-request/12341/
This should fail on Windows at the moment because the lstat errors from realpath* only include partial paths on Windows. I'll update the actual paths afterwards.

EDIT: New CI with windows-only test: https://ci.nodejs.org/job/node-test-pull-request/12351/

@jasnell jasnell added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 29, 2017
@jasnell
Copy link
Member

jasnell commented Dec 29, 2017

btw, I strongly recommend checking these changes against the userland glob module. It is written so that it depends on specific errors being thrown by fs.realpath()/fs.realpathSync() to prevent infinite recursion.

@joyeecheung
Copy link
Member Author

Added windows-only test to cover calling realpath where the drive does not exist. This is ready for review now.

CI: https://ci.nodejs.org/job/node-test-pull-request/12395/

@joyeecheung joyeecheung changed the title [WIP] fs: throw errors in JS land in *stat{Sync} APIs fs: throw errors in JS land in *stat{Sync} APIs Jan 3, 2018
@joyeecheung joyeecheung removed the wip Issues and PRs that are still a work in progress. label Jan 3, 2018
@joyeecheung
Copy link
Member Author

CI is green with unrelated failures. @jasnell @nodejs/tsc please review, thanks

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@joyeecheung
Copy link
Member Author

The unit tests of node-glob passed locally with this branch.

CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1185/

@joyeecheung
Copy link
Member Author

CITGM failures look unrelated compared to master. This needs one more TSC approval to land ping @jasnell @nodejs/tsc please review, thanks

@joyeecheung
Copy link
Member Author

@joyeecheung
Copy link
Member Author

CI failures are unrelated. Ping @jasnell @nodejs/tsc please review, thanks

@joyeecheung
Copy link
Member Author

Ping @nodejs/tsc still needs one more TSC approval to land

@targos
Copy link
Member

targos commented Jan 15, 2018

If that can help: I approve the change but do not feel confident enough to review the C++ part.

@joyeecheung
Copy link
Member Author

joyeecheung commented Jan 16, 2018

Rebased again. CI: https://ci.nodejs.org/job/node-test-pull-request/12560/

@nodejs/tsc still needs one more TSC approval to land...please reveiw

@joyeecheung
Copy link
Member Author

joyeecheung commented Jan 16, 2018

@jasnell Thanks!

There were some infra issues and known flakes in the last round of CI. Just to be sure: https://ci.nodejs.org/job/node-test-pull-request/12563/

@joyeecheung
Copy link
Member Author

CI failures look unrelated. Landed in 316b5ef...1312db5, thanks!

joyeecheung added a commit that referenced this pull request Jan 16, 2018
PR-URL: #17914
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joyeecheung added a commit that referenced this pull request Jan 16, 2018
PR-URL: #17914
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joyeecheung added a commit that referenced this pull request Jan 16, 2018
PR-URL: #17914
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joyeecheung added a commit that referenced this pull request Jan 16, 2018
PR-URL: #17914
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joyeecheung added a commit that referenced this pull request Jan 16, 2018
PR-URL: #17914
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joyeecheung added a commit that referenced this pull request Jan 16, 2018
PR-URL: #17914
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
thefourtheye added a commit to thefourtheye/io.js that referenced this pull request Jan 17, 2018
This is a follow-up of nodejs#17914. When
Access and Close functions are called in Sync mode, the number of items
in args is validated. These are the only two places in this file where
this validation doesn't take place.
@joyeecheung joyeecheung mentioned this pull request Jan 18, 2018
4 tasks
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Jan 19, 2018
This is a follow-up of nodejs#17914. When
Access and Close functions are called in Sync mode, the number of items
in args is validated. These are the only two places in this file where
this validation doesn't take place.

PR-URL: nodejs#18203
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
This is a follow-up of nodejs#17914. When
Access and Close functions are called in Sync mode, the number of items
in args is validated. These are the only two places in this file where
this validation doesn't take place.

PR-URL: nodejs#18203
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants