Skip to content

Commit 51fcbea

Browse files
chadaustinfacebook-github-bot
authored andcommitted
convert a path to valid glob syntax when prefetching
Summary: Paths are not necessarily legal glob syntax. In particular, backslash is used for escaping. This caused problems on Windows, where we tried to pass a backslash-delimited path into `eden prefetch --no-prefetch`. Reviewed By: xavierd Differential Revision: D25072784 fbshipit-source-id: 9ce8e5ccc8f28581512c39d04922889da0bc1bf6
1 parent b9f4f84 commit 51fcbea

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

build/fbcode_builder/getdeps/copytree.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@ def prefetch_dir_if_eden(dirpath):
5959
root = find_eden_root(dirpath)
6060
if root is None:
6161
return
62-
rel = os.path.relpath(dirpath, root)
63-
print("Prefetching %s..." % rel)
64-
subprocess.call(
65-
["edenfsctl", "prefetch", "--repo", root, "--silent", "%s/**" % rel]
66-
)
62+
glob = f"{os.path.relpath(dirpath, root).replace(os.sep, '/')}/**"
63+
print(f"Prefetching {glob}")
64+
subprocess.call(["edenfsctl", "prefetch", "--repo", root, "--silent", glob])
6765
PREFETCHED_DIRS.add(dirpath)
6866

6967

0 commit comments

Comments
 (0)