Skip to content

Commit dd0e0dd

Browse files
committed
Strip Additional Swift Symbols from Mangling
- With newer versions of Swift, it's symbols have altered slightly and new ones introduced. Therefore we have updated our regex patterns to ensure Swift symbols are not included in our Mangling config. - Bumpe version to `1.1.1`
1 parent 854bc2d commit dd0e0dd

File tree

6 files changed

+62
-49
lines changed

6 files changed

+62
-49
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.5
1+
2.7.6

Gemfile.lock

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,82 @@
11
PATH
22
remote: .
33
specs:
4-
cocoapods-mangle (1.1.0)
5-
cocoapods (~> 1.0)
4+
cocoapods-mangle (1.1.1)
5+
cocoapods (~> 1.11.3)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
CFPropertyList (3.0.2)
11-
activesupport (4.2.11.3)
12-
i18n (~> 0.7)
13-
minitest (~> 5.1)
14-
thread_safe (~> 0.3, >= 0.3.4)
15-
tzinfo (~> 1.1)
16-
algoliasearch (1.27.3)
10+
CFPropertyList (3.0.6)
11+
rexml
12+
activesupport (6.1.7.3)
13+
concurrent-ruby (~> 1.0, >= 1.0.2)
14+
i18n (>= 1.6, < 2)
15+
minitest (>= 5.1)
16+
tzinfo (~> 2.0)
17+
zeitwerk (~> 2.3)
18+
addressable (2.8.2)
19+
public_suffix (>= 2.0.2, < 6.0)
20+
algoliasearch (1.27.5)
1721
httpclient (~> 2.8, >= 2.8.3)
1822
json (>= 1.5.1)
1923
atomos (0.1.3)
20-
claide (1.0.3)
21-
cocoapods (1.9.3)
22-
activesupport (>= 4.0.2, < 5)
24+
claide (1.1.0)
25+
cocoapods (1.11.3)
26+
addressable (~> 2.8)
2327
claide (>= 1.0.2, < 2.0)
24-
cocoapods-core (= 1.9.3)
28+
cocoapods-core (= 1.11.3)
2529
cocoapods-deintegrate (>= 1.0.3, < 2.0)
26-
cocoapods-downloader (>= 1.2.2, < 2.0)
30+
cocoapods-downloader (>= 1.4.0, < 2.0)
2731
cocoapods-plugins (>= 1.0.0, < 2.0)
2832
cocoapods-search (>= 1.0.0, < 2.0)
29-
cocoapods-stats (>= 1.0.0, < 2.0)
3033
cocoapods-trunk (>= 1.4.0, < 2.0)
3134
cocoapods-try (>= 1.1.0, < 2.0)
3235
colored2 (~> 3.1)
3336
escape (~> 0.0.4)
3437
fourflusher (>= 2.3.0, < 3.0)
3538
gh_inspector (~> 1.0)
36-
molinillo (~> 0.6.6)
39+
molinillo (~> 0.8.0)
3740
nap (~> 1.0)
38-
ruby-macho (~> 1.4)
39-
xcodeproj (>= 1.14.0, < 2.0)
40-
cocoapods-core (1.9.3)
41-
activesupport (>= 4.0.2, < 6)
41+
ruby-macho (>= 1.0, < 3.0)
42+
xcodeproj (>= 1.21.0, < 2.0)
43+
cocoapods-core (1.11.3)
44+
activesupport (>= 5.0, < 7)
45+
addressable (~> 2.8)
4246
algoliasearch (~> 1.0)
4347
concurrent-ruby (~> 1.1)
4448
fuzzy_match (~> 2.0.4)
4549
nap (~> 1.0)
4650
netrc (~> 0.11)
51+
public_suffix (~> 4.0)
4752
typhoeus (~> 1.0)
48-
cocoapods-deintegrate (1.0.4)
49-
cocoapods-downloader (1.4.0)
53+
cocoapods-deintegrate (1.0.5)
54+
cocoapods-downloader (1.6.3)
5055
cocoapods-plugins (1.0.0)
5156
nap
52-
cocoapods-search (1.0.0)
53-
cocoapods-stats (1.1.0)
54-
cocoapods-trunk (1.5.0)
57+
cocoapods-search (1.0.1)
58+
cocoapods-trunk (1.6.0)
5559
nap (>= 0.8, < 2.0)
5660
netrc (~> 0.11)
5761
cocoapods-try (1.2.0)
5862
coderay (1.1.3)
5963
colored2 (3.1.2)
60-
concurrent-ruby (1.1.7)
64+
concurrent-ruby (1.2.2)
6165
diff-lcs (1.4.4)
6266
escape (0.0.4)
63-
ethon (0.12.0)
64-
ffi (>= 1.3.0)
65-
ffi (1.13.1)
67+
ethon (0.16.0)
68+
ffi (>= 1.15.0)
69+
ffi (1.15.5)
6670
fourflusher (2.3.1)
6771
fuzzy_match (2.0.4)
6872
gh_inspector (1.1.3)
6973
httpclient (2.8.3)
70-
i18n (0.9.5)
74+
i18n (1.12.0)
7175
concurrent-ruby (~> 1.0)
72-
json (2.3.1)
76+
json (2.6.3)
7377
method_source (1.0.0)
74-
minitest (5.14.2)
75-
molinillo (0.6.6)
78+
minitest (5.18.0)
79+
molinillo (0.8.0)
7680
nanaimo (0.3.0)
7781
nap (1.1.0)
7882
netrc (0.11.0)
@@ -82,6 +86,8 @@ GEM
8286
pry-remote (0.1.8)
8387
pry (~> 0.9)
8488
slop (~> 3.0)
89+
public_suffix (4.0.7)
90+
rexml (3.2.5)
8591
rspec (3.9.0)
8692
rspec-core (~> 3.9.0)
8793
rspec-expectations (~> 3.9.0)
@@ -97,19 +103,20 @@ GEM
97103
rspec-support (3.9.3)
98104
rspec_junit_formatter (0.4.1)
99105
rspec-core (>= 2, < 4, != 2.12.0)
100-
ruby-macho (1.4.0)
106+
ruby-macho (2.5.1)
101107
slop (3.6.0)
102-
thread_safe (0.3.6)
103108
typhoeus (1.4.0)
104109
ethon (>= 0.9.0)
105-
tzinfo (1.2.7)
106-
thread_safe (~> 0.1)
107-
xcodeproj (1.18.0)
110+
tzinfo (2.0.6)
111+
concurrent-ruby (~> 1.0)
112+
xcodeproj (1.22.0)
108113
CFPropertyList (>= 2.3.3, < 4.0)
109114
atomos (~> 0.1.3)
110115
claide (>= 1.0.2, < 2.0)
111116
colored2 (~> 3.1)
112117
nanaimo (~> 0.3.0)
118+
rexml (~> 3.2.4)
119+
zeitwerk (2.6.7)
113120

