Uh oh!
There was an error while loading. Please reload this page.
fs: restore javascript realpath implementation - #7899
Conversation
A couple of suggestions:
|
orangemocha
commented
Jul 27, 2016
orangemocha
commented
Jul 27, 2016
At the last meeting, the CTC has expressed consensus with the approach in this PR: reverting, leaving the cache out, but keeping the encoding option. |
To me it looks like this reverts too many tests. Could we keep the ones that still pass? |
bzoz
commented
Jul 28, 2016
@ChALkeR: Those test are reverted by #7846 on which this PR depends. |
addaleax
commented
Jul 28, 2016
@bzoz Your call.There seems to be agreement that the long-term plan is to use a fixed libuv implementation, though, and I think keeping the binding around might be useful for e.g. comparative benchmarks.
|
bddaab2 to
0329b6aComparejasnell
commented
Jul 28, 2016
In general this LGTM with a green CI. I definitely want to make sure this gets additional eyes on it to review, however. @nodejs/ctc |
saghul
commented
Jul 29, 2016
Why does this PR also revert "fs: validate args of truncate functions in js" and "fs: make callback mandatory to all async functions" ? How are those related to the realpath problems? It makes is a lot harder to review this PR. |
saghul
commented
Jul 29, 2016
Those seem to be handled by #7846, btw. |
addaleax
commented
Jul 29, 2016
There was a problem hiding this comment.
You don’t need the asyncCompleted checks; wrapping the callback as common.mustCall(function(err, result) { … }) handles that automatically for you.
addaleax
commented
Jul 29, 2016
@bzoz Many, many thanks for starting to add regression tests! Overall LGTM, too. |
bzoz
commented
Jul 29, 2016
addaleax
commented
Aug 2, 2016
LGTM, thanks for doing the work behind this PR! |
addaleax
commented
Aug 2, 2016
One Windows build bot failure, running CI again to be safe: https://ci.nodejs.org/job/node-test-commit/4376/ |
bzoz
commented
Aug 2, 2016
I had one running here https://ci.nodejs.org/job/node-test-commit/4373/, it is green. |
addaleax
commented
Aug 2, 2016
Oh, sorry (but good to hear)! I’d say this is good to go once #7846 is resolved. |
misterdjules
commented
Aug 2, 2016
28efdae to
0c0a6b4Comparebzoz
commented
Aug 3, 2016
@misterdjules OK, squashed Commits:
|
saghul
commented
Aug 3, 2016
What was the result of the discussion about the substed realpath behavior thing? This PR adds a test thus making certain behavior "correct" which might not necessarily be the case. It depends on how substed drives are interpreted, IMHO. On the maze of issues and notes I recall reading that some people where using substed drives to get shorter paths. Was that the case? What breaks if we would give them the long path? |
bzoz
commented
Aug 10, 2016
I've added a note to the |
jasnell
commented
Aug 10, 2016
LGTM, thank you. |
jasnell
commented
Aug 10, 2016
CI is green. Let's give it another day before landing. @nodejs/ctc @nodejs/collaborators ... please take one final look. |
| fs.realpathSync = function realpathSync(path, options) { | ||
| // Regexp that finds the next partion of a (partial) path |
The benchmarks included also work for the previous JS implementation of fs.realpath(). In case the new implementation of realpath() needs to be reverted, we want these changes to stick around. PR-URL: #7899 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
bzoz
commented
Aug 12, 2016
The benchmarks included also work for the previous JS implementation of fs.realpath(). In case the new implementation of realpath() needs to be reverted, we want these changes to stick around. PR-URL: #7899 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
@bzoz@addaleax one thing I really liked from the behaviour of native |
addaleax
commented
Sep 22, 2016
@bpasero I guess you can open a separate issue for this? It sounds like something that would be okay to have. |
bpasero
commented
Sep 22, 2016
Make the `uv_fs_realpath()` binding (which calls the libc `realpath()`
on UNIX and `GetFinalPathNameByHandle()` on Windows) available as the
`fs.realpath.native()` and `fs.realpathSync.native()` functions.
The binding was already available as `process.binding('fs').realpath`
but was not exposed or tested - and partly broken as a result.
Fixes: nodejs#8715
PR-URL: nodejs#15776
Refs: nodejs#7899
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>Make the `uv_fs_realpath()` binding (which calls the libc `realpath()`
on UNIX and `GetFinalPathNameByHandle()` on Windows) available as the
`fs.realpath.native()` and `fs.realpathSync.native()` functions.
The binding was already available as `process.binding('fs').realpath`
but was not exposed or tested - and partly broken as a result.
Fixes: #8715
PR-URL: #15776
Refs: #7899
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
fs
Description of change
Libuv
realpathimplementation brought a lot of problems described here #7726. This restores old JS implementation ofrealpathandrealpathSync, adding new API, withoptionsin place ofcache.This requires #7846 to land, as it reverts changes to
fson which old JS implementation depended. This PR is about 3rd and 4th commit which bring back oldrealpathimplementation with support for the new API.First two commits are from #7846, reverting some changes to
fsthat landed after JSrealpathimplementation was dropped.Third commit reverts b488b19 bringing back JS implementation of
realpathandrealpathSync.Fourth commit updates old implementation. It removes the cache and implements new
realpathAPI (support forencodingparameter).This cannot land before #7846. In case #7846 does not make it, this can be easily updated.