Skip to content
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

run-cache: fix push from Windows to remote filesystems #7873

Merged
merged 1 commit into from
Jun 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions dvc/stage/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def restore(self, stage, run_cache=True, pull=False):
cached_stage.checkout()

def transfer(self, from_odb, to_odb):
from dvc.fs import LocalFileSystem
from dvc.fs.callbacks import Callback

from_fs = from_odb.fs
Expand All @@ -226,6 +227,9 @@ def transfer(self, from_odb, to_odb):

for src in from_fs.find(runs):
rel = from_fs.path.relpath(src, from_odb.fs_path)
if not isinstance(to_fs, LocalFileSystem):
rel = from_fs.path.as_posix(rel)
Comment on lines +230 to +231
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@efiop, this shows that we really need to use posix paths everywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this should be mitigated with run-cache object introduction.


dst = to_fs.path.join(to_odb.fs_path, rel)
key = to_fs.path.parent(dst)
# check if any build cache already exists for this key
Expand Down