Skip to content

fix: clean gradle caches under $HOME, not hardcoded /root - #79

Merged
compscidr merged 1 commit into
mainfrom
fix/cleanup-nonroot-gradle
Aug 20, 2026
Merged

fix: clean gradle caches under $HOME, not hardcoded /root#79
compscidr merged 1 commit into
mainfrom
fix/cleanup-nonroot-gradle

Conversation

@compscidr

Copy link
Copy Markdown
Owner

The rustd.xyz runners are switching to RUN_AS_ROOT=false (compscidr/iac#529): 12 of its tests assert permission-denied behavior that root bypasses. In non-root mode the job-completed cleanup hook runs as the runner user, whose gradle home is /home/runner/.gradle, so the hardcoded /root/.gradle cleanups silently no-op and caches grow unbounded. $HOME covers both modes.

🤖 Generated with Claude Code

With RUN_AS_ROOT=false the runner (and this job-completed hook) runs as
the runner user, whose gradle home is /home/runner/.gradle — the /root
paths silently stopped matching and caches grew unbounded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 19, 2026 23:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the post-job cleanup hook to correctly remove Gradle caches regardless of whether the runner is executed as root or as the non-root runner user, preventing cache growth when RUN_AS_ROOT=false.

Changes:

  • Replace hardcoded /root/.gradle/... cache cleanup paths with $HOME/.gradle/... so cleanup works for both execution modes.
  • Apply the same $HOME-based path update to Gradle daemon state/log cleanup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@compscidr
compscidr merged commit 892b796 into main Aug 20, 2026
10 checks passed
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.

2 participants