114121
PLATFORMS
115122
ruby

cocoapods-mangle.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ Gem::Specification.new do |spec|
1717
spec.test_files = Dir['spec/**/*.rb']
1818
spec.extra_rdoc_files = ['README.md', 'CHANGELOG.md']
1919
spec.require_paths = ['lib']
20-
spec.add_dependency 'cocoapods', '~> 1.0'
20+
spec.add_dependency 'cocoapods', '~> 1.11.3'
2121
end

lib/cocoapods_mangle/defines.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,28 @@ def self.prefix_selectors(prefix, selectors)
121121
def self.swift_symbol?(symbol)
122122
# Swift binaries have many symbols starting with $s_ that should be excluded
123123
# e.g. '0000000000000258 S _$s9ManglePod9SomeClassCMF'
124-
symbol[/ _\$s/] ||
124+
symbol[/\$s/] ||
125125
# Internal Swift symbols starting with __swift or ___swift such as should not be mangled
126126
# e.g. '00000000000050ac S ___swift_reflection_version'
127127
symbol[/ __(_)?swift/] ||
128-
# Swift symbols starting with _symbolic should be ignored
129-
# e.g. '0000000000000248 S _symbolic _____ 9ManglePod9SomeClassC'
130-
symbol[/ _symbolic/] ||
128+
# Swift symbols starting with symbolic should be ignored
129+
# e.g. '0000000000000248 S symbolic _____ 9ManglePod9SomeClassC'
130+
symbol[/symbolic /] ||
131131
# Swift symbol references to Objective-C symbols should not be mangled
132132
# e.g. '00000000000108ca S _associated conformance So26SCNetworkReachabilityFlagsVs10SetAlgebraSCSQ'
133133
symbol[/associated conformance/] ||
134134
# _globalinit symbols should be skipped
135135
# e.g. 0000000000000000 T _globalinit_33_A313450CFC1FC3D0CBEF4411412DB9E8_func0
136-
symbol[/ _globalinit/] ||
136+
symbol[/ globalinit/] ||
137137
# Swift classes inheriting from Objective-C classes should not be mangled
138138
# e.g. '0000000000000290 S _OBJC_CLASS_$__TtC9ManglePod19SomeFoundationClass'
139-
symbol[/_OBJC_CLASS_\$__/]
139+
symbol[/_OBJC_CLASS_\$__/] ||
140+
# Swift symbols starting with ____ should be ignored
141+
# e.g. ' ____ 6Lottie15AnimatedControlCC'
142+
symbol[/____ /] ||
143+
# _PROTOCOL symbols should be skipped
144+
# e.g. 0000000000000000 _PROTOCOL_METHOD_TYPES_CAAction
145+
symbol[/_PROTOCOL/]
140146
end
141147

142148
def self.run_nm(binaries, flags)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module CocoapodsMangle
22
NAME = 'cocoapods-mangle'
3-
VERSION = '1.1.0'
3+
VERSION = '1.1.1'
44
end

spec/integration/integration_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def build_sample
5252
plugin 'cocoapods-mangle'
5353
target 'Mangle Integration' do
5454
pod 'ManglePod', path: '../pod'
55-
pod 'Alamofire', '5.2.2'
55+
pod 'lottie-ios'
5656
end
5757
PODFILE
5858
end
5959
let(:expected_defines) do
6060
%w[
6161
PodsDummy_ManglePod=Mangle_Integration_PodsDummy_ManglePod
62-
PodsDummy_Alamofire=Mangle_Integration_PodsDummy_Alamofire
62+
PodsDummy_lottie_ios=Mangle_Integration_PodsDummy_lottie_ios
6363
]
6464
end
6565

0 commit comments

Comments
 (0)