Skip to content

Commit ea4524c

Browse files
authored
Merge pull request #27791 from ahoppen/monorepo-symlink-errors
[update-checkout] Error message if monorepo symlinks cannot be created
2 parents d31a053 + c1cb8ee commit ea4524c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

utils/update_checkout/update_checkout/update_checkout.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,15 @@ def symlink_llvm_monorepo(args):
413413
project)
414414
dst_path = os.path.join(args.source_root, project)
415415
if not os.path.islink(dst_path):
416-
os.symlink(src_path, dst_path)
416+
try:
417+
os.symlink(src_path, dst_path)
418+
except OSError as e:
419+
if e.errno == 17:
420+
print("File '%s' already exists. Remove it, so "
421+
"update-checkout can create the symlink to the "
422+
"llvm-monorepo." % dst_path)
423+
else:
424+
raise e
417425

418426

419427
def main():

0 commit comments

Comments
 (0)