Skip to content

Commit a5eb22f

Browse files
authored
Merge pull request #650 from sunimp/sun-fix-xcode-26_4-afnetworking
Fix Xcode 26.4 benchmark build
2 parents a7d4046 + 869bf27 commit a5eb22f

4 files changed

Lines changed: 40 additions & 10 deletions

File tree

Podfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,27 @@ post_install do |pi|
8989
end
9090
end
9191
end
92+
93+
afnetworking_reachability = pi.sandbox.root + 'AFNetworking/AFNetworking/AFNetworkReachabilityManager.m'
94+
if File.exist?(afnetworking_reachability)
95+
file_content = File.read(afnetworking_reachability)
96+
patched_content = file_content
97+
.gsub('#import <netinet/in.h>' + "\n", "#import <sys/socket.h>\n#import <netinet/in.h>\n")
98+
.gsub("#import <netinet6/in6.h>\n", '')
99+
.gsub('struct sockaddr_in6 address;', 'struct sockaddr_storage address;')
100+
.gsub('address.sin6_len = sizeof(address);', 'address.ss_len = sizeof(address);')
101+
.gsub('address.sin6_family = AF_INET6;', 'address.ss_family = AF_INET6;')
102+
if patched_content != file_content
103+
File.write(afnetworking_reachability, patched_content)
104+
end
105+
end
106+
107+
afnetworking_http = pi.sandbox.root + 'AFNetworking/AFNetworking/AFHTTPSessionManager.m'
108+
if File.exist?(afnetworking_http)
109+
file_content = File.read(afnetworking_http)
110+
patched_content = file_content.gsub("#import <netinet6/in6.h>\n", '')
111+
if patched_content != file_content
112+
File.write(afnetworking_http, patched_content)
113+
end
114+
end
92115
end

Pods/AFNetworking/AFNetworking/AFHTTPSessionManager.m

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pods/AFNetworking/AFNetworking/AFNetworkReachabilityManager.m

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmark.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,25 @@ echo "Preparing environment"
77

88
START_TIME=$(date +"%T")
99

10-
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
10+
if ! defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES >/dev/null 2>&1; then
11+
echo "Warning: failed to enable Xcode build duration output"
12+
fi
1113

12-
if [ -n "$PATH_TO_PROJECT" ]; then
14+
if [ -d "$PATH_TO_PROJECT" ]; then
1315

1416
echo "Running XcodeBenchmark..."
1517
echo "Please do not use your Mac while XcodeBenchmark is in progress\n\n"
1618

17-
xcodebuild -workspace "$PATH_TO_PROJECT" \
19+
if ! xcodebuild -workspace "$PATH_TO_PROJECT" \
1820
-scheme XcodeBenchmark \
1921
-destination generic/platform=iOS \
2022
-derivedDataPath "$PATH_TO_DERIVED" \
21-
build
23+
build; then
24+
echo ""
25+
echo "❌ XcodeBenchmark build failed"
26+
rm -rf "$PATH_TO_DERIVED"
27+
exit 1
28+
fi
2229

2330
echo "System Version:" "$(sw_vers -productVersion)"
2431
xcodebuild -version | grep "Xcode"
@@ -54,9 +61,10 @@ if [ -n "$PATH_TO_PROJECT" ]; then
5461
echo ""
5562
echo "2️⃣ Share your results at https://github.com/devMEremenko/XcodeBenchmark"
5663

57-
rm -rfd "$PATH_TO_DERIVED"
64+
rm -rf "$PATH_TO_DERIVED"
5865

5966
else
6067
echo "XcodeBenchmark.xcworkspace was not found in the current folder"
6168
echo "Are you running in the XcodeBenchmark folder?"
69+
exit 1
6270
fi

0 commit comments

Comments
 (0)