Skip to content

Commit

Permalink
CI: Remove retry cabal build logic
Browse files Browse the repository at this point in the history
The logic for retrying the `cabal build` command three consecutive times in a
row upon failure was apparently added to work around macOS-related dylib
issues, but it is unclear (and unlikely) if these issues still exist. Moreover,
this logic has the distinct disadvantage of potentially masking more serious
issues, such as the issues observed in #1961.

In principle, `cabal build` should not be an especially flaky part of the CI—it
should either work 100% of the time or fail 100% of the time. Let's just remove
the `retry cabal build` logic to make it easier to notice issues with `cabal
build` in the future. We can always revisit this choice later if need be.
  • Loading branch information
RyanGlScott committed Oct 16, 2023
1 parent edd15b1 commit 2edc65f
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,6 @@ extract_exe() {
$IS_WIN || chmod +x "$2/$name"
}

retry() {
echo "Attempting with retry:" "$@"
local n=1
while true; do
if "$@"; then
break
else
if [[ $n -lt 3 ]]; then
sleep $n # don't retry immediately
((n++))
echo "Command failed. Attempt $n/3:"
else
echo "The command has failed after $n attempts."
return 1
fi
fi
done
}

setup_dist_bins() {
if $IS_WIN; then
is_exe "dist/bin" "saw" && return
Expand Down Expand Up @@ -66,15 +47,7 @@ build() {
if [[ "$ENABLE_HPC" == "true" ]]; then
cat cabal.project.ci-hpc >> cabal.project.local
fi
if ! retry cabal v2-build "$@" "${pkgs[@]}"; then
if [[ "$RUNNER_OS" == "macOS" ]]; then
echo "Working around a dylib issue on macos by removing the cache and trying again"
cabal v2-clean
retry cabal v2-build "$@" "${pkgs[@]}"
else
return 1
fi
fi
cabal v2-build "$@" "${pkgs[@]}"
}

# Gather and tar up all HPC coverage files and binaries
Expand Down

0 comments on commit 2edc65f

Please sign in to comment.