Skip to content

rustpkg tries to move directory from /tmp, resulting in IO error when the destination is on an external device #11827

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

Closed
derekchiang opened this issue Jan 27, 2014 · 2 comments

Comments

@derekchiang
Copy link
Contributor

Steps to reproduce:

  1. cd to a path on an external device
  2. rustpkg install github.com/steveklabnik/hello

You should see a task failure. I dug a bit into the code and found the problem. Basically, when the environment variable TMPDIR is not explicitly set, rustpkg uses extra::tempfile::TempDir to store temporary files. TempDir by default operates in /tmp.

Later, rustpkg does fs::rename(&clone_target, local), in which clone_target and local are paths to different devices. libuv (the default underlying IO library) seems unable to handle this case, therefore resulting in a "cross-device link not permitted" IO error. The same error can also be reproduced with Node, as described here.

@derekchiang
Copy link
Contributor Author

I see two ways to resolve this issue:

  1. Use something like ./.rust/tmp as the temporary directory by default.
  2. When seeing this IO error, degrade to copying and deleting the source folder, instead of renaming.

@huonw
Copy link
Member

huonw commented Jan 27, 2014

Dupe of #9887.

(BTW, it's good practice to include the exact compiler/tool output to assist with searching, diagnosis and, later, checking if a bug still happens.)

@huonw huonw closed this as completed Jan 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants