Skip to content

Commit 82287e9

Browse files
authored
[ATfE] Fix common-headers-generate.py manual builds (#453)
When building one variant under ARM/AArch64, shutil will try to override an existing directory, leading to an Exception. Also fix a lack of space in the error message.
1 parent ce7943f commit 82287e9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

arm-software/embedded/arm-multilib/common-headers-generate.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
This is useful to reduce duplication in the toolchain by centralising common headers
2424
that are shared across architecture variants.
2525
"""
26+
2627
import argparse
2728
import os
2829
import filecmp
@@ -73,13 +74,18 @@ def extract_common_headers_for_targets(args):
7374
variant_includes = collect_variant_include_paths(input_target_dir)
7475
if len(variant_includes) < 2:
7576
print(
76-
f"Skipping extracting the common headers for {target}: not enough variants to compare.At least two variants must be enabled for the multilib header optimisation phase to proceed."
77+
f"Skipping extracting the common headers for {target}: not enough variants to compare. "
78+
"At least two variants must be enabled for the multilib header optimisation phase to proceed."
7779
)
7880
# The script always creates the multilib-optimised folder, even when there's only one variant and no
7981
# optimization is applied. In that case, multilib-optimised will just contain a copy of the
8082
# single variant from the non-optimised multilib directory.
8183
if os.path.exists(args.multilib_non_optimised_dir):
82-
shutil.copytree(args.multilib_non_optimised_dir, args.multilib_optimised_dir)
84+
shutil.copytree(
85+
args.multilib_non_optimised_dir,
86+
args.multilib_optimised_dir,
87+
dirs_exist_ok=True,
88+
)
8389
return
8490

8591
# Creating the common include headers for each target

0 commit comments

Comments
 (0)