Skip to content

Commit 46e02f6

Browse files
authored
Merge pull request swiftlang#22309 from nkcsgexi/dsym-gen-with-release
build-script: teach the script to extract symbols when installing libSyntax parser only.
2 parents 95a15d1 + 035f328 commit 46e02f6

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

utils/build-presets.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,3 +1781,4 @@ build-libparser-only
17811781
swiftsyntax
17821782
verbose-build
17831783
skip-swiftsyntax-swiftside
1784+
darwin-install-extract-symbols

utils/build-script-impl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3815,29 +3815,39 @@ for host in "${ALL_HOSTS[@]}"; do
38153815
call darwin_install_extract_symbols
38163816
else
38173817
set -x
3818+
if [ "${BUILD_LIBPARSER_ONLY}" ]; then
3819+
# We don't have a toolchain so we should install to the specified dir
3820+
CURRENT_INSTALL_DIR="${INSTALL_DESTDIR}"
3821+
CURRENT_PREFIX="/."
3822+
else
3823+
# If we have a toolchain, use the toolchain install dir.
3824+
CURRENT_INSTALL_DIR=${host_install_destdir}
3825+
CURRENT_PREFIX="${TOOLCHAIN_PREFIX}"
3826+
fi
3827+
38183828
# Copy executables and shared libraries from the `host_install_destdir` to
38193829
# INSTALL_SYMROOT and run dsymutil on them.
3820-
(cd "${host_install_destdir}" &&
3821-
find ./"${TOOLCHAIN_PREFIX}" -perm -0111 -type f -print | cpio --insecure -pdm "${INSTALL_SYMROOT}")
3830+
(cd "${CURRENT_INSTALL_DIR}" &&
3831+
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | cpio --insecure -pdm "${INSTALL_SYMROOT}")
38223832

38233833
# Run dsymutil on executables and shared libraries.
38243834
#
38253835
# Exclude shell scripts.
38263836
(cd "${INSTALL_SYMROOT}" &&
3827-
find ./"${TOOLCHAIN_PREFIX}" -perm -0111 -type f -print | \
3837+
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -print | \
38283838
grep -v crashlog.py | \
38293839
grep -v symbolication.py | \
38303840
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool dsymutil))
38313841

38323842
# Strip executables, shared libraries and static libraries in
38333843
# `host_install_destdir`.
3834-
find "${host_install_destdir}${TOOLCHAIN_PREFIX}/" \
3844+
find "${CURRENT_INSTALL_DIR}${CURRENT_PREFIX}/" \
38353845
'(' -perm -0111 -or -name "*.a" ')' -type f -print | \
38363846
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool strip) -S
38373847

38383848
# Codesign dylibs after strip tool
38393849
# rdar://45388785
3840-
find "${host_install_destdir}${TOOLCHAIN_PREFIX}/" \
3850+
find "${CURRENT_INSTALL_DIR}${CURRENT_PREFIX}/" \
38413851
'(' -name "*.dylib" ')' -type f -print | \
38423852
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool codesign) -f -s -
38433853

0 commit comments

Comments
 (0)