Java: add Windows x64 in-process runtime and native classifier publishing - #2393
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Extends Java’s experimental in-process runtime packaging from Linux x64 to Windows x64 while preserving host-gated builds.
Changes:
- Adds Windows classifier packaging and host validation.
- Expands loader tests and CI to Windows.
- Updates user and architecture documentation.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/java-sdk-tests.yml |
Adds Windows in-process CI. |
java/copilot-native/pom.xml |
Adds Windows native packaging profile. |
java/copilot-native/scripts/fetch-native.test.mjs |
Tests Windows artifact staging. |
java/copilot-native/scripts/validate-native-host.mjs |
Validates Windows x64 hosts. |
java/copilot-native/scripts/validate-native-host.test.mjs |
Tests Windows host validation. |
java/docs/adr/adr-007-native-bundling-strategy.md |
Documents Windows classifier support. |
java/README.md |
Adds Windows setup guidance. |
java/sdk/pom.xml |
Selects the host classifier for tests. |
java/sdk/src/main/java/com/github/copilot/ffi/NativeRuntimeLoader.java |
Handles Windows publication races. |
java/sdk/src/test/java/com/github/copilot/ffi/JnaNativeBindingTest.java |
Supports Windows library locking. |
java/sdk/src/test/java/com/github/copilot/ffi/NativeRuntimeLoaderTest.java |
Makes loader tests platform-aware. |
2323-java-windows-x64-embed-rust-remove-before-merge/20260824-ghcp-sdk-2323-prompt.md |
Temporary task prompt. |
2323-java-windows-x64-embed-rust-remove-before-merge/20260816-notes-to-linux-x64-agent.md |
Temporary Linux validation notes. |
2323-java-windows-x64-embed-rust-remove-before-merge/20260815-make-it-so-no-incorrect-os-arch-artifacts-are-produced.md |
Temporary implementation plan. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 14/15 changed files
- Comments generated: 4
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
GUTDODP GUTDODP fix(java): avoid PowerShell Maven argument parsing Remove the redundant native download property so the Windows in-process job does not pass a dotted -D argument through PowerShell. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f fix(java): keep relative path test on workspace drive Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f fix(java): make coverage report portable Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f GUTDODP Plan for adding win32-x64 to release Prompt to implement win32 release feat(java): publish native classifiers from matching hosts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f build(deps-dev): bump hono from 4.12.32 to 4.13.1 in /test/harness (#2300) Bumps [hono](https://github.com/honojs/hono) from 4.12.32 to 4.13.1. - [Release notes](https://github.com/honojs/hono/releases) - [Commits](honojs/hono@v4.12.32...v4.13.1) --- updated-dependencies: - dependency-name: hono dependency-version: 4.13.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> fix(java): use workflow SHA for snapshot checkouts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f fix(java): use workflow SHA for publication test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f fix(java): stabilize Windows publishing checks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f ci(java): consolidate snapshot artifact summary Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f ci(java): consolidate release artifact summary Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e2a48f51-02fe-445b-a253-40776b09a44f GUTDODP Remove prompts
a295efa to
1993672
Compare
SDK Consistency Review ✅This PR adds Windows x64 native (Rust JNI) library embedding to the Java SDK — infrastructure work specific to Java's No cross-SDK consistency issues found. The changes are:
This is Java-internal infrastructure (how the Java SDK loads its Rust JNI binding). The other SDKs (Node.js, Python, Go, .NET, Rust) do not have an equivalent JNI layer — they interact with the Copilot CLI via JSON-RPC or link Rust natively — so no parallel changes are needed elsewhere.
|
Fixes #2392 .
Summary
Adds
win32-x64as a supported target for the Java SDK's experimental in-process runtime, alongside the existing GNU/Linuxlinux-x64target.runtime.node,copilot.exe, andplatform.properties.-Pinprocess:linux-x64on x64 glibc Linux andwin32-x64on x64 Windows.User experience
In-process mode remains opt-in and the SDK's default connection behavior is unchanged. Applications enable it by:
com.github:copilot-sdk-java-runtimewith the target classifier (linux-x64orwin32-x64) plus JNA.CopilotClientOptionswithRuntimeConnection.forInProcess().For SDK development,
mvn -Pinprocess clean verifyautomatically exercises the native runtime appropriate to the supported host. Unsupported OS/architecture/libc combinations fail validation instead of silently packaging the wrong native binary.Publication model
Windows builds and uploads only the
win32-x64classifier and its checksum. Ubuntu independently buildslinux-x64, verifies the Windows handoff came from the same immutable source and version, attaches it to the reactor, and performs a single deployment. This ensures snapshot coordinates share one Maven timestamp/build number and release signing covers both classifiers.Scheduled snapshot publication remains restricted naturally to the default branch, while imperative
workflow_dispatchruns can still publish from a selected non-default branch. Publication summaries are emitted only after Maven succeeds and list both classifier filenames and SHA-256 hashes without duplicate per-job callouts.During the active Rust migration, each classifier intentionally includes the version-matched
copilot/copilot.exeembedded-host executable in addition toruntime.node. The executable can be removed once the native runtime no longer delegates unported method bodies to the CLI.Validation
mvn -Pinprocess clean verifyreactor run.linux-x64andwin32-x64under one snapshot build: https://github.com/github/copilot-sdk/actions/runs/32891483956