Skip to content

Commit ca66631

Browse files
committed
[build-script-impl] don't assume installation folders are created
This would be needed to both allow to dry-run the toolchain creation and allow tests for symbol filters to run Addresses rdar://82577188
1 parent 1389dce commit ca66631

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

utils/build-script-impl

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3267,10 +3267,12 @@ for host in "${ALL_HOSTS[@]}"; do
32673267

32683268
# Copy executables and shared libraries from the `host_install_destdir` to
32693269
# 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
32743276

32753277
dsymutil_path=
32763278
if [[ -n "${DARWIN_INSTALL_EXTRACT_SYMBOLS_USE_JUST_BUILT_DSYMUTIL}" ]]; then
@@ -3285,22 +3287,26 @@ for host in "${ALL_HOSTS[@]}"; do
32853287
# Tweak carefully the amount of parallelism -- dsymutil can be memory intensive and
32863288
# as such too many instance can exhaust the memory and slow down/panic the machine
32873289
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
32913295
printJSONEndTimestamp dsymutil
32923296

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
33043310

33053311
{ set +x; } 2>/dev/null
33063312
fi

0 commit comments

Comments
 (0)