Skip to content

[build-script] Avoid stripping clang builtin .a libraries when extracting dSYMs on Darwin #71986

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
Mar 1, 2024
Merged
Show file tree
Hide file tree
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: 5 additions & 4 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -3230,20 +3230,21 @@ for host in "${ALL_HOSTS[@]}"; do
printJSONStartTimestamp dsymutil
(cd "${host_symroot}" &&
find ./"${CURRENT_PREFIX}" -perm -0111 -type f -not -name "*.a" -not -name "*.py" -print | \
xargs -n 1 -P ${DSYMUTIL_JOBS} ${dsymutil_path})
xargs -t -n 1 -P ${DSYMUTIL_JOBS} ${dsymutil_path})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this flag -- that will make debugging issues much easier

printJSONEndTimestamp dsymutil

# Strip executables, shared libraries and static libraries in
# `host_install_destdir`.
# `host_install_destdir`. Avoid touching clang builtins .a files.
find "${CURRENT_INSTALL_DIR}${CURRENT_PREFIX}/" \
'(' -perm -0111 -or -name "*.a" ')' -type f -print | \
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool strip) -S
grep_that_allows_no_matches -v "/clang/lib/darwin/" | \
xargs -t -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool strip) -S

# Codesign dylibs and executables in usr/bin after strip tool
# rdar://45388785
find "${CURRENT_INSTALL_DIR}${CURRENT_PREFIX}/" \
'(' '(' -path "*/usr/bin/*" -and -perm -0111 ')' -or -name "*.dylib" ')' -type f -print | \
xargs -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool codesign) -f -s -
xargs -t -n 1 -P ${BUILD_JOBS} $(xcrun_find_tool codesign) -f -s -
fi

{ set +x; } 2>/dev/null
Expand Down
2 changes: 1 addition & 1 deletion validation-test/BuildSystem/dsymutil_jobs.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

# CHECK: --- Extracting symbols ---
# CHECK: { "command": "dsymutil", "start": "
# CHECK: xargs -n 1 -P 5 {{.*}}dsymutil
# CHECK: xargs -t -n 1 -P 5 {{.*}}dsymutil
# CHECK: { "command": "dsymutil", "end": "