-
Notifications
You must be signed in to change notification settings - Fork 2.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
Use UV_FS_COPYFILE_FICLONE flag in fs.copyFile when available #6302
Conversation
src/util/fs-normalized.js
Outdated
@@ -38,7 +38,7 @@ export const unlink: (path: string) => Promise<void> = promisify(require('rimraf | |||
export const copyFile = async function(data: CopyFileAction, cleanup: () => mixed): Promise<void> { | |||
try { | |||
await unlink(data.dest); | |||
await copyFilePoly(data.src, data.dest, 0, data); | |||
await copyFilePoly(data.src, data.dest, (fs.constants: any).COPYFILE_FICLONE || 0, data); |
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.
Hmm. This is unfortunate.
The flow error you're suppressing here is because Flow's built-in types for Node.js are missing this constant. I have submitted a PR to Flow to fix this, but even if that gets merged and released we can't immediately pull it in here. There were Flow errors introduced with a recent update that still need to be fixed first.
So in the meantime, bypassing this type check in some manner is appropriate I think. Typically this is done with a $FlowFixMe
comment though, so that we know that we should come back and fix this at some point. I don't know what the maintainers would prefer here.
The benefit of using $FlowFixMe
is that it would mark the line as something to fix later. You could also mention the PR that is required. The downside would be that it would suppress type errors elsewhere in this line.
It's probably worthwhile using the comment instead.
Hooray! 🎉 Great work, I did't expect simple implementation like that really, but let's celebrate 🎈 and thank you! Where is this used, it will apply on every |
HI |
Can you share your node version + system?
…On Wed, Sep 26, 2018, 11:40 AM manishmkr45 ***@***.***> wrote:
HI
Getting this error -
error An unexpected error occurred: "Cannot read property
'COPYFILE_FICLONE' of undefined".
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#6302 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA_WayfHCjUW6KusCbVzonIjIOrsGHs4ks5ue1mogaJpZM4WIgMg>
.
|
Node version is 6.14.3 |
I'm also seeing this problem as of an hour ago.
We've also got
|
I'm about to take a train so I can't investigate at the moment, but if
someone can put up a PR with a fix I'll release a patch release as soon as
I can.
…On Wed, Sep 26, 2018, 12:07 PM Craig J. Bass ***@***.***> wrote:
I'm also seeing this problem as of an hour ago.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#6302 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA_Wawh4K9M3JNgw_f9S-9DmEJBCLuDPks5ue1_6gaJpZM4WIgMg>
.
|
All hail the train station free wifi: #6432 |
Fixed in the 1.10.1, now available 🙂
…On Wed, Sep 26, 2018, 1:45 PM Maël Nison ***@***.***> wrote:
All hail the train station free wifi: #6432
<#6432>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6302 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA_Wa07YVPHfZVsr86ak-izc8yZJzcMsks5ue2jygaJpZM4WIgMg>
.
|
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.
Hi,
This change breaks yarn on some platforms, see for example #7152, #7440 .
The consequence being that also seemingly unrelated projects break: jupyterlab/jupyterlab#6969.
Cheers.
Summary
Fixes #5456.
This flag increases performance and saves disk space on COW filesystems that support this flag (APFS, btrfs). On my machine running High Sierra, this decreases
yarn install --offline
time from 9.24s to 6.89s for a project with a lot of dependencies.Test plan
yarn run test
passes