From 1c6014a4860b698207858da357aa65998e7aee3f Mon Sep 17 00:00:00 2001 From: Ty Smith Date: Wed, 2 Apr 2025 19:27:57 -0700 Subject: [PATCH 1/3] Adding support for multiple desktop files for vscode --- build.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index f7a7c07..2067be0 100755 --- a/build.sh +++ b/build.sh @@ -155,12 +155,17 @@ chmod +x $APP_DIRECTORY/AppRun echo "==> Setup icons and desktop for $APP_SHORT_NAME AppImage" # Add defaults which we need for proper app image. Desktop files, icons. -cp $APP_FILENAME $APP_DIRECTORY/"$APP_SHORT_NAME".desktop -sed -i '/VersionUrl/d' $APP_DIRECTORY/"$APP_SHORT_NAME".desktop -sed -i '/VersionFile/d' $APP_DIRECTORY/"$APP_SHORT_NAME".desktop -sed -i '/VersionBash/d' $APP_DIRECTORY/"$APP_SHORT_NAME".desktop -sed -i '/VersionIcon/d' $APP_DIRECTORY/"$APP_SHORT_NAME".desktop -sed -i '/VersionDirectory/d' $APP_DIRECTORY/"$APP_SHORT_NAME".desktop + +for DESKTOP_INPUT in app*.desktop; do + DESKTOP_OUTPUT="$APP_DIRECTORY/${DESKTOP_INPUT/app/$APP_SHORT_NAME}" + cp "$DESKTOP_INPUT" "$DESKTOP_OUTPUT" + sed -i '/VersionUrl/d' "$DESKTOP_OUTPUT" + sed -i '/VersionFile/d' "$DESKTOP_OUTPUT" + sed -i '/VersionBash/d' "$DESKTOP_OUTPUT" + sed -i '/VersionIcon/d' "$DESKTOP_OUTPUT" + sed -i '/VersionDirectory/d' "$DESKTOP_OUTPUT" + echo "Copied $DESKTOP_INPUT to $DESKTOP_OUTPUT" +done ICON_PATH=$(find $APP_DEPLOY -type f -name "$APP_VERSION_ICON") ICON_EXTENSION="${ICON_PATH#*.}" From bdb87a69b8bb0dd16d3f4b87486e1e25bb9d4996 Mon Sep 17 00:00:00 2001 From: Ty Smith Date: Sun, 22 Jun 2025 16:53:08 -0700 Subject: [PATCH 2/3] Fixing app image name --- build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2067be0..88726a6 100755 --- a/build.sh +++ b/build.sh @@ -189,13 +189,17 @@ echo "==> Build $APP_SHORT_NAME AppImage" wget https://github.com/AppImage/Appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x *.AppImage +# Set the AppImage name explicitly to avoid issues with multiple desktop files +export APPIMAGETOOL_APP_NAME="${APP_SHORT_NAME// /_}" +export ARCH="x86_64" + if [ "$GITHUB_RUNNING_ACTION" == true ]; then - ARCH=x86_64 ./appimagetool-x86_64.AppImage --comp zstd "$APP_DIRECTORY" -n -u "gh-releases-zsync|$GH_USER|$GH_REPO|latest|$APP_SHORT_NAME*.AppImage.zsync" + ./appimagetool-x86_64.AppImage --comp zstd "$APP_DIRECTORY" -n -u "gh-releases-zsync|$GH_USER|$GH_REPO|latest|$APP_SHORT_NAME*.AppImage.zsync" echo "APP_NAME=$APP_NAME" >> "$GITHUB_ENV" echo "APP_SHORT_NAME=$APP_SHORT_NAME" >> "$GITHUB_ENV" echo "APP_VERSION=$VERSION" >> "$GITHUB_ENV" else - ARCH=x86_64 ./appimagetool-x86_64.AppImage --comp zstd "$APP_DIRECTORY" -n + ./appimagetool-x86_64.AppImage --comp zstd "$APP_DIRECTORY" -n fi mkdir dist From bb41bf9f5b2cb1d5a7495f96e51ecf3406aea2a2 Mon Sep 17 00:00:00 2001 From: Ty Smith Date: Sat, 8 Aug 2026 11:15:57 -0700 Subject: [PATCH 3/3] Retry downloads to survive transient upstream failures (#1) * Retry downloads to survive transient upstream failures Every download runs under set -e with no retry, so one bad response from an upstream aborts the whole build. This bit the VSCode Insiders build on 2026-08-08: the version endpoint answered 302 with "Location: undefined", which resolved to a 404 and killed the run. The next scheduled run passed with no change. Wrap the three wget calls in a retry helper that re-runs the whole command. wget's own --retry-on-http-error is not sufficient here: after a redirect it only re-requests the final target, so it would have re-hit the dead /sha/undefined five times and still failed. Re-running from the original URL re-rolls the redirect, which is what actually recovers this failure. --tries bounds wget's internal retries so a hard-down host cannot stretch the five attempts into a very long build. A genuinely dead URL still fails the build after the attempts are exhausted. Co-Authored-By: Claude Opus 5 (1M context) * Propagate wget's exit status and skip the final sleep Addresses review feedback on the retry helper. The loop slept after the last attempt and logged "retrying" when it would not retry, adding 15s of dead time to every permanent failure. It also returned a bare 1, discarding wget's exit status and making failures harder to triage. Capturing the status needs the explicit else branch: an if whose condition fails with no else evaluates to 0, so reading $? after the fi returned success and let the build continue past a failed download. Verified a dead URL now propagates wget exit 4 and set -e aborts before the following command runs. Co-Authored-By: Claude Opus 5 (1M context) --------- Co-authored-by: Claude Opus 5 (1M context) --- build.sh | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 88726a6..b720708 100755 --- a/build.sh +++ b/build.sh @@ -58,6 +58,37 @@ APP_DIRECTORY="AppDir" BIN_DIRECTORY=$APP_DIRECTORY/usr/bin rm -rf AppDir +# Retry downloads on transient upstream failures. Everything here runs under +# set -e, so one bad response from an upstream aborts the whole build. +# +# This re-runs the whole wget command rather than using --retry-on-http-error. +# After a redirect, wget's own retries only re-request the final target, not +# the original URL. That cannot recover the failure this guards against: a +# version endpoint answering 302 with a broken Location, where retrying the +# dead target is pointless and only re-requesting the original URL re-rolls +# the redirect. +retry_wget() { + local attempt status=1 + for attempt in 1 2 3 4 5; do + # --tries bounds wget's own retries so a hard-down host cannot stretch the + # five attempts below into a very long build. + # The else branch is required to capture wget's exit status: an if whose + # condition fails with no else evaluates to 0, which would make this + # function report success after a failed download. + if wget --tries=3 --retry-connrefused --waitretry=10 "$@"; then + return 0 + else + status=$? + fi + if [ "$attempt" -lt 5 ]; then + echo "==> Download attempt $attempt failed (wget exit $status), retrying in 15s" + sleep 15 + fi + done + echo "==> Download failed after 5 attempts (wget exit $status)" + return "$status" +} + mkdir $BIN_DIRECTORY -p mkdir -p $APP_DIRECTORY/usr/share/icons/hicolor/{128x128,256x256,512x512}/apps/ @@ -95,7 +126,7 @@ if [ -z "$APP_NAME" ]; then fi echo "==> Download $APP_SHORT_NAME" -wget -O "$APP_SHORT_NAME".tar.gz "$APP_DOWNLOAD_URL" +retry_wget -O "$APP_SHORT_NAME".tar.gz "$APP_DOWNLOAD_URL" echo "==> Extract $APP_SHORT_NAME" tar -xzvf "$APP_SHORT_NAME".tar.gz --strip-components=1 -C $APP_DEPLOY && rm -r *.tar.gz @@ -150,7 +181,7 @@ else fi echo "==> Fetch default AppRun binary" -wget -O $APP_DIRECTORY/AppRun https://raw.githubusercontent.com/AppImage/AppImageKit/master/resources/AppRun +retry_wget -O $APP_DIRECTORY/AppRun https://raw.githubusercontent.com/AppImage/AppImageKit/master/resources/AppRun chmod +x $APP_DIRECTORY/AppRun echo "==> Setup icons and desktop for $APP_SHORT_NAME AppImage" @@ -186,7 +217,7 @@ fi echo "==> Build $APP_SHORT_NAME AppImage" # Fetch AppImageTool. -wget https://github.com/AppImage/Appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage +retry_wget https://github.com/AppImage/Appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x *.AppImage # Set the AppImage name explicitly to avoid issues with multiple desktop files