From 2edc65f4a016ba64ccd0b9ba882c8212844ca0c4 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Mon, 16 Oct 2023 12:55:04 -0400 Subject: [PATCH] CI: Remove `retry cabal build` logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/ci.sh | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.github/ci.sh b/.github/ci.sh index 534dad07ad..2c8e53e2d4 100755 --- a/.github/ci.sh +++ b/.github/ci.sh @@ -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 @@ -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