@@ -180,7 +180,7 @@ def getFileBaseNameWithoutVersion(file_path) -> str:
180
180
#
181
181
#
182
182
#
183
- def getVersionVariantsForFile (file_path ) -> list [ str ] :
183
+ def getVersionVariantsForFile (file_path ):
184
184
"""
185
185
Returns the following three files for any one of the file paths provided:
186
186
`'.../ffmpeg-build-script/workspace/lib/libavcodec.58.134.100.dylib'`
@@ -206,10 +206,11 @@ def getVersionVariantsForFile(file_path) -> list[str]:
206
206
#
207
207
#
208
208
#
209
- def copyLibraryAndDependencies (src_file , dest_folder , log_file ):
209
+ def copyLibraryAndDependencies (src_file , dest_folder , log_file , parent_path = '' ):
210
210
"""
211
211
Recursive function to copy a library and its (non-system) dependencies
212
212
also fixes loader paths for each library to be `@loader_path`
213
+ :param: `parent_path` - optional argument to show which parent is linking against `src_file`
213
214
"""
214
215
215
216
dest_file = os .path .join (dest_folder , os .path .basename (src_file ))
@@ -243,7 +244,7 @@ def copyLibraryAndDependencies(src_file, dest_folder, log_file):
243
244
if src_dependency_file .startswith ('/usr/local' ):
244
245
# the build grabbed libraries installed on this machine
245
246
# which might not be available on other machines
246
- missing_libs .add (src_dependency_file )
247
+ missing_libs .add (f' { src_dependency_file } (dependency of { os . path . basename ( parent_path ) } )' )
247
248
elif src_dependency_file .startswith (workspace_dir ):
248
249
dependency_name = os .path .basename (src_dependency_file )
249
250
if not len (this_id ):
@@ -260,7 +261,11 @@ def copyLibraryAndDependencies(src_file, dest_folder, log_file):
260
261
copied_libs .add (variant_dest_file )
261
262
262
263
# RECURSIVELY copy dependencies
263
- copyLibraryAndDependencies (os .path .realpath (src_dependency_file ), dest_folder , log_file )
264
+ copyLibraryAndDependencies (
265
+ os .path .realpath (src_dependency_file ),
266
+ dest_folder ,
267
+ log_file ,
268
+ src_file )
264
269
265
270
loader_paths_to_rewrite .append ({'old_path' : src_dependency_file , 'new_path' : dest_dependency_path })
266
271
else :
@@ -376,7 +381,7 @@ def main():
376
381
build_ffmpeg_log_file .write ('=======================\n ' )
377
382
executable_path = os .path .join (workspace_bin_dir , executable )
378
383
copyOrGenerateSymbolFile (executable_path , symbol_temp_dir , build_ffmpeg_log_file )
379
- copyLibraryAndDependencies (executable_path , temp_dir , build_ffmpeg_log_file )
384
+ copyLibraryAndDependencies (executable_path , temp_dir , build_ffmpeg_log_file , executable_path )
380
385
381
386
# check that the copied file is runnable
382
387
build_ffmpeg_log_file .write ('\n Checking ' + executable + '\n ' )
0 commit comments