Skip to content

Commit f54a747

Browse files
authored
Merge pull request swiftlang#26182 from apple/shahmishal/update-checkout-llvm-monorepo
[update-checkout] Add support for LLVM-Project mono repo by creating symlink
2 parents 9496096 + 1b4b7f9 commit f54a747

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

utils/update_checkout/update-checkout-config.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
"indexstore-db": {
4646
"remote": { "id": "apple/indexstore-db" } },
4747
"sourcekit-lsp": {
48-
"remote": { "id": "apple/sourcekit-lsp" } }
48+
"remote": { "id": "apple/sourcekit-lsp" } },
49+
"llvm-project": {
50+
"remote": { "id": "apple/llvm-project-v1" } }
4951
},
5052
"default-branch-scheme": "master",
5153
"branch-schemes": {
@@ -75,6 +77,27 @@
7577
"sourcekit-lsp": "master"
7678
}
7779
},
80+
"master-llvm-monorepo": {
81+
"aliases": ["master-llvm-monorepo"],
82+
"repos": {
83+
"llvm-project": "swift/master",
84+
"swift": "master",
85+
"cmark": "master",
86+
"llbuild": "master",
87+
"swiftpm": "master",
88+
"swift-syntax": "master",
89+
"swift-stress-tester": "master",
90+
"swift-corelibs-xctest": "master",
91+
"swift-corelibs-foundation": "master",
92+
"swift-corelibs-libdispatch": "master",
93+
"swift-integration-tests": "master",
94+
"swift-xcode-playground-support": "master",
95+
"ninja": "release",
96+
"icu": "release-61-1",
97+
"indexstore-db": "master",
98+
"sourcekit-lsp": "master"
99+
}
100+
},
78101
"next" : {
79102
"aliases": ["next", "master-next",
80103
"stable-next", "upstream",
@@ -103,6 +126,27 @@
103126
"sourcekit-lsp": "master"
104127
}
105128
},
129+
"master-next-llvm-monorepo" : {
130+
"aliases": ["master-next-llvm-monorepo"],
131+
"repos": {
132+
"llvm-project": "swift/master-next",
133+
"swift": "master-next",
134+
"cmark": "master",
135+
"llbuild": "master",
136+
"swiftpm": "master",
137+
"swift-syntax": "master",
138+
"swift-stress-tester": "master",
139+
"swift-corelibs-xctest": "master",
140+
"swift-corelibs-foundation": "master",
141+
"swift-corelibs-libdispatch": "master",
142+
"swift-integration-tests": "master",
143+
"swift-xcode-playground-support": "master",
144+
"ninja": "release",
145+
"icu": "release-61-1",
146+
"indexstore-db": "master",
147+
"sourcekit-lsp": "master"
148+
}
149+
},
106150
"swift-3.0-branch" : {
107151
"aliases": ["swift-3.0-branch"],
108152
"repos": {

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def update_single_repository(pool_args):
8585
source_root, config, repo_name, scheme_name, scheme_map, tag, timestamp, \
8686
reset_to_remote, should_clean, cross_repos_pr = pool_args
8787
repo_path = os.path.join(source_root, repo_name)
88-
if not os.path.isdir(repo_path):
88+
if not os.path.isdir(repo_path) or os.path.islink(repo_path):
8989
return
9090

9191
try:
@@ -408,6 +408,23 @@ def skip_list_for_platform(config):
408408
return skip_list
409409

410410

411+
def symlink_llvm_monorepo(args):
412+
print("Create symlink for LLVM Project")
413+
llvm_projects = ['clang',
414+
'llvm',
415+
'lldb',
416+
'compiler-rt',
417+
'libcxx',
418+
'clang-tools-extra']
419+
for project in llvm_projects:
420+
src_path = os.path.join(args.source_root,
421+
'llvm-project',
422+
project)
423+
dst_path = os.path.join(args.source_root, project)
424+
if not os.path.islink(dst_path):
425+
os.symlink(src_path, dst_path)
426+
427+
411428
def main():
412429
freeze_support()
413430
parser = argparse.ArgumentParser(
@@ -489,6 +506,10 @@ def main():
489506
help="The root directory to checkout repositories",
490507
default=SWIFT_SOURCE_ROOT,
491508
dest='source_root')
509+
parser.add_argument(
510+
'--symlink-llvm-monorepo',
511+
help='Create symlink from LLVM-Project to source root directory',
512+
action='store_true')
492513
args = parser.parse_args()
493514

494515
if not args.scheme:
@@ -560,6 +581,8 @@ def main():
560581
if fail_count > 0:
561582
print("update-checkout failed, fix errors and try again")
562583
else:
584+
if args.symlink_llvm_monorepo:
585+
symlink_llvm_monorepo(args)
563586
print("update-checkout succeeded")
564587
print_repo_hashes(args, config)
565588
sys.exit(fail_count)

0 commit comments

Comments
 (0)