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.
|
…r publishing Implements the `darwin-arm64` portion of #2399. Fixes #2400. ## Summary Adds Apple Silicon macOS (`darwin-arm64`) as a supported target for the Java SDK's experimental in-process runtime, alongside the existing GNU/Linux `linux-x64` and Windows `win32-x64` targets delivered by #2301 and #2393. - Packages a macOS native classifier containing `runtime.node`, `copilot`, and `platform.properties`. - Activates and validates the `darwin-arm64` classifier automatically on Apple Silicon macOS, including when Maven runs with `-Pinprocess`. - Extends native fetch, host-validation, artifact-validation, and local-publication tests to cover Darwin artifacts and reject unsupported Intel macOS hosts. - Runs the Java in-process test suite on `macos-26` in addition to the existing Ubuntu and Windows matrix. - Builds the Darwin classifier on an Apple Silicon macOS runner and adds it to the blocking publication-assembly test. - Extends both snapshot and Maven Central release workflows so Linux, Windows, and Darwin classifiers are built on their matching native hosts and published together in one Maven deployment. - Documents Apple Silicon setup, classifier contents, supported-host behavior, and the updated ADR-007 platform status. ## User experience In-process mode remains opt-in, experimental, and unchanged for existing Linux and Windows consumers. The SDK's default connection behavior is also unchanged. An Apple Silicon macOS application enables in-process mode by: 1. Depending on `com.github:copilot-sdk-java-runtime` with classifier `darwin-arm64`, plus JNA. 2. Configuring `CopilotClientOptions` with `RuntimeConnection.forInProcess()`. The classifier JAR contains: ```text native/darwin-arm64/runtime.node native/darwin-arm64/platform.properties native/darwin-arm64/copilot ``` For SDK development on Apple Silicon, `mvn -Pinprocess clean verify` detects `darwin-arm64`, validates that the host is macOS ARM64, fetches the pinned `@github/copilot-darwin-arm64` package, packages its version-matched runtime and transitional CLI, and exercises the in-process integration suite. Intel macOS and other unsupported OS/architecture combinations fail explicit in-process host validation rather than packaging the wrong binary. During the active Rust migration, the classifier intentionally includes the version-matched `copilot` embedded-host executable in addition to `runtime.node`. It can be removed once the native runtime no longer delegates unported method bodies to the CLI. ## Packaging and publication model This extends the coordinated publication model introduced by #2393 from two native classifiers to three: | Classifier | Build host | Native contents | |---|---|---| | `linux-x64` | Ubuntu x64 glibc | `runtime.node`, `copilot`, metadata | | `win32-x64` | Windows x64 | `runtime.node`, `copilot.exe`, metadata | | `darwin-arm64` | Apple Silicon macOS | `runtime.node`, `copilot`, metadata | The macOS job builds only the `darwin-arm64` classifier and a SHA-256 manifest. The sole Ubuntu publisher then: 1. Verifies that the macOS and Windows handoffs came from the same immutable source and Maven version as the Linux build. 2. Verifies each checksum, expected filename, pinned native-runtime version, required contents, and absence of cross-classifier contamination. 3. Attaches the external Windows and Darwin classifier JARs to the Maven reactor. 4. Builds `linux-x64` locally and performs one deployment containing the neutral SDK artifacts and all three native classifiers. Using one deployment preserves a shared Maven snapshot timestamp/build number and ensures release signing covers every classifier. Snapshot and release summaries now report the build host, filename, and SHA-256 hash for all three classifiers. ## CI and safety checks - The in-process Actions matrix covers `linux-x64`, `win32-x64`, and `darwin-arm64`. - A dedicated `macos-26` job builds and validates the Darwin publication input before upload. - Blocking publication assembly downloads both external native artifacts and validates the complete signed local repository before publication workflows can drift unnoticed. - Host validation accepts only `darwin` + `arm64` for `darwin-arm64`; Intel macOS and non-macOS hosts are rejected. - Artifact validation requires a nonempty Darwin `runtime.node`, `copilot`, and matching `platform.properties`. - Local-publication validation requires all three classifiers and rejects native resources from the wrong platform. - Fetch tests cover complete, missing, and stale Darwin staging states. ## Validation coverage - Darwin native-host acceptance and rejection tests. - Darwin classifier artifact-validation tests. - Three-classifier local-publication validation and contamination tests. - Native fetch tests across Linux, Windows, and Darwin classifiers. - Apple Silicon `mvn -Pinprocess clean verify` in the Java CI matrix. - Native publication-input build on `macos-26`. - Complete Linux/Windows/Darwin local publication assembly on Ubuntu.
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