Skip to content

Java: add Windows x64 in-process runtime and native classifier publishing - #2393

Merged
edburns merged 2 commits into
mainfrom
edburns/2323-java-windows-x64-embed-rust
Aug 25, 2026
Merged

Java: add Windows x64 in-process runtime and native classifier publishing#2393
edburns merged 2 commits into
mainfrom
edburns/2323-java-windows-x64-embed-rust

Conversation

@edburns

@edburns edburns commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #2392 .

Summary

Adds win32-x64 as a supported target for the Java SDK's experimental in-process runtime, alongside the existing GNU/Linux linux-x64 target.

  • Packages a Windows native classifier containing runtime.node, copilot.exe, and platform.properties.
  • Selects and validates the host-appropriate classifier when Maven runs with -Pinprocess: linux-x64 on x64 glibc Linux and win32-x64 on x64 Windows.
  • Updates native extraction/loading and tests for Windows filesystem, executable-name, loaded-DLL, and atomic-move behavior.
  • Runs the Java in-process test suite on both Ubuntu and Windows and adds blocking publication-assembly coverage.
  • Builds each classifier on its native runner, verifies source/version identity, checksums, expected contents, and cross-classifier contamination, then publishes both classifiers in one Maven deployment.
  • Applies that coordinated publication model to Maven Central snapshots and releases, including signed local-publication validation and one post-deployment summary covering every published classifier.
  • Documents Windows x64 dependencies and updates ADR-007's supported-platform status.

User experience

In-process mode remains opt-in and the SDK's default connection behavior is unchanged. Applications enable it by:

  1. Depending on com.github:copilot-sdk-java-runtime with the target classifier (linux-x64 or win32-x64) plus JNA.
  2. Configuring CopilotClientOptions with RuntimeConnection.forInProcess().

For SDK development, mvn -Pinprocess clean verify automatically 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-x64 classifier and its checksum. Ubuntu independently builds linux-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_dispatch runs 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.exe embedded-host executable in addition to runtime.node. The executable can be removed once the native runtime no longer delegates unported method bodies to the CLI.

Validation

  • Native packaging script suite: 29 tests passing.
  • Full Windows x64 mvn -Pinprocess clean verify reactor run.
  • Host-matched Linux/Windows in-process Actions matrix.
  • Local signed Maven publication containing the primary artifact, POM, sources, Javadoc, and both native classifiers with signatures.
  • Topic-branch snapshot publication produced linux-x64 and win32-x64 under one snapshot build: https://github.com/github/copilot-sdk/actions/runs/32891483956

Copilot AI balanced review requested due to automatic review settings August 24, 2026 23:22
@edburns
edburns requested a review from a team as a code owner August 24, 2026 23:22
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread java/docs/adr/adr-007-native-bundling-strategy.md
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment thread .github/workflows/java-publish-snapshot.yml Fixed
Comment thread .github/workflows/java-sdk-tests.yml Fixed
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

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
@edburns
edburns force-pushed the edburns/2323-java-windows-x64-embed-rust branch from a295efa to 1993672 Compare August 25, 2026 20:17
@github-actions

Copy link
Copy Markdown
Contributor

SDK Consistency Review ✅

This PR adds Windows x64 native (Rust JNI) library embedding to the Java SDK — infrastructure work specific to Java's NativeRuntimeLoader and the CI/CD pipeline for publishing native classifiers.

No cross-SDK consistency issues found. The changes are:

  • Platform-specific native library loading (AccessDeniedException handling, Windows temp-dir extraction)
  • Java publish workflows and native artifact validation scripts
  • ADR documentation for the bundling strategy

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.

Generated by SDK Consistency Review Agent for #2393 · sonnet46 19 AIC · ⌖ 5.36 AIC · ⊞ 6.6K ·

@edburns edburns changed the title Edburns/2323 java windows x64 embed rust Java: add Windows x64 in-process runtime and native classifier publishing Aug 25, 2026
@edburns
edburns merged commit 93351c9 into main Aug 25, 2026
39 checks passed
@edburns
edburns deleted the edburns/2323-java-windows-x64-embed-rust branch August 25, 2026 20:30
@edburns
edburns restored the edburns/2323-java-windows-x64-embed-rust branch August 25, 2026 20:30
@edburns
edburns deleted the edburns/2323-java-windows-x64-embed-rust branch August 25, 2026 20:33
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.

[Java] Initial implementation of win32-x64

3 participants