Skip to content

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

Open
AmirrezaFarnamTaheri wants to merge 3 commits into
Hidden-Node:mainfrom
AmirrezaFarnamTaheri:codex/android-gomobile-merge-safety
Open

fix(android): prevent gomobile builds from mutating core modules#12
AmirrezaFarnamTaheri wants to merge 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'.
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