Skip to content

Commit 4f98772

Browse files
authored
Merge pull request #28305 from apple/shahmishal/update-checkout-remove-symlink
[update-checkout] Remove the symlink from update-checkout because we …
2 parents 82301a5 + 332d4e2 commit 4f98772

File tree

2 files changed

+10
-49
lines changed

2 files changed

+10
-49
lines changed

utils/swift_build_support/swift_build_support/products/product.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ def product_source_name(cls):
3737
It provides a customization point for Product subclasses. It is set to
3838
the value of product_name() by default for this reason.
3939
"""
40+
41+
llvm_projects = ['clang',
42+
'clang-tools-extra',
43+
'compiler-rt',
44+
'libcxx',
45+
'lldb',
46+
'llvm']
47+
48+
if cls.product_name() in llvm_projects:
49+
return "llvm-project/{}".format(cls.product_name())
4050
return cls.product_name()
4151

4252
@classmethod

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from __future__ import print_function
1212

1313
import argparse
14-
import errno
1514
import json
1615
import os
1716
import platform
@@ -400,53 +399,6 @@ def skip_list_for_platform(config):
400399
return skip_list
401400

402401

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-
450402
def main():
451403
freeze_support()
452404
parser = argparse.ArgumentParser(
@@ -599,7 +551,6 @@ def main():
599551
if fail_count > 0:
600552
print("update-checkout failed, fix errors and try again")
601553
else:
602-
symlink_llvm_monorepo(args)
603554
print("update-checkout succeeded")
604555
print_repo_hashes(args, config)
605556
sys.exit(fail_count)

0 commit comments

Comments
 (0)