-
Notifications
You must be signed in to change notification settings - Fork 29.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
macOS binaries: UV_FS_COPYFILE_FICLONE not supported #24521
Comments
I'm unclear on what you mean by that: another node binary, or another program entirely? If it's the former, where did you get it from? |
Another node binary. 11.2.0, installed via |
Okay, I understand what you mean now. It sounds like the release binaries were built on a system whose headers don't define @nodejs/releasers Can one of you confirm? I'm having a hard time tracking down the machine used to build them. The define should be in /usr/include/copyfile.h (that's where it is on my system anyway.) |
@bnoordhuis version 11.2.0 was built on
Version 15.0.0 seems to be OS X El Capitan. |
Yep, it's missing
|
I had a look and I think it's unfixable short-term. Libuv can't hard-code the value because copyfile() blissfully ignores flags it doesn't know about. That would break the API contract that states Theoretically, libuv could call clonefileat/fclonefileat() directly instead of going through copyfile() but that's basically reimplementing copyfile(), and probably poorly. edit: Perhaps libuv can turn the compile-time guard into a runtime OS version check. Needs investigation. |
So, does this call for switching to 10.12+ for Node 12 release builds? |
Using #ifdef guards is not reliable because libuv may have been compiled on a newer system than what it runs on, or vice versa. Fixes: libuv#2088 Fixes: nodejs/node#24521
@rvagg I think we can work around this in libuv, see libuv/libuv#2092. |
Using #ifdef guards is not reliable because libuv may have been compiled on a newer system than what it runs on, or vice versa. Fixes: libuv#2088 Fixes: nodejs/node#24521 PR-URL: libuv#2092 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This should be fixed the next time libuv is upgraded, probably sometime next month. |
PR-URL: nodejs#25078 Fixes: nodejs#24521 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
PR-URL: nodejs#25078 Fixes: nodejs#24521 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Using #ifdef guards is not reliable because libuv may have been compiled on a newer system than what it runs on, or vice versa. Fixes: libuv#2088 Fixes: nodejs/node#24521 PR-URL: libuv#2092 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Node binaries from the official pkg distribution do not support copy-on-write (
UV_FS_COPYFILE_FICLONE
) on apfs-formatted volumes.Steps to reproduce
Generate a file (3MB here, size is not important) to clone later
In the node REPL, run:
In the official node binary, this error is raised:
With a binary that supports this feature, the file is cloned normally. You can verify that the clone call works as intended by cloning a large file and checking the volume size on Disk Utility. It doesn't create a hardlink. Changes to the clone don't affect the original file.
Implications
This bug also affects users of nvm and n who install prebuilt binaries (the default behavior). brew users are not impacted as the prebuilt binary (bottle) is built with support for this flag.
Yarn is directly affected by this.
UV_FS_COPYFILE_FICLONE
falls back to normal copying, negating the performance and disk space benefits of cloning.The text was updated successfully, but these errors were encountered: