1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

Fix symlink creation on windows

This commit is contained in:
Bert Belder 2018-07-21 03:52:00 +02:00 committed by Ryan Dahl
parent 5d1cb54261
commit 709b0cb90c
2 changed files with 8 additions and 4 deletions

View file

@ -25,10 +25,10 @@ run(["cargo", "fetch", "--manifest-path=" + root_path + "/Cargo.toml"],
run(["gclient", "sync", "--reset", "--shallow", "--no-history", "--nohooks"],
envs={'GCLIENT_FILE': root_path + "/gclient_config.py"})
# TODO(ry) Is it possible to remove these symlinks?
remove_and_symlink("v8/third_party/googletest", "googletest")
remove_and_symlink("v8/third_party/jinja2", "jinja2")
remove_and_symlink("v8/third_party/llvm-build", "llvm-build")
remove_and_symlink("v8/third_party/markupsafe", "markupsafe")
remove_and_symlink("v8/third_party/googletest", "googletest", True)
remove_and_symlink("v8/third_party/jinja2", "jinja2", True)
remove_and_symlink("v8/third_party/llvm-build", "llvm-build", True)
remove_and_symlink("v8/third_party/markupsafe", "markupsafe", True)
# To update the deno_third_party git repo after running this, try the following:
# cd third_party

View file

@ -36,6 +36,10 @@ def symlink(target, name, target_is_dir=False):
CreateSymbolicLinkW.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p,
ctypes.c_uint32)
# Replace forward slashes by backward slashes.
# Strangely it seems that this is only necessary for symlinks to files.
# Forward slashes don't cause any issues when the target is a directory.
target = target.replace("/", "\\")
flags = 0x02 # SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
if (target_is_dir):
flags |= 0x01 # SYMBOLIC_LINK_FLAG_DIRECTORY