-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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: remove macOS-specific copyfile(3) #2233
Conversation
Using copyfile(3) on macOS apparently results in situations where file permissions are ignored. Using the same code for other UNIX-like operating systems seems to fix the issue. Refs: nodejs/node#26936 (comment)
On macOS, fs.copyFile() may not respect file permissions. There is a PR for libuv that should fix this, but until it lands and we can either float a patch or upgrade libuv, have a known_issues test. Ref: nodejs#26936 Ref: libuv/libuv#2233
(Seems like this should get a test, but I don't know enough about libuv's tests to write one quickly so I'm going to sleep now. If someone else writes the test or leaves me hints or links, awesome. I do have an open PR to add a test to Node.js for this. If that's sufficient, great.) EDIT: Actually, the test setup looks straightforward. 👍 |
Please add a test case in |
Do we generally report these sort of bugs to the respective projects? |
Add test to test-fs-copyfile.c to check that uv_fs_copyfile() respects destination file permissions. Previously, in macOS, it did not.
Test added. PTAL. |
(The test fails for me on Mojave with current libuv |
Not sure if this is the right way to run CI on libuv, but it seems like it probably is?: https://ci.nodejs.org/view/libuv/job/libuv-test-pipeline/49/ |
I generally use https://ci.nodejs.org/view/libuv/job/libuv-test-commit/. And, if you want to test in the context of Node's test suite: https://ci.nodejs.org/view/libuv/job/libuv-in-node/ |
CI: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1329/ Looks like my test doesn't compile on Windows? |
Hi! Welcome to libuv 👋 On a more serious note, I think you can |
OK, used https://ci.nodejs.org/view/libuv/job/libuv-test-commit/1330/ |
The libuv CI is OK. The failures are #2234. The failures in the Node CI seem unrelated, although it would be preferable if macOS passed there. |
Couldn't figure out how to quickly/easily rebuild just macOS, so here's a full re-run to see what happens: |
(CI re-run is yellow, which I imagine is close-enough to green.) |
On macOS, fs.copyFile() may not respect file permissions. There is a PR for libuv that should fix this, but until it lands and we can either float a patch or upgrade libuv, have a known_issues test. Ref: nodejs#26936 Ref: libuv/libuv#2233 PR-URL: nodejs#26939 Refs: nodejs#26936 Refs: libuv/libuv#2233 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Now that nodejs/node#26939 landed in Node, I ran the libuv+Node integration CI again. I would expect the new test in that PR, Here is the new CI run https://ci.nodejs.org/view/libuv/job/libuv-in-node/90/ where macOS comes back green. |
I think nodejs/node#27024 addresses the issue, meaning this is still 👍 |
On macOS, fs.copyFile() may not respect file permissions. There is a PR for libuv that should fix this, but until it lands and we can either float a patch or upgrade libuv, have a known_issues test. Ref: #26936 Ref: libuv/libuv#2233 PR-URL: #26939 Refs: #26936 Refs: libuv/libuv#2233 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Anything more for me to do before this is merge-able? |
On macOS, fs.copyFile() may not respect file permissions. There is a PR for libuv that should fix this, but until it lands and we can either float a patch or upgrade libuv, have a known_issues test. Ref: #26936 Ref: libuv/libuv#2233 PR-URL: #26939 Refs: #26936 Refs: libuv/libuv#2233 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
I don't think there is anything left to do, but I'm going to run the Node integration CI once more: https://ci.nodejs.org/view/libuv/job/libuv-in-node/91/ |
The integration CI looks good. The only failure was |
Using copyfile(3) on macOS apparently results in situations where file permissions are ignored. Using the same code for other UNIX-like operating systems seems to fix the issue. Refs: nodejs/node#26936 (comment) PR-URL: #2233 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Add test to test-fs-copyfile.c to check that uv_fs_copyfile() respects destination file permissions. Previously, in macOS, it did not. PR-URL: #2233 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Landed in d0fb86c...c7b87b0. Thanks, and congrats on your first commit(s). |
This seems to remove support for |
On macOS, fs.copyFile() may not respect file permissions. There is a PR for libuv that should fix this, but until it lands and we can either float a patch or upgrade libuv, have a known_issues test. Ref: #26936 Ref: libuv/libuv#2233 PR-URL: #26939 Refs: #26936 Refs: libuv/libuv#2233 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
On macOS, fs.copyFile() may not respect file permissions. There is a PR for libuv that should fix this, but until it lands and we can either float a patch or upgrade libuv, have a known_issues test. Ref: #26936 Ref: libuv/libuv#2233 PR-URL: #26939 Refs: #26936 Refs: libuv/libuv#2233 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
@devongovett I agree that this change may be regressive. Since we are doing the chmod stuff anyways on the normal path, maybe I can try restoring it. As long as the test passes we are in the clear. |
Using copyfile(3) on macOS apparently results in situations where file
permissions are ignored. Using the same code for other UNIX-like
operating systems seems to fix the issue.
Refs: nodejs/node#26936 (comment)
@cjihrig