-
-
Notifications
You must be signed in to change notification settings - Fork 935
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
Fix file cloning on macOS #5001
Comments
Hello @zkochan This is unrelated to the MacOS issue, but I just realized that my linux env (container on K8s) is using hard-links and not clone (reflinks) with pnpm.
Thanks for your work on PNPM 👍 |
There are filesystems in linux that support cloning. For instance, btrfs. |
Timeline for the capability landing (returning?) in NodeJS (via libuv) isn't looking great. Any word on just how much faster pnpm would perform on macOS with file cloning? Will make it much easier to prioritise potentially working on this as part of my current project. EDIT: Ah, I initially misread. |
When I run
Here is the complete
|
I think so |
@zkochan, do you have an interest in trying https://github.com/sverrejoh/rclonefile? |
We should give it a try. If it works, we can use it. |
In case it helps, This benchmark is with;
I also made an attempt to integrate EDIT: That said, even if the |
The libuv PR was just merged and a new libuv release is imminent. It should be available in a node release in a few weeks. |
Great, do you know which major versions of Node.js will include the fix? |
I'm afraid my crystal ball is cloudy today. The next or next-next v19.x seems like a safe bet but for older release lines, it's up to the discretion of the releaser of duty. |
@zkochan Of all the many reasons to want Putin dead, this one would probably push me over the edge! Donated some BTC/ETH. |
If you still haven't have a Mac already, github Actions supports the mac platform, unit tests can be performed from it https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners |
Thanks! I do have a mac now. Bit has purchased a workstation for me at the end of November. It helped me to work during the winter, when there were regular cutoffs of electrical power. Luckily electricity is fine now too. |
Tested rclonefile on mac and it seems to work well—although I’m not certain how to confirm that it is a clonefile and not just a copy. @zkochan This seems like a straightforward fix just a small enhancement to the function here I think: pnpm/fs/indexed-pkg-importer/src/index.ts Line 120 in e605226
But it would be helpful if you could confirm. I assume you’re still accepting PRs on this? The other question though is whether pnpm wants to depend on this package or include it’s own wrapper around this API. |
libuv pull request is included in v1.45.0. That specific version was bumped in Node's master branch. nodejs/node@9e68f94 We will have this fix included probably in Node v20.3.0. |
No, it was reverted because it caused some regressions that couldn't be fixed in a timely manner: libuv/libuv#3987 |
Will it be backported? This is sort of useless if it's not in the LTS releases. |
@zkochan Is this no longer a priority? I noticed it was unpinned. |
There is nothing we can do about it. |
We can use rclonefile, it worked well in my testing. |
Amazing work, thanks @zkochan. When will this be released to a stable version? |
In a few days |
pnpm currently uses hard links (not cloning) on macOS. This is due to an issue in Node.js: libuv/libuv#3654
As a result, pnpm is much slower on macOS. Looks like bun doesn't have this issue and as a result is a lot faster than pnpm in macOS. If Node.js is refusing to merge a fix, maybe there's another way to work it out.
Contributors are welcomed as I don't have a mac and probably won't have till the war ends.
The text was updated successfully, but these errors were encountered: