-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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: fix mkdirp return UV_EROFS on read-only fs #48105
base: main
Are you sure you want to change the base?
Conversation
3d14ad9
to
b4a60a3
Compare
Hey @hiimjako, thank you for considering to contribute. Your commit (b4a60a3) is pointing at an invalid user, make sure you've configured Git to point to you so that you would be shown as a contributor after your changes are accepted and merged. A commit pointing to an invalid user can generally be caused by it being committed by the incorrect email address, make sure the $ git config --global user.email "<primary email>" (Replace You can check the Git getting started guide for more information. After all that, force-push the commit to make it point to you. |
b4a60a3
to
237b429
Compare
Hi @VoltrexKeyva, Thanks for the suggestion, I was using another email for other things and I forgot to change it :) Now it should be right |
Can we simulate a readonly environment and add a test for this? I don't feel comfortable merging this without any tests, unless someone more knowledgable on this matter reviews and approves this PR. |
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.
Thanks for the PR. Please include a test
test: add test for mkdir running in read-only filesystem
Hi @RafaelGSS, |
Hey @RafaelGSS, any chance you'll be able to take a look at this PR soon? 🤞 |
@@ -173,6 +174,31 @@ function nextdir() { | |||
); | |||
} | |||
|
|||
// mkdirpSync when interacting with read-only filesystem. | |||
if (common.isLinux && process.getuid() === 0) // Mounting filesystem requires root privilege. |
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 have a test environment that would enter into this clause? @nodejs/build
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.
We do not.
Fixes: #47098
I tested the changes manually by mounting a read-only fs and trying to create a new folder inside it.
I honestly wouldn't know how to write tests on these changes without mounting a RO file systems during test sets, and I don't know if this is the best solution. If anyone has advice on how to do this, it is welcome