File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
utils/update_checkout/update_checkout Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -400,6 +400,28 @@ def skip_list_for_platform(config):
400
400
return skip_list
401
401
402
402
403
+ # Python 2.7 in Windows doesn't support os.symlink
404
+ os_symlink = getattr (os , "symlink" , None )
405
+ if callable (os_symlink ):
406
+ pass
407
+ else :
408
+ def symlink_ms (source , link_name ):
409
+ source = os .path .normpath (source )
410
+ link_name = os .path .normpath (link_name )
411
+ if os .path .isdir (link_name ):
412
+ os .rmdir (link_name )
413
+ elif os .exists (link_name ):
414
+ os .remove (link_name )
415
+ import ctypes
416
+ csl = ctypes .windll .kernel32 .CreateSymbolicLinkW
417
+ csl .argtypes = (ctypes .c_wchar_p , ctypes .c_wchar_p , ctypes .c_uint32 )
418
+ csl .restype = ctypes .c_ubyte
419
+ flags = 1 if os .path .isdir (source ) else 0
420
+ if csl (link_name , source , flags ) == 0 :
421
+ raise ctypes .WinError ()
422
+ os .symlink = symlink_ms
423
+
424
+
403
425
def symlink_llvm_monorepo (args ):
404
426
print ("Create symlink for LLVM Project" )
405
427
llvm_projects = ['clang' ,
You can’t perform that action at this time.
0 commit comments