From e6db6ffc8915ab21e9bd8a973ace22c26636268c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Saugat=20Pachhai=20=28=E0=A4=B8=E0=A5=8C=E0=A4=97=E0=A4=BE?= =?UTF-8?q?=E0=A4=A4=29?= Date: Fri, 10 Jun 2022 18:03:59 +0545 Subject: [PATCH] runcache: fix push from Windows to remote filesystems 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. --- dvc/stage/cache.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dvc/stage/cache.py b/dvc/stage/cache.py index 1a49bc955..2027b10c9 100644 --- a/dvc/stage/cache.py +++ b/dvc/stage/cache.py @@ -213,6 +213,7 @@ class StageCache: 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 @@ -226,6 +227,9 @@ class StageCache: 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