[Git][wxwidgets/wxwidgets][master] Retry apt-get commands when using Ubuntu servers

2 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Aug 4, 2026, 2:45:32 PMAug 4
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • e68720e2
    by Vadim Zeitlin at 2026-08-04T20:17:37+02:00
    Retry apt-get commands when using Ubuntu servers
    
    They still fail, even when using versions later than 18.04, but the
    failure is usually temporary, so try them several times.
    

1 changed file:

Changes:

  • .github/workflows/ci.yml
    ... ... @@ -169,11 +169,30 @@ jobs:
    169 169
                       exit 1
    
    170 170
                   esac
    
    171 171
     
    
    172
    +              # Ubuntu servers sometimes fail because of transient network
    
    173
    +              # issues, so retry apt-get commands a few times before giving up.
    
    174
    +              retry_apt()
    
    175
    +              {
    
    176
    +                attempts=5
    
    177
    +                delay=30
    
    178
    +                attempt=1
    
    179
    +
    
    180
    +                while ! "$@"; do
    
    181
    +                  if [[ $attempt -ge $attempts ]]; then
    
    182
    +                    return 1
    
    183
    +                  fi
    
    184
    +
    
    185
    +                  echo "Command failed, retrying in ${delay}s (attempt $((attempt + 1))/$attempts): $*"
    
    186
    +                  attempt=$((attempt + 1))
    
    187
    +                  sleep $delay
    
    188
    +                done
    
    189
    +              }
    
    190
    +              retry_apt apt-get update -qq
    
    191
    +
    
    172 192
                   # Explanation for installing some less obvious packages:
    
    173 193
                   #   - coreutils contains nproc used in proc_count.sh called below.
    
    174 194
                   #   - xvfb is used for running the GUI tests.
    
    175
    -              apt-get update -qq
    
    176
    -              apt-get install -qq coreutils ${compiler_packages} git make pkg-config sudo xvfb
    
    195
    +              retry_apt apt-get install -qq coreutils ${compiler_packages} git make pkg-config sudo xvfb
    
    177 196
                   ;;
    
    178 197
     
    
    179 198
                 '')
    


View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help Notification message regarding https://gitlab.com/wxwidgets/wxwidgets/-/commit/e68720e2b5b51b0029a543944c5dbd44b580bd84 at 1785869118

Reply all
Reply to author
Forward
0 new messages