Skip to content

Cache creation breaks if the .cache/cargo or .cache/rustup directories already exists #94

@arthurp

Description

@arthurp

The script uses a copy to a directory name, docker cp. This appears to have the same irritating semantics as cp: copy into the directory if it exists. This means that you end up with .cargo/.cargo if .cargo already existed.

This can happen if your cache was damaged for instance if you attempted make clean_all while some files had root:root permissions. This state is actually quite common given that we are using docker to populate the cache.

Potentialy fixes

  • Delete the directories before trying to copy and fail if that fails.
  • Copy into a temporary and use a careful copy command (or rsync has ways to do this because it interprets a trailing / in a useful way, but that adds a dependency) that always does the correct copy. (cp --no-target-directory might help, though I don't know quite how that works.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions