Skip to content

fix(scripts): stage Robolectric's download inside the cache so a killed build cannot leave a truncated jar - #103

Merged
GeiserX merged 1 commit into
mainfrom
fix/remote-gradle-atomic-jar
Nov 7, 2026
Merged

GeiserX merged 1 commit into
mainfrom
fix/remote-gradle-atomic-jar

Conversation

@GeiserX

@GeiserX GeiserX commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Follow-up to #102, which merged before this landed.

Robolectric downloads its android-all jar into java.io.tmpdir, checks the SHA-512, then moves it into /root/.m2. Inside the build container, /tmp is a different filesystem from the mounted cache, so that move is a copy. A container stopped mid-copy leaves a truncated jar in the cache, and every later run trusts it because the file exists.

scripts/remote-gradle.sh now sets JAVA_TOOL_OPTIONS=-Djava.io.tmpdir=/root/.m2/tmp and creates that folder. The staging dir then sits on the same filesystem as the cache, so the move is a rename: the jar is either complete or absent.

Checked on a build host with an empty cache, serving the jar from a local mirror (robolectric.dependency.repo.url, used for the check only, because Maven Central was answering 429). Both runs downloaded the jar and ended with all 151,142,227 bytes and a matching SHA-512, and IconGoldenTest passed (5 tests). Without the change, the staging dir was on a different device from the cache (58720430 vs 57), so the move was a copy. With it, both were on device 57, so the move was a rename.

Only the developer script changes. CI, the app and the F-Droid build don't use it.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e25b2df and f75e13e.

Files selected for processing: 1

  • scripts/remote-gradle.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@GeiserX
GeiserX merged commit 8ab5bff into main Nov 7, 2026
5 checks passed
@GeiserX
GeiserX deleted the fix/remote-gradle-atomic-jar branch November 7, 2026 15:37
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