Commit 48b280a
authored
Java: add Apple Silicon macOS in-process runtime and native classifier 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.1 parent 93351c9 commit 48b280a
13 files changed
Lines changed: 527 additions & 24 deletions
File tree
- .github/workflows
- java
- copilot-native
- scripts
- docs/adr
- sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
244 | 303 | | |
245 | 304 | | |
246 | | - | |
| 305 | + | |
247 | 306 | | |
248 | 307 | | |
249 | 308 | | |
| |||
283 | 342 | | |
284 | 343 | | |
285 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
286 | 350 | | |
287 | 351 | | |
288 | 352 | | |
| |||
304 | 368 | | |
305 | 369 | | |
306 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
307 | 392 | | |
308 | 393 | | |
309 | 394 | | |
310 | 395 | | |
311 | 396 | | |
312 | | - | |
| 397 | + | |
| 398 | + | |
313 | 399 | | |
314 | 400 | | |
315 | 401 | | |
| |||
329 | 415 | | |
330 | 416 | | |
331 | 417 | | |
| 418 | + | |
332 | 419 | | |
333 | 420 | | |
334 | 421 | | |
| |||
337 | 424 | | |
338 | 425 | | |
339 | 426 | | |
340 | | - | |
| 427 | + | |
341 | 428 | | |
342 | 429 | | |
343 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
96 | 161 | | |
97 | 162 | | |
98 | | - | |
| 163 | + | |
99 | 164 | | |
100 | 165 | | |
101 | 166 | | |
| |||
128 | 193 | | |
129 | 194 | | |
130 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
131 | 201 | | |
132 | 202 | | |
133 | 203 | | |
| |||
141 | 211 | | |
142 | 212 | | |
143 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
144 | 218 | | |
145 | 219 | | |
146 | 220 | | |
| |||
154 | 228 | | |
155 | 229 | | |
156 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
157 | 256 | | |
158 | 257 | | |
159 | 258 | | |
160 | 259 | | |
161 | | - | |
| 260 | + | |
| 261 | + | |
162 | 262 | | |
163 | 263 | | |
164 | 264 | | |
| |||
176 | 276 | | |
177 | 277 | | |
178 | 278 | | |
| 279 | + | |
179 | 280 | | |
180 | 281 | | |
181 | 282 | | |
| |||
0 commit comments