-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-implement dSYM copying and stripping to the pod target itself.
- Loading branch information
Showing
12 changed files
with
405 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
module Pod | ||
module Generator | ||
module ScriptPhaseConstants | ||
DEFAULT_SCRIPT_PHASE_HEADER = <<-SH.strip_heredoc.freeze | ||
#!/bin/sh | ||
set -e | ||
set -u | ||
set -o pipefail | ||
function on_error { | ||
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" | ||
} | ||
trap 'on_error $LINENO' ERR | ||
SH | ||
|
||
RSYNC_PROTECT_TMP_FILES = <<-SH.strip_heredoc.freeze | ||
# This protects against multiple targets copying the same framework dependency at the same time. The solution | ||
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html | ||
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")aa | ||
SH | ||
|
||
STRIP_INVALID_ARCHITECTURES_METHOD = <<-SH.strip_heredoc.freeze | ||
# Used as a return value for each invocation of `strip_invalid_archs` function. | ||
STRIP_BINARY_RETVAL=0 | ||
# Strip invalid architectures | ||
strip_invalid_archs() { | ||
binary="$1" | ||
# Get architectures for current target binary | ||
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" | ||
# Intersect them with the architectures we are building for | ||
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\\n' | sort | uniq -d)" | ||
# If there are no archs supported by this binary then warn the user | ||
if [[ -z "$intersected_archs" ]]; then | ||
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." | ||
STRIP_BINARY_RETVAL=1 | ||
return | ||
fi | ||
stripped="" | ||
for arch in $binary_archs; do | ||
if ! [[ "${ARCHS}" == *"$arch"* ]]; then | ||
# Strip non-valid architectures in-place | ||
lipo -remove "$arch" -output "$binary" "$binary" | ||
stripped="$stripped $arch" | ||
fi | ||
done | ||
if [[ "$stripped" ]]; then | ||
echo "Stripped $binary of architectures:$stripped" | ||
fi | ||
STRIP_BINARY_RETVAL=0 | ||
} | ||
SH | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.