Skip to content

Commit

Permalink
Revert "restore retry on wine connection reset, again"
Browse files Browse the repository at this point in the history
This reverts commit 45c1bc8.
  • Loading branch information
burner1024 committed Dec 1, 2021
1 parent 4e4ef44 commit 19ad3fb
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions extra/buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,6 @@ if [[ ! -f $compile_exe ]]; then
exit 1
fi

# single file compile
function process_file() {
set -eu -o pipefail
f="$1"
dst="$2"
script_name="$(echo "$f" | sed 's|\.ssl$|.int|')"
gcc -E -x c -P -Werror -Wfatal-errors -o "${f}.tmp" "$f" # preprocess

# 1 retry on wine connection reset
set +e
result_text="$(wine "$compile_exe" -n -l -q -O2 "$f.tmp" -o "$dst/$script_name" 2>&1)" # compile
result_code="$?"
set -e
if [[ "$result_code" != "0" ]]; then
set -x
if echo "$result_text" | grep -q "recvmsg: Connection reset by peer"; then
sleep 1
wine "$compile_exe" -n -l -q -O2 "$f.tmp" -o "$dst/$script_name" # 1 retry
else
echo "Compilation failed:"
echo "$result_text"
exit 1
fi
set +x
fi
rm -f "$f.tmp"
}

# compile all
for d in $(ls $src); do
if [[ -d "$src/$d" && "$d" != "template" ]]; then # if it's a dir and not a template
Expand All @@ -50,7 +22,9 @@ for d in $(ls $src); do
for f in $(ls | grep -i "\.ssl$"); do # build file list
int="$(echo $f | sed 's|\.ssl$|.int|')"
if grep -qi "^$int " "$scripts_lst" || [[ "$d" == "global" ]]; then # if file is in scripts.lst or a global script
process_file "$f" "$dst"
script_name="$(echo "$f" | sed 's|\.ssl$|.int|')"
gcc -E -x c -P -Werror -Wfatal-errors -o "${f}.tmp" "$f" # preprocess
wine "$compile_exe" -n -l -q -O2 "$f.tmp" -o "$dst/$script_name" # compile
fi
done
cd ..
Expand Down

0 comments on commit 19ad3fb

Please sign in to comment.