Skip to content

fix(android): prevent gomobile builds from mutating core modules#12

Merged
Hidden-Node merged 3 commits into
Hidden-Node:mainfrom
AmirrezaFarnamTaheri:codex/android-gomobile-merge-safety
May 14, 2026
Merged

fix(android): prevent gomobile builds from mutating core modules#12
Hidden-Node merged 3 commits into
Hidden-Node:mainfrom
AmirrezaFarnamTaheri:codex/android-gomobile-merge-safety

Conversation

@AmirrezaFarnamTaheri
Copy link
Copy Markdown
Contributor

  • Removed risky go get usage from android/build_go_mobile.sh.
  • Added GOFLAGS=-mod=readonly to both shell and Windows scripts.
  • Aligned both scripts to one pinned version in android/gomobile.version.
  • Added guards that fail if go.mod or go.sum are dirty/modified.
  • Added android/BUILDING.md documenting the Android-only safe build rule.

@AmirrezaFarnamTaheri AmirrezaFarnamTaheri force-pushed the codex/android-gomobile-merge-safety branch from d3d1351 to 7566182 Compare May 11, 2026 16:57
Download module dependencies inside the temporary gomobile source tree after adding the pinned x/mobile module. This keeps the real shared Go modules untouched while giving CI a complete module cache before gomobile bind runs.
Return to the real repository before removing the temporary gomobile source tree. CI was building the AAR successfully, then the EXIT trap ran git diff from the deleted temp directory and failed with 'Unable to read current working directory'.
@Hidden-Node
Copy link
Copy Markdown
Owner

Excellent work on the build isolation! Using git archive to keep our source tree and go.mod clean is an elegant solution. This significantly improves our development workflow and ensures reproducible builds across the team. Thanks for this solid improvement

@Hidden-Node Hidden-Node merged commit 684e928 into Hidden-Node:main May 14, 2026
2 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.

3 participants