GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: stop fixing EPERM on Windows by RaisinTen · Pull Request #38810 · nodejs/node

Conversation

@RaisinTen

@RaisinTen RaisinTen commented May 25, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Originally, when rimraf faced an EPERM on Windows, it would try to
change the file permissions of the entry and attempt to remove it
again. However, rm -rf doesn't change any file permissions, so rimraf
shouldn't either.

This change also updates test/common/tmpdir.js to repeatedly try
changing the file permissions of its contents to 0o777 when an EACCES or
an EPERM is faced while attempting to remove them.

Signed-off-by: Darshan Sen [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels May 25, 2021
@aduh95

aduh95 commented May 25, 2021

Copy link
Copy Markdown
Contributor

What should be the semverness of this change?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen

RaisinTen commented May 26, 2021

Copy link
Copy Markdown
Member Author

@aduh95

Since this is not an API change, I don't think it's going to be semver-major.

There is a behavioural change involved, so maybe this is a semver-minor?

However, I would consider this to be just a fix as this change aligns rm with what the docs already say:

modeled on the standard POSIX rm utility

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aduh95
aduh95 approved these changes May 26, 2021
View reviewed changes

@aduh95 aduh95 left a comment

Copy link
Copy Markdown
Contributor

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, 69 lines of deleted code, nice!

nit: it reads clearer to me if we let the throw expression inside a if block, feel free to disagree oc

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RaisinTen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread lib/internal/fs/rimraf.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/internal/fs/rimraf.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Linkgoron

Linkgoron commented May 26, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I think that it makes sense to add a test for this - or at least fix the tests that I added in the previous rmSync fix, so that they don't allow the folder to get deleted when trying to delete it (which I allowed, to get it to pass the tests). It probably makes sense to add a test to rm as well (my test only checks rmSync)

RaisinTen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
@targos

targos commented May 26, 2021

Copy link
Copy Markdown
Member

@nodejs/fs

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@targos

targos commented May 28, 2021

Copy link
Copy Markdown
Member

Could it be that the CI runs of this PR are leaving broken directories on Windows hosts?

See #38811 (comment) / https://ci.nodejs.org/job/node-test-binary-windows-js-suites/10108/RUN_SUBSET=0,nodes=win10-COMPILED_BY-vs2019/console

14:56:28 > git clean -dffx 
14:56:29 warning: failed to remove test/.tmp.243/rm-6: Permission denied
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen

RaisinTen commented May 28, 2021

Copy link
Copy Markdown
Member Author

@targos Yes I think one of the CI runs here is to blame, how do we fix it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos

targos commented May 28, 2021

Copy link
Copy Markdown
Member

/cc @nodejs/build-infra ^

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau

richardlau commented May 28, 2021

Copy link
Copy Markdown
Member

Could it be that the CI runs of this PR are leaving broken directories on Windows hosts?

See #38811 (comment) / https://ci.nodejs.org/job/node-test-binary-windows-js-suites/10108/RUN_SUBSET=0,nodes=win10-COMPILED_BY-vs2019/console

14:56:28 > git clean -dffx 
14:56:29 warning: failed to remove test/.tmp.243/rm-6: Permission denied

Yes I think one of the CI runs here is to blame, how do we fix it?

FYI Anyone in @nodejs/build can run https://ci.nodejs.org/job/git-clean-windows/ to clean out the git workspaces on the Windows hosts. (I've just done so.)

bl-ue and RaisinTen reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
bl-ue
bl-ue reviewed May 29, 2021
View reviewed changes
Comment thread test/parallel/test-fs-rm.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

This comment has been minimized.

Sign in to view
@RaisinTen

RaisinTen commented May 29, 2021

Copy link
Copy Markdown
Member Author

@nodejs/build Sorry, I think I broke Windows again:

21:25:07 > git clean -dffx 
21:25:07 warning: failed to remove test/.tmp.242/rm-6: Permission denied

Refs: https://ci.nodejs.org/job/node-test-binary-windows-js-suites/10120/RUN_SUBSET=0,nodes=win10-COMPILED_BY-vs2019/console

Why don't we run https://ci.nodejs.org/job/git-clean-windows/ at the end of every CI run on the Windows hosts?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Trott
Trott reviewed May 29, 2021
View reviewed changes
Comment thread test/parallel/test-fs-rm.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@aduh95

aduh95 commented May 29, 2021

Copy link
Copy Markdown
Contributor

It looks like this also broke non-Windows CI machine setups – all builds made after https://ci.nodejs.org/job/node-test-pull-request/38372/ are red, failing on test.parallel/test-fs-rm...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen

RaisinTen commented May 30, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

It looks like this also broke non-Windows CI machine setups – all builds made after https://ci.nodejs.org/job/node-test-pull-request/38372/ are red, failing on test.parallel/test-fs-rm...

That is right. 😕
Since one failure seems to trigger the rest of the tests in the file to fail, I think I'll move each chmod+rm test to a separate file and manually handle the deletion instead of leaving it to tmpdir.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Linkgoron

Linkgoron commented May 30, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Maybe we could change the tmpdir exit code to try to chmod(0o777) files that it couldn't delete, if it gets EPERM of EACCES and then let it try to delete the folders again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen

RaisinTen commented May 30, 2021

Copy link
Copy Markdown
Member Author

Maybe we could change the tmpdir exit code to try to chmod(0o777) files that it couldn't delete, if it gets EPERM of EACCES and then let it try to delete the folders again.

@Linkgoron Updated tmpdir. PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

richardlau
richardlau reviewed May 30, 2021
View reviewed changes
Comment thread test/common/tmpdir.js Outdated

@richardlau richardlau May 30, 2021

Copy link
Copy Markdown
Member

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.

Do we need extras checks to make sure we're not changing access to a directory outside (e.g. the parent) of the tmpdir?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@RaisinTen RaisinTen May 30, 2021

Copy link
Copy Markdown
Member Author

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.

Since err comes from rmSync(tmpPath);, the path in err will always be something inside tmpPath, so I don't think we need more checks.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@aduh95

aduh95 commented May 31, 2021

Copy link
Copy Markdown
Contributor

It might be just an unlucky coincidence, build-windows GH Actions is failing consistently in every PRs since 939a1f2.

https://github.com/nodejs/node/actions/workflows/build-windows.yml

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen

RaisinTen commented Jun 16, 2021

Copy link
Copy Markdown
Member Author

Not necessarily him, but I would feel much more comfortable with this if it's approved by someone from the tooling team.

👍

@nodejs/tooling Pinging again for review because a week has passed and we didn't get any review yet.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen RaisinTen added the review wanted PRs that need review. label Jun 17, 2021
@bcoe

bcoe commented Jun 18, 2021

Copy link
Copy Markdown
Contributor

@RaisinTen with regards to this change, my concern is that the rimraf logic we pulled in is fairly battle tested ... the fact that changing this behavior is now leaving uncleaned up files in our CI/CD is a canary in the coal mine, won't many people who are using fs.rmdir for similar cleanup tasks in their CI/CD begin also failing to cleanup files on Windows ...

Given that tests are one of the most common places where this helper is likely to be used, are we sure this is a change we want to take?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@isaacs

isaacs commented Jun 18, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The semantics around removing read-only files differs between Windows and Posix.

rm -rf doesn't do this, because it is not needed on Posix systems. However, in order to replicate the Posix behavior on win32 systems in some situations, this workaround was necessary.

See: isaacs/rimraf#24 (comment)

Removing this will make it impossible for users to remove read-only files on Windows, which is allowed by posix rm -rf.

$ touch foo

$ chmod 0444 foo

$ ls -laF
total 0
drwxr-xr-x    3 isaacs  staff    96 Jun 18 09:00 ./
drwxr-xr-x  144 isaacs  staff  4608 Jun 18 08:50 ../
-r--r--r--    1 isaacs  staff     0 Jun 18 09:00 foo

$ rm -rf foo

$ ls -laF
total 0
drwxr-xr-x    2 isaacs  staff    64 Jun 18 09:00 ./
drwxr-xr-x  144 isaacs  staff  4608 Jun 18 08:50 ../

$ mkdir dir

$ chmod 0555 dir

$ ls -laF dir
total 0
dr-xr-xr-x  2 isaacs  staff  64 Jun 18 09:02 ./
drwxr-xr-x  3 isaacs  staff  96 Jun 18 09:02 ../

$ rm -rf dir

$ ls -laF dir
ls: dir: No such file or directory

The divergence between Posix and this rimraf implementation on windows, is that on Posix systems, while you can delete read-only files and directories, you may not delete the contents of a read-only directory. I would perhaps be +1 on replicating that behavior, however, the expectation of being able to remove directories on Windows (eg, by deleting them in Explorer) is that a read-only folder may be removed if the user has permission to change its read-only status, and its contents may be removed as well. Thus, the decision was made to keep the workaround as it is.

tl;dr - If you remove this EPERM workaround, you will make a lot of windows users unable to delete .git folders, and they will be unhappy about it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bcoe

bcoe commented Jun 18, 2021

Copy link
Copy Markdown
Contributor

@RaisinTen @isaacs perhaps rather than landing this change, we could land a test that demonstrates initializing an empty git repo, and then uses rm to delete it? verify this edge case.

And then add a comment to our implementation which explains @isaacs' reasoning in detail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@isaacs

isaacs commented Jun 18, 2021

Copy link
Copy Markdown
Contributor

What problem is this patch aiming to solve?

If there isn't a substantive complaint about the functionality as it is, it seems to me like it's changing code to match the documentation, when we ought to be updating the documentation to match what the code has been doing without complaint for 8 years.

targos reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

boneskull
boneskull suggested changes Jun 18, 2021
View reviewed changes

@boneskull boneskull left a comment

Copy link
Copy Markdown
Member

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.

I'm -1 on this. It's going to break users for reasons of cross-platform consistency where no such consistency exists in the first place. Better to update docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

isaacs reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@RaisinTen

RaisinTen commented Jun 19, 2021

Copy link
Copy Markdown
Member Author

If we want to chmod() and retry deleting folders on Windows when an EPERM occurs, shouldn't we do it from inside rmdir() instead of rimraf? Why keep rm() and rmdir() inconsistent while removing a read only directory on Windows?

Also, shouldn't we depend on what Libuv does for these kinds of things instead of handling them from inside Node.js? I know that the implementation of a number of functions in src/win/fs.c of Libuv have been done without using the CRT functions to make things consistent between platforms (for example, unlink()). rmdir() in Libuv currently just calls the _wrmdir() CRT function which returns EACCES (incorrectly translated as EPERM) on read only directories. I think we should write the EPERM handling logic inside fs__rmdir() of src/win/fs.c.

Windows users can run chmod() before removing .git folders if they want. If it is a .git-only issue, shouldn't the issue be reported at Git?

The divergence between Posix and this rimraf implementation on windows, is that on Posix systems, while you can delete read-only files and directories, you may not delete the contents of a read-only directory.

Here too, an initial chmod would work. I have also considered adding a recursive option to fs.chmod(), so that it is easier to remove directories that have multiple levels of read only directories inside them.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bcoe

bcoe commented Jun 22, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

If we want to chmod() and retry deleting folders on Windows when an EPERM occurs, shouldn't we do it from inside rmdir() instead of rimraf? Why keep rm() and rmdir() inconsistent while removing a read only directory on Windows?

On my mind when we worked on this feature, was that once you say rmdir/recursive a user is opting in to a somewhat more aggressive version of rmdir.

Please delete these files for me, and try hard to do so, it's okay I know what I'm doing.

It felt okay to have this, while having rmdir (without recursive) stay more conservative.

Windows users can run chmod() before removing .git

Many folks relying on rmdir recursive, or mdkir recursive are doing so in the context of unit tests, which they'll then run in a test matrix that includes a variety of platforms.

Someone writing a library that generates .git folders during testing doesn't want to add additional chmod behavior in their before logic solely for the benefit of Windows...

It creates cruft in tests, and is confusing (you would need to know about this edge case in folder permissions ahead of time to address the issue).

Shouldn't we depend on what Libuv does for these kinds of things instead of handling them from inside Node.js

I'm very supportive of removing functionality from Node.js if we can get it upstreamed in libuv 👍

I also think it's perfectly okay to have functionality in Node.js that improves platform ergonomics ... sometimes it's harder to fix things in a lower level, which can be relatively easy to fix a layer of abstraction up.

My two cents

If I'm understanding correctly, Node.js' own test suites started leaving .git folders around because we ourselves were relying on rimraf's fixing of EPERM on Windows? This is a strong indicator for me that I would consider this change breaking, and without a strong user case for doing so, I would avoid making this change.

Having said this, I'm very supportive of:

  • removing functionality from Node if behavior was added upstream to libuv.
  • signing off on a PR that explains the current behavior.
  • revisiting this decision if there are real world examples as to why the current behavior of rimraf is a bad idea.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vtjnash vtjnash mentioned this pull request Mar 10, 2022
Update to libuv v1.44.1 #42290
Closed
@RaisinTen

RaisinTen commented Mar 18, 2022

Copy link
Copy Markdown
Member Author

I don't think this is worth the breakage anymore.

bcoe reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen RaisinTen closed this Mar 18, 2022
@RaisinTen
RaisinTen deleted the fs/stop-fixing-EPERM-on-Windows branch March 18, 2022 06:31
@bcoe

bcoe commented Mar 20, 2022

Copy link
Copy Markdown
Contributor

@RaisinTen thanks for being understanding, regarding the tradeoffs discussed in this thread 👍

One thought, we should probably still add a test for deleting .git potentially -- if this is was one of the main motivators for the EPERM fix on Windows.

RaisinTen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@RaisinTen RaisinTen removed the review wanted PRs that need review. label Mar 20, 2022
RaisinTen added a commit to RaisinTen/node that referenced this pull request Mar 20, 2022
@RaisinTen
test,fs: add fs.rm() tests for .git directories
7edad00
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: nodejs#38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>
@RaisinTen RaisinTen mentioned this pull request Mar 20, 2022
test,fs: add fs.rm() tests for .git directories #42410
Merged
@RaisinTen

RaisinTen commented Mar 20, 2022

Copy link
Copy Markdown
Member Author

@bcoe I've sent a PR to add the tests - #42410. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nodejs-github-bot pushed a commit that referenced this pull request Mar 28, 2022
@RaisinTen
test,fs: add fs.rm() tests for .git directories
5a138b5
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
juanarbol pushed a commit that referenced this pull request Apr 4, 2022
@RaisinTen @juanarbol
test,fs: add fs.rm() tests for .git directories
3f5b004
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
juanarbol pushed a commit to juanarbol/node that referenced this pull request Apr 5, 2022
@RaisinTen @juanarbol
test,fs: add fs.rm() tests for .git directories
470e911
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: nodejs#38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs#42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
juanarbol pushed a commit that referenced this pull request Apr 6, 2022
@RaisinTen @juanarbol
test,fs: add fs.rm() tests for .git directories
19c933c
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
xtx1130 pushed a commit to xtx1130/node that referenced this pull request Apr 25, 2022
@RaisinTen @xtx1130
test,fs: add fs.rm() tests for .git directories
e4c9ac2
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: nodejs#38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs#42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
juanarbol pushed a commit that referenced this pull request May 31, 2022
@RaisinTen @juanarbol
test,fs: add fs.rm() tests for .git directories
a195b4f
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
@RaisinTen @danielleadams
test,fs: add fs.rm() tests for .git directories
5e897c1
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
@RaisinTen @targos
test,fs: add fs.rm() tests for .git directories
40b9148
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 11, 2022
@RaisinTen @targos
test,fs: add fs.rm() tests for .git directories
92e829e
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this pull request Jul 31, 2022
@RaisinTen @targos
test,fs: add fs.rm() tests for .git directories
1641ff5
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: #38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: #42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
@RaisinTen @guangwong
test,fs: add fs.rm() tests for .git directories
dd287cc
Git for Windows creates read-only files inside the .git directory.
fs.rm() was built in a way, to work around any EPERM error that can
happen while deleting the .git directory by turning the directory
into a writable one. This change adds a regression test for that.

Refs: isaacs/rimraf#21
Refs: nodejs/node#38810 (comment)
Signed-off-by: Darshan Sen <[email protected]>

PR-URL: nodejs/node#42410
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request May 5, 2026
Cross-platform hardening: status hints, deploy/build UX, .jwebgen-only tooling Mourtalla-8/jwebgen#16
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aduh95 aduh95 aduh95 approved these changes
@richardlau richardlau Awaiting requested review from richardlau
@Trott Trott Awaiting requested review from Trott
+3 more reviewers
@bl-ue bl-ue bl-ue left review comments
@boneskull boneskull boneskull requested changes
@targos targos targos requested changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. needs-citgm PRs that need a CITGM CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@RaisinTen @aduh95 @Linkgoron @nodejs-github-bot @targos @richardlau @bcoe @isaacs @Trott @boneskull @bl-ue
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.