[lldb] Change directory creation logic in framework-header-fix (#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
This commit is contained in:
Alex Langford 2025-09-12 16:38:29 -07:00 committed by GitHub
parent 8ac67aa8a9
commit 120d7475d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -115,8 +115,10 @@ def main():
unifdef_guards = ["-U" + guard for guard in args.unifdef_guards]
# Create the framework's header dir if it doesn't already exist
if not os.path.exists(os.path.dirname(output_file_path)):
try:
os.makedirs(os.path.dirname(output_file_path))
except FileExistsError:
pass
if framework_version == "lldb_main":
modify_main_includes(input_file_path, output_file_path)