Skip to content

fix: remove project build dirs from Android Gradle cache - #376

Merged
AnthonyRonning merged 1 commit into
masterfrom
fix/android-cache-disk-space
Jan 9, 2026
Merged

fix: remove project build dirs from Android Gradle cache#376
AnthonyRonning merged 1 commit into
masterfrom
fix/android-cache-disk-space

Conversation

@AnthonyRonning

@AnthonyRonningAnthonyRonning commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Problem

The Android build CI was failing with:

zstd: error 70 : Write error : cannot write block : No space left on device

Cause

The Gradle cache was including project-level build outputs:

  • frontend/src-tauri/gen/android/.gradle
  • frontend/src-tauri/gen/android/build
  • frontend/src-tauri/gen/android/app/build

These directories contain APKs, AABs, and native .so files for 4 Android architectures, which are very large and caused the runner to run out of disk space during cache save.

Fix

Keep only the global Gradle caches:

  • ~/.gradle/caches - Downloaded dependencies (the valuable part)
  • ~/.gradle/wrapper - Gradle wrapper

The Rust compilation is already cached via sccache, so the native library build time is preserved.

Files Changed

  • .github/workflows/android-build.yml
  • .github/workflows/release.yml

Summary by CodeRabbit

  • Chores
    • Optimized Android build caching configuration by excluding generated build directories, reducing cache footprint in CI/CD workflows.

✏️ Tip: You can customize this high-level summary in your review settings.

The cache was including build outputs (APKs, .so files for 4 architectures)
which caused 'No space left on device' errors during post-job cache save.
Keep only ~/.gradle/caches and ~/.gradle/wrapper which contain the
downloaded dependencies. sccache already handles Rust compilation caching.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@coderabbitai

coderabbitaiBot commented Jan 9, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Removed three Gradle cache directory paths from the Android build caching configuration in both android-build.yml and release.yml workflows. The cache key logic remains unchanged, but excludes the .gradle, build, and app/build directories from being cached.

Changes

Cohort / File(s)Summary
Gradle cache configuration
.github/workflows/android-build.yml, .github/workflows/release.yml
Removed three Gradle cache paths: frontend/src-tauri/gen/android/.gradle, frontend/src-tauri/gen/android/build, and frontend/src-tauri/gen/android/app/build. Cache key matching logic preserved.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • Maple#257: Adds an Android build job that uses Gradle cache; complements the cache path narrowing in this PR by establishing the foundation for the modified caching strategy.

Poem

🐰 Hopping through workflows with cache so neat,
Three paths trimmed away, the cleanup's complete!
Less junk to remember, more swiftly we go,
Android builds dancing, much lighter and fleet! 🚀

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately and concisely summarizes the main change: removing project build directories from Android Gradle cache to fix disk space issues.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52f2b2b and bb80c50.

📒 Files selected for processing (2)
  • .github/workflows/android-build.yml
  • .github/workflows/release.yml
💤 Files with no reviewable changes (2)
  • .github/workflows/android-build.yml
  • .github/workflows/release.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: build-android
  • GitHub Check: build-macos (universal-apple-darwin)
  • GitHub Check: build-linux
  • GitHub Check: build-ios
  • GitHub Check: Cloudflare Pages

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying maple with Cloudflare Pages Cloudflare Pages

Latest commit:bb80c50
Status: ✅ Deploy successful!
Preview URL:https://83c09e03.maple-ca8.pages.dev
Branch Preview URL:https://fix-android-cache-disk-space.maple-ca8.pages.dev

View logs

@greptile-appsgreptile-appsBot 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.

Greptile Overview

Greptile Summary

This PR fixes a disk space issue in Android CI builds by removing project-level build directories from the Gradle cache configuration in both android-build.yml and release.yml workflows.

Problem: The CI was failing with "No space left on device" during cache save operations because the Gradle cache included large build artifacts (APKs, AABs, and native .so files for 4 Android architectures).

Solution: The change removes three project-specific paths from the cache configuration:

  • frontend/src-tauri/gen/android/.gradle (project Gradle cache)
  • frontend/src-tauri/gen/android/build (project build outputs)
  • frontend/src-tauri/gen/android/app/build (app build outputs)

While keeping the valuable global Gradle caches:

  • ~/.gradle/caches (downloaded dependencies)
  • ~/.gradle/wrapper (Gradle wrapper distribution)

Impact: This change reduces cache size significantly without impacting build performance, since Rust compilation (the most time-consuming part) is already cached separately via sccache. The build artifacts don't need to be cached as they're the final outputs uploaded as artifacts.

Confidence Score: 5/5

  • Safe to merge - fixes critical disk space issue without introducing any bugs or breaking changes
  • The change is straightforward and low-risk: it removes unnecessary paths from cache configuration. The removed directories contain build outputs (APKs, AABs, compiled libraries) that should not be cached. The valuable dependency caches are retained. Build functionality remains intact since sccache handles Rust compilation separately.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
.github/workflows/android-build.yml5/5Removed project build directories from Gradle cache to prevent disk space issues while keeping dependency caches
.github/workflows/release.yml5/5Removed project build directories from Gradle cache to prevent disk space issues while keeping dependency caches

Sequence Diagram

sequenceDiagram
participant GHA as GitHub Actions Runner
participant Cache as Actions Cache
participant Gradle as Gradle Build
participant Rust as Rust/sccache
Note over GHA,Cache: Before (Disk Space Issue)
GHA->>Cache: Restore Gradle cache
Cache-->>GHA: ~/.gradle/caches, ~/.gradle/wrapper<br/>+ project build outputs
GHA->>Gradle: Build Android app
Gradle->>Rust: Compile native libraries (4 architectures)
Rust-->>Gradle: .so files (~large)
Gradle-->>GHA: APKs, AABs, build artifacts
GHA->>Cache: Save cache (includes APKs, AABs, .so files)
Cache-->>GHA: ERROR: No space left on device
Note over GHA,Cache: After (Fixed)
GHA->>Cache: Restore Gradle cache
Cache-->>GHA: ~/.gradle/caches, ~/.gradle/wrapper only
GHA->>Rust: Compile native libraries
Note over Rust: sccache handles Rust cache separately
Rust-->>GHA: Cached compilation
GHA->>Gradle: Build Android app
Gradle-->>GHA: APKs, AABs (not cached)
GHA->>Cache: Save cache (dependencies only)
Cache-->>GHA: Success
Loading

@AnthonyRonning
AnthonyRonning merged commit 925c1b5 into masterJan 9, 2026
7 checks passed
@AnthonyRonning
AnthonyRonning deleted the fix/android-cache-disk-space branch January 9, 2026 05:46
Sign up for freeto 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

@AnthonyRonning