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

v8 release #667

Merged
merged 19 commits into from May 11, 2019
Merged

v8 release #667

merged 19 commits into from May 11, 2019

Conversation

manidlou
Copy link
Collaborator

@manidlou manidlou commented Apr 1, 2019

I think it is time to release v8. @jprichardson @RyanZim @JPeer264 please let me know if you think differently!

graceful-fs has not been updated yet to support bigint option. I opened an issue there, but they haven't been updated their code yet! So, switched to built-in fs for copy*() and move*() for now, so that we can use bigint option. We will switch back to graceful-fs once the upstream is updated

  • removed standard-markdown as it started giving us more headaches than benefits!

copy*()

  • use fs.stat() with bigint option for node versions that support it >= 10.5.0 and use old fs.stat() without bigint for older node versions.
  • only throw Source and destination must not be the same error if src and dest have the same ino and exist on the same device.

move*()

  • refactored to use the new internal stat functions.
  • added test for prevent moving identical files and directories.

Fixes #608, #613, #614, #657.

@manidlou
Copy link
Collaborator Author

manidlou commented Apr 1, 2019

I will rebase this!

@Domvel
Copy link

Domvel commented Apr 2, 2019

@manidlou Thanks for your changes. checkPathsBeforeCopying is by default true, right? And overwrite is by default true.
Usually the overwrite option is by default false. We should set checkPathsBeforeCopying by default to false. Especially during the #657 bug exists. (Note: The #657 bug is about Inode big integer AND copy between Volumes. This means, the bug is not fixed with your changes. Only by the option to disable the check.)

Recommended default values:

{
  "overwrite": false,
  "checkPathsBeforeCopying": false
}

@RyanZim
Copy link
Collaborator

RyanZim commented Apr 3, 2019

@manidlou Looks like somehow you managed to duplicate most of the commits in this branch. Please fix.

@RyanZim RyanZim added this to the 8.0.0 milestone Apr 3, 2019
@manidlou
Copy link
Collaborator Author

manidlou commented Apr 4, 2019

@RyanZim yeah i know! I will fix it for sure!

@manidlou
Copy link
Collaborator Author

manidlou commented Apr 4, 2019

fixed the commits!

@FlorinSerban
Copy link

Hi,
Can someone tell me when we will have this fix in the master branch?
I can't use Cordova 9.0.0 until this issue will be fixed.

@Domvel
Copy link

Domvel commented Apr 17, 2019

This issue does not fix the issue directly. It's a option to disable the checkPaths-method. This is more a workaround. The Inode-Issue still exists with the option enabled. I think that was not quite understood. But please correct me if I am wrong. 🙂

This finally means, Cordova has to update fs-extra and then use this option. I'm sure, this takes a while. But anyway, this "fix" should be published as fast as possible.

@dimitriscsd
Copy link

How is this coming along? Cordova will need to make a new release with your version 8 to fix major issues in windows build servers.

@f5cs
Copy link

f5cs commented May 7, 2019

It's a very ugly issue, and because it hasn't been solved for so long, i think this project is not a reliable solution.

Can the Cordova project team consider alternative solutions to node-fs-extra

@RyanZim
Copy link
Collaborator

RyanZim commented May 7, 2019

Sorry for the long wait. I've been very busy, plus suffering from a bit of burnout.

@RyanZim
Copy link
Collaborator

RyanZim commented May 7, 2019

@manidlou Do you want me to help with releasing v8, or do you want to do it yourself? I'm good with it either way.

@Domvel
Copy link

Domvel commented May 7, 2019

@RyanZim I dream of a vast green landscape where I spend my remaining life. No stress. No technology. Just sit by a lake and look up at the sky and sleep under the stars. You too? #burnout 😄 Shape the world.

@manidlou
Copy link
Collaborator Author

manidlou commented May 8, 2019

@Domvel we are very well aware of the issue. As I mentioned in the description, we use graceful-fs as a dependency and unfortunately it still doesn't support bigint option! Although I opened an issue there but they have been unresponsive so far!

Honestly I've been thinking about this a lot for awhile and I personally like to fix this right and the only reason that I went down the road of adding the checkPathsBeforeCopying option as a workaround, was that graceful-fs doesn't support the bigint yet! I personally believe copy should be able to handle this cases internally without any extra options. The way that I prefer to fix this is by using the bigint option for node versions that support it and fallback to the legacy approach.

So @jprichardson @RyanZim @JPeer264 although I myself worked on this workaround, this is how I suggest to handle this:

  • disable graceful-fs for now and switch to the built-in fs so that we have the fs.stat() with bigint option available in node versions >= 10.5.0. We will switch back to the graceful-fs once the upstream update their code.
  • use fs.stat() with bigint for node versions that support it and use old fs.stat() for older versions.

