-
Notifications
You must be signed in to change notification settings - Fork 47
fix: yarn types crash when /tmp is cross-device
#454
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: yarn types crash when /tmp is cross-device
#454
Conversation
rbtying
left a comment
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.
Thank you for fixing this!
The types update is rarely run, so I think always using copy is fine from a performance perspective. Do you mind doing that?
Thanks!
df65335 to
4934ae1
Compare
|
Done. I've also rebased on to latest The diff also contains changes to the generated files (from when I ran It removed some leading |
|
@elldritch I think you might be missing a |
|
@rbtying Good catch! Pushed. EDIT: It looks like this still chose to prefer |
|
Hm, perhaps we should update prettier here since it fails eslint now! Let me take a stab at this later, though -- thank you for getting it this far! |
This PR modifies
json-schemabin/src/main.rsso that the script attempts tofs::copyif thefs::renamefails. On my machine, this fails because I'm running Arch Linux and/tmpis mounted on a different device than/home.You can see another example of this error in rust-lang/rustup#1239.
Ideally, we would match on
e.kind(), but unfortunately theCrossesDeviceserror enum value is not yet available in stable, only nightly (see https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.CrossesDevices).Another simpler alternative here would be to always do a
copyinstead of arename, although this might slow down builds a little bit on unaffected machines.