Skip to content

[recursive-lipo] Also install broken symlinks #62537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions utils/recursive-lipo
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ def overlapping_lipo_architectures(file_paths, lipo_executable):
return False


# Determine whether we should consider a file as installable.
def is_installable(file):
return os.path.exists(file) or os.path.islink(file)


# Determine the path to the first file and where it should be installed.
def get_first_file_and_dest_path(file, src_root_dirs, dest_root_dir):
for dir in src_root_dirs:
orig_file = os.path.join(dir, file)
if os.path.exists(orig_file):
if is_installable(orig_file):
dest_path = os.path.join(
dest_root_dir, os.path.relpath(orig_file, dir))
return (orig_file, dest_path)
Expand All @@ -72,7 +77,7 @@ def merge_lipo_files(src_root_dirs, file_list, dest_root_dir, verbose=False,
for file in file_list:
file_paths = [
os.path.join(dir, file) for dir in src_root_dirs
if os.path.exists(os.path.join(dir, file))]
if is_installable(os.path.join(dir, file))]
if len(file_paths) == 0:
print("-- Warning: Can't locate source file %s" % file)
continue
Expand Down