Fix copy to workspace (#9400)

This commit is contained in:
mehrdadn 2020-07-11 05:27:56 -07:00 committed by GitHub
parent 26fcda50e7
commit 5c853eaa6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -1973,7 +1973,7 @@ genrule(
outs = ["ray_pkg.out"],
cmd = """
if [ "$${OSTYPE-}" = "msys" ]; then
mv -f python/ray/_raylet.so python/ray/_raylet.pyd
ln -P -f -- python/ray/_raylet.so python/ray/_raylet.pyd
fi
# NOTE(hchen): Protobuf doesn't allow specifying Python package name. So we use this `sed`
# command to change the import path in the generated file.

View file

@ -118,8 +118,8 @@ def copy_to_workspace(name, srcs, dstdir = ""):
for f in {locations}; do
rm -f -- {dstdir}$${{f##*/}}
cp -f -- "$$f" {dstdir}
echo $$f {dstdir}$${{f##*/}}
done > $@
done
date > $@
""".format(
locations = src_locations,
dstdir = "." + ("/" + dstdir.replace("\\", "/")).rstrip("/") + "/",
@ -131,10 +131,9 @@ def copy_to_workspace(name, srcs, dstdir = ""):
) && (
for %f in ({locations}) do @(
(if exist {dstdir}%~nxf del /f /q {dstdir}%~nxf) &&
copy /B /Y %f {dstdir} >NUL &&
(echo %f {dstdir}%~nxf)
copy /B /Y %f {dstdir} >NUL
)
) > $@
) && >$@ echo %TIME%
""".replace("\r", "").replace("\n", " ").format(
locations = src_locations,
dstdir = "." + ("\\" + dstdir.replace("/", "\\")).rstrip("\\") + "\\",