Skip to content

Commit dd781da

Browse files
committed
Revert "potentially prints error in ci, idk"
This reverts commit eef4b4c.
1 parent eef4b4c commit dd781da

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

scripts/build.sh

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,36 +115,29 @@ function RunXcodebuild() {
115115

116116
local xcbeautify_cmd=(xcbeautify --renderer github-actions --disable-logging)
117117

118-
# Run xcodebuild and capture the exit status of each command in the pipeline.
119-
NSUnbufferedIO=YES xcodebuild "$@" 2>&1 | tee "$log_filename" | "${xcbeautify_cmd[@]}"
120-
local pipe_statuses=("${PIPESTATUS[@]}")
121-
local result=${pipe_statuses[0]}
118+
local result=0
119+
NSUnbufferedIO=YES xcodebuild "$@" 2>&1 | tee "$log_filename" | \
120+
"${xcbeautify_cmd[@]}" && CheckUnexpectedFailures "$log_filename" \
121+
|| result=$?
122122

123-
# If the first try failed with a potentially transient error (65), retry once.
124123
if [[ $result == 65 ]]; then
125124
ExportLogs "$@"
125+
126126
echo "xcodebuild exited with 65, retrying" 1>&2
127127
sleep 5
128128

129-
NSUnbufferedIO=YES xcodebuild "$@" 2>&1 | tee "$log_filename" | "${xcbeautify_cmd[@]}"
130-
pipe_statuses=("${PIPESTATUS[@]}")
131-
result=${pipe_statuses[0]}
129+
result=0
130+
NSUnbufferedIO=YES xcodebuild "$@" 2>&1 | tee "$log_filename" | \
131+
"${xcbeautify_cmd[@]}" && CheckUnexpectedFailures "$log_filename" \
132+
|| result=$?
132133
fi
133134

134-
# If the command failed, print the relevant part of the raw log to avoid noise.
135135
if [[ $result != 0 ]]; then
136-
echo "xcodebuild exited with $result. Showing relevant part of the raw log:" 1>&2
137-
# This awk script finds the first line matching one of the error patterns
138-
# and prints from that line to the end of the file. This avoids duplicating
139-
# successful build output.
140-
awk '/error:|fatal:|terminated|\*\* (BUILD|TEST) FAILED \*\*/ {f=1} f' "$log_filename" 1>&2
136+
echo "xcodebuild exited with $result" 1>&2
137+
141138
ExportLogs "$@"
142139
return $result
143140
fi
144-
145-
# If the command succeeded, check for unexpected test failures which don't
146-
# always cause xcodebuild to return a non-zero exit code.
147-
CheckUnexpectedFailures "$log_filename" || return $?
148141
}
149142

150143
# Exports any logs output captured in the xcresult

0 commit comments

Comments
 (0)