@@ -3267,10 +3267,12 @@ for host in "${ALL_HOSTS[@]}"; do
3267
3267
3268
3268
# Copy executables and shared libraries from the `host_install_destdir` to
3269
3269
# INSTALL_SYMROOT and run dsymutil on them.
3270
- (cd " ${CURRENT_INSTALL_DIR} " &&
3271
- find ./" ${CURRENT_PREFIX} " -perm -0111 -type f -print | \
3272
- filter_paths " ${DARWIN_SYMROOT_PATH_FILTERS} " | \
3273
- cpio --insecure -pdm -v " ${host_symroot} " )
3270
+ if [ -d " ${CURRENT_INSTALL_DIR} " ]; then
3271
+ (cd " ${CURRENT_INSTALL_DIR} " &&
3272
+ find ./" ${CURRENT_PREFIX} " -perm -0111 -type f -print | \
3273
+ filter_paths " ${DARWIN_SYMROOT_PATH_FILTERS} " | \
3274
+ cpio --insecure -pdm -v " ${host_symroot} " )
3275
+ fi
3274
3276
3275
3277
dsymutil_path=
3276
3278
if [[ -n " ${DARWIN_INSTALL_EXTRACT_SYMBOLS_USE_JUST_BUILT_DSYMUTIL} " ]]; then
@@ -3285,22 +3287,26 @@ for host in "${ALL_HOSTS[@]}"; do
3285
3287
# Tweak carefully the amount of parallelism -- dsymutil can be memory intensive and
3286
3288
# as such too many instance can exhaust the memory and slow down/panic the machine
3287
3289
printJSONStartTimestamp dsymutil
3288
- (cd " ${host_symroot} " &&
3289
- find ./" ${CURRENT_PREFIX} " -perm -0111 -type f -not -name " *.a" -not -name " *.py" -print | \
3290
- xargs -n 1 -P ${DSYMUTIL_JOBS} ${dsymutil_path} )
3290
+ if [ -d " ${host_symroot} " ]; then
3291
+ (cd " ${host_symroot} " &&
3292
+ find ./" ${CURRENT_PREFIX} " -perm -0111 -type f -not -name " *.a" -not -name " *.py" -print | \
3293
+ xargs -n 1 -P ${DSYMUTIL_JOBS} ${dsymutil_path} )
3294
+ fi
3291
3295
printJSONEndTimestamp dsymutil
3292
3296
3293
- # Strip executables, shared libraries and static libraries in
3294
- # `host_install_destdir`.
3295
- find " ${CURRENT_INSTALL_DIR}${CURRENT_PREFIX} /" \
3296
- ' (' -perm -0111 -or -name " *.a" ' )' -type f -print | \
3297
- xargs -n 1 -P ${BUILD_JOBS} $( xcrun_find_tool strip) -S
3298
-
3299
- # Codesign dylibs after strip tool
3300
- # rdar://45388785
3301
- find " ${CURRENT_INSTALL_DIR}${CURRENT_PREFIX} /" \
3302
- ' (' -name " *.dylib" ' )' -type f -print | \
3303
- xargs -n 1 -P ${BUILD_JOBS} $( xcrun_find_tool codesign) -f -s -
3297
+ if [ -d " ${CURRENT_INSTALL_DIR}${CURRENT_PREFIX} /" ]; then
3298
+ # Strip executables, shared libraries and static libraries in
3299
+ # `host_install_destdir`.
3300
+ find " ${CURRENT_INSTALL_DIR}${CURRENT_PREFIX} /" \
3301
+ ' (' -perm -0111 -or -name " *.a" ' )' -type f -print | \
3302
+ xargs -n 1 -P ${BUILD_JOBS} $( xcrun_find_tool strip) -S
3303
+
3304
+ # Codesign dylibs after strip tool
3305
+ # rdar://45388785
3306
+ find " ${CURRENT_INSTALL_DIR}${CURRENT_PREFIX} /" \
3307
+ ' (' -name " *.dylib" ' )' -type f -print | \
3308
+ xargs -n 1 -P ${BUILD_JOBS} $( xcrun_find_tool codesign) -f -s -
3309
+ fi
3304
3310
3305
3311
{ set +x; } 2> /dev/null
3306
3312
fi
0 commit comments