Skip to content

Fix ad-hoc signed build dying during APK extraction - #1867

Merged
utkarshdalal merged 1 commit into
masterfrom
gamenative-ci-failure-b40647
Aug 30, 2026
Merged

Fix ad-hoc signed build dying during APK extraction#1867
utkarshdalal merged 1 commit into
masterfrom
gamenative-ci-failure-b40647

Conversation

@utkarshdalal

@utkarshdalal utkarshdalal commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Every ad-hoc build since late July has failed with "The runner has received a shutdown signal" a few seconds into the first bundletool build-apks call - the hosted runner VM is running out of disk/memory right when bundletool starts, since the three release bundles plus gradle intermediates and resident daemons are all still around at that point.

Changes:

  • Delete unused preinstalled toolchains (dotnet, ghc, CodeQL, boost, swift) at job start to free disk
  • Stage bundles with mv instead of cp so we don't hold two copies of each ~600MB aab
  • Stop gradle daemons before extraction to free RAM
  • Bound bundletool's heap at 3g and delete each .apks/.aab as soon as its universal apk is extracted
  • df/free diagnostics around the extract step so the next failure (if any) shows which resource ran out

Summary by cubic

Fixes ad-hoc signed builds dying with "The runner has received a shutdown signal" during the first bundletool call by freeing up disk and memory on the hosted runner before and during extraction.

Bug Fixes

  • Removes unused preinstalled toolchains (dotnet, ghc, CodeQL, boost, swift) and stops Gradle daemons before extraction.
  • Stages bundles with mv instead of cp so only one copy of each ~600MB AAB exists.
  • Caps bundletool's heap at 3g and deletes each .apks/.aab once its universal APK is extracted.
  • Adds df/free diagnostics around extraction so the next failure shows which resource ran out.

Written for commit 067ba7a. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores

    • Improved release build reliability by managing disk space and cleanup more efficiently.
    • Optimized packaging steps to reduce unnecessary file duplication and remove temporary artifacts.
    • Increased available memory for bundle processing to support smoother builds.
    • Added resource usage reporting to help monitor build performance.
  • Refactor

    • Streamlined the release workflow without changing the application’s user-facing functionality.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6dfea7f1-7a72-4d0b-8e69-c24db2ad121c

📥 Commits

Reviewing files that changed from the base of the PR and between c76d3dd and 067ba7a.

📒 Files selected for processing (1)
  • .github/workflows/adhoc-signed-build.yml

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The signed build workflow now frees disk space, relocates bundles without duplication, stops Gradle daemons, configures bundletool memory, removes intermediate artifacts, and reports disk and memory usage.

Changes

Signed build workflow

Layer / File(s) Summary
Workspace and artifact management
.github/workflows/adhoc-signed-build.yml
The workflow removes cached toolchains, moves release bundles, stops Gradle daemons, reports resource usage, runs bundletool with a 3 GB heap, and deletes intermediate .apks and .aab files.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 067ba

The workflow frees runner resources and removes temporary build files while preserving the existing signed APK outputs and uploads. No actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the failure, cause, and implemented changes. However, it does not provide the required recording, does not select a Type of Change, and does not complete the required … Add a short recording or GIF, select the applicable Type of Change (at least Bug fix and/or Performance / stability improvement), and complete each checklist item with the required approvals or context. Include confirmation that the contrib…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: fixing ad-hoc signed builds that fail during APK extraction.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description clearly explains the failure, cause, and implemented changes. However, it does not provide the required recording, does not select a Type of Change, and does not complete the required checklist items.

Resolution

Add a short recording or GIF, select the applicable Type of Change (at least Bug fix and/or Performance / stability improvement), and complete each checklist item with the required approvals or context. Include confirmation that the contribution guidelines were reviewed.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gamenative-ci-failure-b40647

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/adhoc-signed-build.yml">

<violation number="1" location=".github/workflows/adhoc-signed-build.yml:113">
P3: The three bundletool build-apks + unzip + rm blocks in the Extract APKs step are near-identical except for the bundle/output file names (and unzip -o vs -p). Since this exact pattern has now been changed once (heap, mv, per-bundle cleanup) and is duplicated across two other workflows (app-release-signed.yml, tagged-release.yml), collapse it into a loop over the bundle pairs so future heap/cleanup changes are made in one place rather than three.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -15,6 +15,11 @@ jobs:
if: github.actor == 'utkarshdalal'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The three bundletool build-apks + unzip + rm blocks in the Extract APKs step are near-identical except for the bundle/output file names (and unzip -o vs -p). Since this exact pattern has now been changed once (heap, mv, per-bundle cleanup) and is duplicated across two other workflows (app-release-signed.yml, tagged-release.yml), collapse it into a loop over the bundle pairs so future heap/cleanup changes are made in one place rather than three.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/adhoc-signed-build.yml, line 113:

<comment>The three bundletool build-apks + unzip + rm blocks in the Extract APKs step are near-identical except for the bundle/output file names (and unzip -o vs -p). Since this exact pattern has now been changed once (heap, mv, per-bundle cleanup) and is duplicated across two other workflows (app-release-signed.yml, tagged-release.yml), collapse it into a loop over the bundle pairs so future heap/cleanup changes are made in one place rather than three.</comment>

<file context>
@@ -91,18 +96,28 @@ jobs:
+        java -Xmx3g -jar tools/bundletool-all-1.17.2.jar build-apks --bundle=app-release.aab --output=app-release.apks --mode=universal
         unzip -o app-release.apks universal.apk
-        java -jar tools/bundletool-all-1.17.2.jar build-apks --bundle=app-modern-release.aab --output=app-modern-release.apks --mode=universal
+        rm app-release.apks app-release.aab
+        java -Xmx3g -jar tools/bundletool-all-1.17.2.jar build-apks --bundle=app-modern-release.aab --output=app-modern-release.apks --mode=universal
         unzip -p app-modern-release.apks universal.apk > universal-modern.apk
</file context>

@utkarshdalal
utkarshdalal merged commit a38c0bc into master Aug 30, 2026
3 checks passed
@utkarshdalal
utkarshdalal deleted the gamenative-ci-failure-b40647 branch August 30, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant