From fd7ce48964f781041036a15624a83dafe6fd2d1b Mon Sep 17 00:00:00 2001 From: mstrofnone Date: Wed, 29 Apr 2026 20:21:18 +1000 Subject: [PATCH] ci(desktop): retry vlcDownload on transient network failures Every desktop packaging job (Windows MSI, macOS DMG, Linux DEB) currently breaks on the smallest blip when fetching VLC from get.videolan.org. The `ir.mahozad.vlc-setup` plugin registers `vlcDownload` / `upxDownload` tasks that extend `de.undercouch.gradle.tasks.download.Download`, but it does not configure retries or a generous read timeout, so a single `SocketTimeoutException` aborts the build. Recent main runs all failed at the same step: > Task :desktopApp:vlcDownload FAILED > A failure occurred while executing ...DefaultWorkAction > java.net.SocketTimeoutException: Read timed out Configure all `Download` tasks in this project with: - 5 attempts total (initial + 4 retries), - 30 s connect timeout, - 5 min read timeout (VLC archives are 40-90 MB and the mirror can be slow under load), - `tempAndMove` so a partial download from one attempt cannot poison the next. This is a CI-only change \u2014 it does not alter what gets bundled, just makes the fetch resilient. --- desktopApp/build.gradle.kts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts index 179af93cf..9afb1a8b5 100644 --- a/desktopApp/build.gradle.kts +++ b/desktopApp/build.gradle.kts @@ -1,3 +1,4 @@ +import de.undercouch.gradle.tasks.download.Download import org.jetbrains.compose.desktop.application.dsl.TargetFormat import java.nio.file.Files @@ -144,6 +145,25 @@ tasks.named("spotlessKotlin") { mustRunAfter("vlcSetup") } +// `ir.mahozad.vlc-setup` registers `vlcDownload` / `upxDownload` tasks that +// extend `de.undercouch.gradle.tasks.download.Download`. Defaults are 0 retries +// and a short read timeout, so a transient blip on get.videolan.org fails the +// whole desktop build on CI (Windows MSI, macOS DMG, Linux DEB). Configure all +// Download tasks in this project to retry with generous timeouts so flaky +// network conditions do not break packaging jobs. +tasks.withType().configureEach { + // 5 attempts total (initial + 4 retries) before failing the task. + retries(4) + // 30s to establish a TCP / TLS connection. + connectTimeout(30_000) + // 5 minutes per attempt for the body — VLC archives are 40-90 MB and + // get.videolan.org can be slow under load. + readTimeout(5 * 60_000) + // Stage to a temp file and rename only on full success, so a partial + // download from one attempt cannot poison the next. + tempAndMove(true) +} + // --- AppImage packaging (Linux) --- // // Compose Multiplatform's TargetFormat.AppImage is known-broken in 1.10.x (CMP-7101).