Skip to content

Commit

Permalink
runcache: fix push from Windows to remote filesystems
Browse files Browse the repository at this point in the history
We were passing paths with '\\' in the filename instead of posix paths to
remote filesystems which was causing failures to upload.
Although in some filesystems, this was failing silently, so upload would seem
to have passed, but the download later would fail.
  • Loading branch information
skshetry authored and efiop committed Jun 11, 2022
1 parent 9ac2f49 commit e6db6ff
Showing 1 changed file with 4 additions and 0 deletions.
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)

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

0 comments on commit e6db6ff

Please sign in to comment.