Skip to content

feat(runtimeprovider): dispatch class projects through verified providers - #2847

Closed
joeykchen wants to merge 7 commits into
goplus:mainfrom
joeykchen:feat/xgo-runtime-provider-spx
Closed

feat(runtimeprovider): dispatch class projects through verified providers#2847
joeykchen wants to merge 7 commits into
goplus:mainfrom
joeykchen:feat/xgo-runtime-provider-spx

Conversation

@joeykchen

@joeykchen joeykchen commented Aug 18, 2026

Copy link
Copy Markdown

Summary

This PR implements the generic XGo runtime-provider v1 dispatch described in goplus/spx#1741. xgo run, xgo build, and xgo install can discover a framework-declared provider from the application's effective Go graph and delegate through a provider-neutral protocol.

XGo owns discovery, identity validation, process supervision, and output publication. It contains no SPX, Godot, Engine, PCK, or resource-format special cases.

What changed

  • Dispatch runtime-backed class projects before any GenGo path for directory, single-file, and package targets.
  • Resolve class metadata and provider source from one effective module/workspace graph, honoring GOWORK, -mod, -modfile, and -overlay.
  • Preserve selected module provenance separately from replacement source identity and revalidate declaration and provider origins.
  • Validate provider package shape and containment, protocol version, minimum XGo version, recursion, and host-only GOOS/GOARCH.
  • Use ErrNotHandled as the only result that permits legacy fallback; every error after a runtime match is terminal.
  • Preserve application argv boundaries, inherited standard streams, exit status, cancellation, and platform signal semantics.
  • Supervise provider process trees on Unix and Windows and enforce a bounded argv/environment budget.
  • Publish build and install outputs transactionally through private staging, executable validation, and atomic replacement while preserving an existing target on failure.
  • Resolve install output from effective GOBIN, falling back to bin under the first GOPATH entry.

Compatibility and boundaries

Ordinary projects continue through the existing GenGo implementation, and unsupported runtime flags are reported only after a runtime target is confirmed. The existing public tool.RunDir, tool.BuildDir, and tool.InstallDir behavior is unchanged; runtime dispatch is currently a CLI capability.

Runtime v1 is host-desktop only. Multi-file targets, ..., pkg@version, vendor-backed runtime provenance, cross-compilation, and arbitrary Go build flags fail explicitly after a runtime match.

Verification

Added unit and CLI end-to-end coverage for effective graphs, workspaces and replacements, target forms, protocol/flag validation, fail-closed dispatch, process and signal behavior, output transactions, and ordinary-project fallback.

The runtime-provider, run, build, and install suites pass in a temporary workspace containing this checkout and the companion goplus/mod checkout. go vet also passes for the changed packages.

Dependency and release order

This PR consumes the new goplus/mod/runtimeprotocol and resolved-provenance APIs. The companion goplus/mod#164 must merge and release first, then this branch must update its github.com/goplus/mod requirement before XGo is released. The current v0.21.2 requirement does not contain these APIs, so a standalone GOWORK=off build is not expected to pass yet.

Part of goplus/spx#1741.

Companion SPX provider: goplus/spx#1742.

…ders

Resolve runtime metadata from the effective module graph, build host providers with explicit environment and flag policies, and preserve process status across run, build, and install. Keep class modules ordered as resolved records and cover the CLI boundary end to end.
Group build-policy rendering and tests, place resolver entry points before internal provider helpers, and consolidate dispatch and captured Go command handling without changing behavior.
@joeykchen
joeykchen force-pushed the feat/xgo-runtime-provider-spx branch from e09c190 to 112c6b0 Compare August 18, 2026 09:57
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