Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9b24b63

Browse files
committed
iOS,macOS: Add logging of duplicate codesign binaries
When duplicates are found in the input lists, log them to stderr. For the case of duplicates across list, we print the whole list, sorted, rather than three separate lists, as it makes it simpler to spot the duplicate, at which point the file will be easy to spot in either `create_ios_framework.py` or `create_macos_framework.py`.
1 parent 19d2eb4 commit 9b24b63

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sky/tools/sky_utils.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,25 @@ def assert_valid_codesign_config(
3333
either entitlements or without_entitlements."""
3434
if _contains_duplicates(entitlements):
3535
log_error('ERROR: duplicate value(s) found in entitlements.txt')
36+
log_error_items(sorted(entitlements))
3637
sys.exit(os.EX_DATAERR)
3738

3839
if _contains_duplicates(without_entitlements):
3940
log_error('ERROR: duplicate value(s) found in without_entitlements.txt')
41+
log_error_items(sorted(without_entitlements))
4042
sys.exit(os.EX_DATAERR)
4143

4244
if _contains_duplicates(unsigned_binaries):
4345
log_error('ERROR: duplicate value(s) found in unsigned_binaries.txt')
46+
log_error_items(sorted(unsigned_binaries))
4447
sys.exit(os.EX_DATAERR)
4548

4649
if _contains_duplicates(entitlements + without_entitlements + unsigned_binaries):
47-
log_error('ERROR: value(s) found in both entitlements and without_entitlements.txt')
50+
log_error(
51+
'ERROR: duplicate value(s) found between '
52+
'entitlements.txt, without_entitlements.txt, unsigned_binaries.txt'
53+
)
54+
log_error_items(sorted(entitlements + without_entitlements + unsigned_binaries))
4855
sys.exit(os.EX_DATAERR)
4956

5057
binaries = set()
@@ -254,6 +261,12 @@ def log_error(message):
254261
print(message, file=sys.stderr)
255262

256263

264+
def log_error_items(items):
265+
"""Writes each item indented to stderr, followed by a newline."""
266+
for item in items:
267+
log_error(' ' + item)
268+
269+
257270
def strip_binary(binary_path, unstripped_copy_path):
258271
"""Makes a copy of an unstripped binary, then strips symbols from the binary."""
259272
assert_file(binary_path, 'binary to strip')

0 commit comments

Comments
 (0)