Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
cocoapods
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
cocoapods
Commits
07ea86c1
Commit
07ea86c1
authored
Nov 03, 2017
by
Dimitris Koutsogiorgas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be more lenient when stripping frameworks and dSYMs for non fat binaries
parent
9fc47007
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
9 deletions
+32
-9
CHANGELOG.md
CHANGELOG.md
+5
-0
embed_frameworks_script.rb
lib/cocoapods/generator/embed_frameworks_script.rb
+26
-8
cocoapods-integration-specs
spec/cocoapods-integration-specs
+1
-1
No files found.
CHANGELOG.md
View file @
07ea86c1
...
@@ -14,6 +14,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
...
@@ -14,6 +14,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
##### Bug Fixes
*
Be more lenient when stripping frameworks and dSYMs for non fat binaries
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7196
](
https://github.com/CocoaPods/CocoaPods/issues/7196
)
[
#5854
](
https://github.com/CocoaPods/CocoaPods/issues/5854
)
*
Do not display script phases warnings multiple times per platform
*
Do not display script phases warnings multiple times per platform
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
Dimitris Koutsogiorgas
](
https://github.com/dnkoutso
)
[
#7193
](
https://github.com/CocoaPods/CocoaPods/pull/7193
)
[
#7193
](
https://github.com/CocoaPods/CocoaPods/pull/7193
)
...
...
lib/cocoapods/generator/embed_frameworks_script.rb
View file @
07ea86c1
...
@@ -43,10 +43,14 @@ module Pod
...
@@ -43,10 +43,14 @@ module Pod
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# 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
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
install_framework()
{
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
...
@@ -95,7 +99,7 @@ module Pod
...
@@ -95,7 +99,7 @@ module Pod
fi
fi
}
}
# Copies
the dSYM of a vendored framework
# Copies
and strips a vendored dSYM
install_dsym() {
install_dsym() {
local source="$1"
local source="$1"
if [ -r "$source" ]; then
if [ -r "$source" ]; then
...
@@ -109,12 +113,17 @@ module Pod
...
@@ -109,12 +113,17 @@ module Pod
# Strip invalid architectures so "fat" simulator / device frameworks work on device
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
strip_invalid_archs "$binary"
fi
fi
# Move the stripped file into its final destination.
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter
\\
"- CVS/
\\
" --filter
\\
"- .svn/
\\
" --filter
\\
"- .git/
\\
" --filter
\\
"- .hg/
\\
" --filter
\\
"- Headers
\\
" --filter
\\
"- PrivateHeaders
\\
" --filter
\\
"- Modules
\\
"
\\
"${DERIVED_FILES_DIR}/${basename}.framework.dSYM
\\
"
\\
"${DWARF_DSYM_FOLDER_PATH}
\\
""
# Move the stripped file into its final destination.
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter
\\
"- CVS/
\\
" --filter
\\
"- .svn/
\\
" --filter
\\
"- .git/
\\
" --filter
\\
"- .hg/
\\
" --filter
\\
"- Headers
\\
" --filter
\\
"- PrivateHeaders
\\
" --filter
\\
"- Modules
\\
"
\\
"${DERIVED_FILES_DIR}/${basename}.framework.dSYM
\\
"
\\
"${DWARF_DSYM_FOLDER_PATH}
\\
""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
fi
fi
}
}
...
@@ -136,10 +145,18 @@ module Pod
...
@@ -136,10 +145,18 @@ module Pod
# Strip invalid architectures
# Strip invalid architectures
strip_invalid_archs() {
strip_invalid_archs() {
binary="$1"
binary="$1"
# Get architectures for current file
# Get architectures for current target binary
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
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=0
return
fi
stripped=""
stripped=""
for arch in $archs; do
for arch in $
binary_
archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
...
@@ -149,6 +166,7 @@ module Pod
...
@@ -149,6 +166,7 @@ module Pod
if [[ "$stripped" ]]; then
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
echo "Stripped $binary of architectures:$stripped"
fi
fi
STRIP_BINARY_RETVAL=1
}
}
SH
SH
...
...
cocoapods-integration-specs
@
8c89eea4
Subproject commit
cd417b2a8a34c2c8630336b29b4b4405df9500b5
Subproject commit
8c89eea40c9c7fe29af512bae03f63285913e47a
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment