Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 120d747

Browse files
authored
[lldb] Change directory creation logic in framework-header-fix (llvm#158355)
It's possible for this logic to fail if the build system runs this script in parallel. One instance could create the directory in between another instance's checking of its existence and attempt at creation. Instead, always try to create it and ignore any FileExistsErrors. rdar://160120161
1 parent 8ac67aa commit 120d747

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lldb/scripts/framework-header-fix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ def main():
115115
unifdef_guards = ["-U" + guard for guard in args.unifdef_guards]
116116

117117
# Create the framework's header dir if it doesn't already exist
118-
if not os.path.exists(os.path.dirname(output_file_path)):
118+
try:
119119
os.makedirs(os.path.dirname(output_file_path))
120+
except FileExistsError:
121+
pass
120122

121123
if framework_version == "lldb_main":
122124
modify_main_includes(input_file_path, output_file_path)

0 commit comments

Comments
 (0)