fix(android): prevent gomobile builds from mutating core modules#12
Open
AmirrezaFarnamTaheri wants to merge 3 commits into
Open
Conversation
Contributor
AmirrezaFarnamTaheri
commented
May 11, 2026
- 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.
d3d1351 to
7566182
Compare
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'.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.