From a6d1918f3efee0fdbf5e5768eaa708dcfdd619ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:47:44 +0000 Subject: [PATCH 1/4] Initial plan From c81ba46fffd59d38ffe5f35c14a01499a6c31299 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:50:10 +0000 Subject: [PATCH 2/4] Harden Android NDK setup apt install step --- .github/actions/setup-android-ndk/action.yml | 28 +++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-android-ndk/action.yml b/.github/actions/setup-android-ndk/action.yml index 4eefc3642cd92..000bf11a9eea8 100644 --- a/.github/actions/setup-android-ndk/action.yml +++ b/.github/actions/setup-android-ndk/action.yml @@ -16,7 +16,33 @@ runs: steps: - name: Install coreutils and ninja shell: bash - run: sudo apt-get update -y && sudo apt-get install -y coreutils ninja-build + run: | + set -euo pipefail + + if command -v ninja >/dev/null 2>&1 && command -v realpath >/dev/null 2>&1; then + echo "ninja and coreutils are already available." + exit 0 + fi + + retry_apt_install() { + local retries=3 + for attempt in $(seq 1 "${retries}"); do + if sudo apt-get update -y && sudo apt-get install -y --no-install-recommends coreutils ninja-build; then + return 0 + fi + + echo "apt-get attempt ${attempt}/${retries} failed. Retrying..." + sleep $((attempt * 10)) + done + + return 1 + } + + if ! retry_apt_install; then + echo "Falling back to archive.ubuntu.com mirror and retrying apt install." + sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list + retry_apt_install + fi - name: Install Android NDK shell: bash From d63467d09fdb62bf9f93211af88ffb0d76ebcd41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:50:55 +0000 Subject: [PATCH 3/4] Refine Android apt fallback retry behavior --- .github/actions/setup-android-ndk/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-android-ndk/action.yml b/.github/actions/setup-android-ndk/action.yml index 000bf11a9eea8..d7998437ad9c3 100644 --- a/.github/actions/setup-android-ndk/action.yml +++ b/.github/actions/setup-android-ndk/action.yml @@ -32,7 +32,9 @@ runs: fi echo "apt-get attempt ${attempt}/${retries} failed. Retrying..." - sleep $((attempt * 10)) + if [[ "${attempt}" -lt "${retries}" ]]; then + sleep $((attempt * 5)) + fi done return 1 @@ -40,7 +42,7 @@ runs: if ! retry_apt_install; then echo "Falling back to archive.ubuntu.com mirror and retrying apt install." - sudo sed -i 's|http://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list + sudo sed -i 's|https\\?://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list retry_apt_install fi From c74193dbdb5516f5d8699f356fdab2f1fa0e17b6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Jun 2026 20:51:29 +0000 Subject: [PATCH 4/4] Fix sed regex for Android apt mirror fallback --- .github/actions/setup-android-ndk/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-android-ndk/action.yml b/.github/actions/setup-android-ndk/action.yml index d7998437ad9c3..ccbd7aeb9e6f2 100644 --- a/.github/actions/setup-android-ndk/action.yml +++ b/.github/actions/setup-android-ndk/action.yml @@ -42,7 +42,7 @@ runs: if ! retry_apt_install; then echo "Falling back to archive.ubuntu.com mirror and retrying apt install." - sudo sed -i 's|https\\?://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list + sudo sed -i 's|https\?://azure.archive.ubuntu.com/ubuntu|http://archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list retry_apt_install fi