Skip to content

Document single Go runtime limitation - #144

Merged
yiguodev merged 2 commits into
mainfrom
dev-26.8-2
Aug 14, 2026
Merged

Document single Go runtime limitation#144
yiguodev merged 2 commits into
mainfrom
dev-26.8-2

Conversation

@yiguodev

@yiguodev yiguodev commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • document the one-Go-runtime-per-process requirement in the shared build section for all native platforms
  • explain that cgo and gomobile artifacts for Android, Apple, Linux, and Windows embed a Go runtime
  • clarify that required Go packages must be built together rather than merely repackaging prebuilt frameworks, archives, AARs, shared libraries, or DLLs
  • keep the English and Chinese READMEs synchronized and correct the previous Apple-specific conflict guidance

Why

Issue #116 exposed the restriction through an early iOS Network Extension crash, but the underlying Go runtime constraint is process-wide and platform-independent. Go does not support multiple independently built runtimes in one process, and failures may occur during build, link, load, or runtime initialization before application code runs.

The documentation now applies the rule to every native libXray artifact while making clear that separate OS processes may each load one Go runtime.

Validation

  • git diff --check
  • reviewed the synchronized English and Chinese warnings
  • CI: Go vet, race tests, native build, and repository tests

Refs #116

@yiguodev
yiguodev marked this pull request as ready for review August 14, 2026 12:51
Copilot AI lite review requested due to automatic review settings August 14, 2026 12:51

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

This PR updates libXray’s integration documentation for Apple targets to explicitly warn that only one Go runtime can be loaded per process, based on the crash scenario described in #116, and keeps the English and Chinese READMEs aligned.

Changes:

  • Add an explicit “one Go runtime per process” warning for iOS/macOS integrations (cgo + gomobile).
  • Clarify that independently built Go/gomobile frameworks cannot be safely merged/repackaged to avoid the limitation.
  • Update the “use gomobile” guidance to remain compatible with the new warning in both READMEs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
README.md Adds Apple integration warning and clarifies single-Go-runtime-per-process requirements.
readme/README.zh_CN.md Mirrors the same Apple warning and guidance in Chinese to keep docs synchronized.

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

Comment thread readme/README.zh_CN.md Outdated
Comment thread README.md Outdated
Copilot AI review requested due to automatic review settings August 14, 2026 12:55

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@yiguodev
yiguodev merged commit d1b4b3f into main Aug 14, 2026
4 checks passed
@yiguodev
yiguodev deleted the dev-26.8-2 branch August 14, 2026 13:06
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