Also @Domvel copy will continue work across devices since I will implement the fix in a way that we only throw source and destination are the same error if src and dest have the same inode and they exist on the same device.

@manidlou
Copy link
Collaborator Author

manidlou commented May 9, 2019

Alright it should be ready now! updated the description as well! Once it is approved, @RyanZim will you please take care of the changelog and I will do the rest of it? 😃

@manidlou manidlou requested a review from RyanZim May 9, 2019 13:30
@manidlou manidlou assigned manidlou and unassigned manidlou May 9, 2019
@manidlou
Copy link
Collaborator Author

@jprichardson @RyanZim @JPeer264 please let me know if you have any concerns about this 😃

@JPeer264
Copy link
Collaborator

Sorry for the long wait. I've been very busy, plus suffering from a bit of burnout.

@RyanZim best wishes and hope you will get better :)


I'm okay with those changes. It's good that you marked the graceful-fs as a todo so we won't forget ;)
Also sorry for not being that active around here.

@RyanZim
Copy link
Collaborator

RyanZim commented May 10, 2019

Items from this PR that should be in the release notes:


  • Use renameSync() under the hood in moveSync()
  • Fix bug with bind-mounted directories in copy*() (#613, #618)
  • Fix bug in move() with case-insensitive file systems
  • Use fs.stat()'s bigint option in copy*() & move*() where possible (#657)

@manidlou Did I miss anything?

We should also drop Node 6. No need to make code changes for it, just drop it in the release notes.

@dimitriscsd
Copy link

dimitriscsd commented May 10, 2019 via email

@brodybits
Copy link

We should also drop Node 6. No need to make code changes for it, just drop it in the release notes.

I would favor a statement that Node.js version 6 is deprecated and will be dropped in the near future. I would also favor a similar statement for Node.js version 8, considering that its EOL is coming up in December.

As @dimitriscsd said, Cordova still needs to support Node.js 6 until we make another major release.

@jprichardson
Copy link
Owner

Let's put out a statement that we'll drop Node v6 in the future as it's deprecated. I think this version of fs-extra should support Node v6.

@manidlou
Copy link
Collaborator Author

@RyanZim the items from this PR for release notes are correct. Thanks for taking care of that! Also i just saw your comment in the pile of comments! Hope you feel better!

@RyanZim
Copy link
Collaborator

RyanZim commented May 11, 2019

@manidlou I went ahead and published v8.0.0.

@manidlou
Copy link
Collaborator Author

@RyanZim you did the right thing! Thanks for taking care of that!

@mbargiel
Copy link
Contributor

mbargiel commented May 31, 2019

So @jprichardson @RyanZim @JPeer264 although I myself worked on this workaround, this is how I suggest to handle this:

  • disable graceful-fs for now and switch to the built-in fs so that we have the fs.stat() with bigint option available in node versions >= 10.5.0. We will switch back to the graceful-fs once the upstream update their code.
  • use fs.stat() with bigint for node versions that support it and use old fs.stat() for older versions.

Also @Domvel copy will continue work across devices since I will implement the fix in a way that we only throw source and destination are the same error if src and dest have the same inode and they exist on the same device.

Sorry, a bit late to the party... Does this mean that on node < 10.5, there is still a random chance of failure due to the bigint inode problem? In other words, that this is fixed only for node 10.5 and above? (That's both what I understand from the source code, and what I seemed to have experienced myself.)

@mbargiel
Copy link
Contributor

mbargiel commented May 31, 2019

Note: I understand there's no magical solution here and we just can't use 'bigint' with fs in Node < 10.5, but I was wondering whether there could be tighter heuristics for the legacy case.

I initially thought the suggestion from #657 (comment) could have merit, but I think it wouldn't work with hardlinks and would leak to corrupted files. Instead, relying also on other file stats could help detect different files with incorrectly identical inode values (due to the Number representation). E.g. in legacy form, if the inodes match, but either one of the timestamps or the size don't, then allow the copy because we know it's not the same file, otherwise reject it because it may be the same file.

I could open a PR for that.

@jprichardson
Copy link
Owner

@mbargiel @RyanZim maybe we embed graceful-fs and fix it locally? We did this for all other libraries that were slow to respond.

@mbargiel
Copy link
Contributor

@jprichardson Sure. Though my problem isn't with the fact that graceful-fs is temporarily not used, but that the fix for #657 is only valid for Node 10.5+ (so in practice, for the OP of that issue, the bug they reported is still present, because they stated they were running on Node v8.11.3).

@mbargiel
Copy link
Contributor

We can move that conversation there, it would make much more sense than here on the v8.0.0 release PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

moveSync copies and deletes dirs on external drives
10 participants