|
11 | 11 | from __future__ import print_function
|
12 | 12 |
|
13 | 13 | import argparse
|
14 |
| -import errno |
15 | 14 | import json
|
16 | 15 | import os
|
17 | 16 | import platform
|
@@ -400,53 +399,6 @@ def skip_list_for_platform(config):
|
400 | 399 | return skip_list
|
401 | 400 |
|
402 | 401 |
|
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 |
| - |
425 |
| -def symlink_llvm_monorepo(args): |
426 |
| - print("Create symlink for LLVM Project") |
427 |
| - llvm_projects = ['clang', |
428 |
| - 'llvm', |
429 |
| - 'lldb', |
430 |
| - 'compiler-rt', |
431 |
| - 'libcxx', |
432 |
| - 'clang-tools-extra'] |
433 |
| - for project in llvm_projects: |
434 |
| - src_path = os.path.join(args.source_root, |
435 |
| - 'llvm-project', |
436 |
| - project) |
437 |
| - dst_path = os.path.join(args.source_root, project) |
438 |
| - if not os.path.islink(dst_path): |
439 |
| - try: |
440 |
| - os.symlink(src_path, dst_path) |
441 |
| - except OSError as e: |
442 |
| - if e.errno == errno.EEXIST: |
443 |
| - print("File '%s' already exists. Remove it, so " |
444 |
| - "update-checkout can create the symlink to the " |
445 |
| - "llvm-monorepo." % dst_path) |
446 |
| - else: |
447 |
| - raise e |
448 |
| - |
449 |
| - |
450 | 402 | def main():
|
451 | 403 | freeze_support()
|
452 | 404 | parser = argparse.ArgumentParser(
|
@@ -599,7 +551,6 @@ def main():
|
599 | 551 | if fail_count > 0:
|
600 | 552 | print("update-checkout failed, fix errors and try again")
|
601 | 553 | else:
|
602 |
| - symlink_llvm_monorepo(args) |
603 | 554 | print("update-checkout succeeded")
|
604 | 555 | print_repo_hashes(args, config)
|
605 | 556 | sys.exit(fail_count)
|
0 commit comments