Skip to content
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

copyFile with file clone throw not implemented on macOS #53498

Closed
ido-pluto opened this issue Jun 18, 2024 · 5 comments
Closed

copyFile with file clone throw not implemented on macOS #53498

ido-pluto opened this issue Jun 18, 2024 · 5 comments
Labels
fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. macos Issues and PRs related to the macOS platform / OSX.

Comments

@ido-pluto
Copy link

ido-pluto commented Jun 18, 2024

Version

v22.3.0

Platform

Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

Subsystem

No response

What steps will reproduce the bug?

fs.copyFile("source.file", "dest.file", fs.constants.COPYFILE_FICLONE_FORCE, console.log)

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior? Why is that the expected behavior?

File clone

What do you see instead?

[Error: ENOSYS: function not implemented, copyfile '***' -> '***'] {
  errno: -78,
  code: 'ENOSYS',
  syscall: 'copyfile',
  path: '***',
  dest: '***'
}

Additional information

No response

@tniessen tniessen added fs Issues and PRs related to the fs subsystem / file system. macos Issues and PRs related to the macOS platform / OSX. labels Jun 18, 2024
@tniessen
Copy link
Member

The documentation states:

If present, the copy operation will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then the operation will fail with an error.

Do you have reason to believe that the underlying platform does support copy-on-write reflinks in a manner supported by Node.js?

@ido-pluto
Copy link
Author

@tniessen
Yes, it works perfectly on Bun.js and other js runtimes

@theanarkh
Copy link
Contributor

See #44747.

@juanarbol juanarbol added the libuv Issues and PRs related to the libuv dependency or the uv binding. label Jun 30, 2024
@juanarbol
Copy link
Member

juanarbol commented Jun 30, 2024

That was removed from libuv due to a bug in macOS kernel. Please take a look at libuv/libuv#3987 (comment)

just FYI, I created a -no that strict- CoW on macOS that could fix this particular issue, but seems to be staled, see libuv/libuv#4405

This issue will remain open until apple fix their kernel implementation of file clone operation or someone opens a better implementation on libuv.

@juanarbol
Copy link
Member

On the other hand. Forgot to mention that this is a dupe of nodejs/performance#110. So I’ll close this as it is already on the Node.js agenda and it has an open PR to address it. Sorry for the inconveniences, feel free to re open if needed

@juanarbol juanarbol closed this as not planned Won't fix, can't repro, duplicate, stale Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. libuv Issues and PRs related to the libuv dependency or the uv binding. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

4 participants