Skip to content

feat(xgodriver): implement SPX project-driver source mode - #1753

Draft
joeykchen wants to merge 1 commit into
goplus:devfrom
joeykchen:feat/xgo-project-driver-spx
Draft

feat(xgodriver): implement SPX project-driver source mode#1753
joeykchen wants to merge 1 commit into
goplus:devfrom
joeykchen:feat/xgo-project-driver-spx

Conversation

@joeykchen

Copy link
Copy Markdown
Contributor

Summary

Supersedes goplus/spx#1742, which GitHub closed when its fork head branch was renamed.

This PR implements the SPX side of XGo Project Driver v1 described in #1741. It intentionally completes source mode only; published SPX module/bridge mode remains fail-closed until immutable bridge manifests and the coordinated release pipeline are available.

Project Driver integration

  • Declare driver v1 github.com/goplus/spx/v3/cmd/xgodriver in gox.mod.
  • Add the SPX driver under cmd/xgodriver and internal/xgodriver, using driverprotocol, DriverPackage, DriverOrigin, and the xgo-driver-v1 preamble.
  • Support xgo run, xgo build, and xgo install when SPX is the main module, a workspace module, or an unversioned local replacement.
  • Resolve project metadata, driver identity, and bridge source from one effective Go graph with declaration and module-provenance validation.
  • Let the driver own driver-specific Go generation in a private work directory; v1 defines no XGo pre-generated artifact handoff.
  • Reject published/versioned SPX bridge mode explicitly until immutable bridge manifests exist.

Engine runtime and packaging

Project Driver is separate from the true Engine runtime layer:

  • Acquire Engine/PCK from a verified local runtime manifest or a code-pinned published release manifest for Engine Runtime 2.4.3 / ABI 2.
  • Keep independent read-only project and asset roots plus a disposable session root for xgo run.
  • Build a fresh interpreter bridge from the SPX source selected by the effective graph.
  • Build an allowlisted, self-contained launcher containing Engine, PCK, bridge, manifests, and project payload.
  • Reuse the transactional build path for xgo install.
  • Validate file type, size, SHA-256, archive paths, collisions, identity stability, and cached components; repair damaged cache entries under a lease.
  • Preserve Engine exit status and supervise cancellation, signals, and child-process cleanup.
  • Allow a built launcher to run offline without the Go/XGo/SPX toolchain.

The bilingual design document is now:

  • docs/en/dev/engine/xgo-project-driver-proposal-issue.md
  • docs/zh/dev/engine/xgo-project-driver-proposal-issue.md

Verification

A local go.work containing the Mod, XGo, and SPX checkouts was used for coordinated verification.

go test -race ./internal/xgodriver ./cmd/xgodriver ./internal/runtimepayload ./x/xgolauncher
go test ./...
go vet ./...
GOWORK=off GODOT_SRC=/path/to/godot make buildctl

The local XGo binary also passed real tutorial/05-Animation smoke tests for:

  • xgo run . -- -headless
  • xgo build -o <output> ., followed by launching the executable
  • GOBIN=<bin> xgo install ., followed by launching the installed executable

Process-chain inspection confirmed XGo -> xgo-driver-v1 -> SPX driver -> gdspxrt2.4.3, with no child processes left after cancellation.

Dependencies and release order

  • Depends on goplus/mod#165 for driver metadata, driverprotocol, and resolved provenance.
  • Depends on goplus/xgo#2849 for driver discovery, validation, process supervision, and transactional run/build/install dispatch.
  • Before merge/release, SPX must consume released companion module versions.
  • Published bridge mode remains follow-up work.

Part of #1741. This PR must not close the proposal while published mode and coordinated release remain pending.

@joeykchen
joeykchen force-pushed the feat/xgo-project-driver-spx branch from 81ded25 to 9d66020 Compare August 21, 2026 13:04
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