GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — fs: stop fixing EPERM on Windows by RaisinTen · Pull Request #38810 · nodejs/node Conversation
|
|
What should be the semverness of this change? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@nodejs/fs |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@targos Yes I think one of the CI runs here is to blame, how do we fix it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/cc @nodejs/build-infra ^ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@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 Why don't we run https://ci.nodejs.org/job/git-clean-windows/ at the end of every CI run on the Windows hosts? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
That is right. 😕 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Maybe we could change the tmpdir |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
@Linkgoron Updated tmpdir. PTAL. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
|
It might be just an unlucky coincidence, https://github.com/nodejs/node/actions/workflows/build-windows.yml |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
👍 @nodejs/tooling Pinging again for review because a week has passed and we didn't get any review yet. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@RaisinTen with regards to this change, my concern is that the 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? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
The semantics around removing read-only files differs between Windows and Posix.
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 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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@RaisinTen @isaacs perhaps rather than landing this change, we could land a test that demonstrates initializing an empty git repo, and then uses And then add a comment to our implementation which explains @isaacs' reasoning in detail. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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.
There was an error while loading. Please reload this page.
|
If we want to 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 Windows users can run
Here too, an initial |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
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
It felt okay to have this, while having Windows users can run chmod() before removing .gitMany folks relying on Someone writing a library that generates 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.jsI'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 centsIf I'm understanding correctly, Node.js' own test suites started leaving Having said this, I'm very supportive of:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I don't think this is worth the breakage anymore. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@RaisinTen thanks for being understanding, regarding the tradeoffs discussed in this thread 👍 One thought, we should probably still add a test for deleting |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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]>
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.