Skip to content

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

Closed
@derekchiang

Description

@derekchiang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions