You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documents the decision to distribute the Rust Copilot runtime as
per-platform classifier JARs (DJL style) rather than a monolithic
all-platform JAR or download-on-demand.
Covers: platform dimensions (6 or 8 Rust target triples), 100%
deterministic platform selection via os.name/os.arch/ELF PT_INTERP,
measured binary sizes from cli-1.0.69-2, comparables (ONNX Runtime,
DJL, SQLite JDBC), and a references section defining FFI, JNA, napi-rs,
cdylib, C ABI, ELF, glibc, musl, MSVC CRT, DJL, os-maven-plugin, and
ONNX Runtime for readers unfamiliar with the native binary ecosystem.
Related: #1917
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: java/docs/adr/adr-007-native-bundling-strategy.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,11 @@ Measured from `github/copilot-agent-runtime` release `cli-1.0.69-2` (2026-07-06)
59
59
|`win32-x64`| 55.9 MB |~22.4 MB |
60
60
|`win32-arm64`| 48.4 MB |~19.4 MB |
61
61
62
+
<<<<<<< HEAD
62
63
The published Java SDK JAR (`copilot-sdk-java-1.0.6-preview.1.jar`) is currently **1.53 MB**. A monolithic JAR containing all 6 common-case native binaries would be approximately **132 MB** compressed; all 8 including musl would be approximately **180 MB** compressed.
64
+
=======
65
+
The published Java SDK JAR (`copilot-sdk-java-1.0.6-preview.1.jar`) is currently **1.53 MB**. A monolithic JAR containing all 6 common-case native binaries would be approximately **134 MB** compressed; all 8 including musl would be approximately **182 MB** compressed.
All native dependencies within the runtime (`rustls`/`aws-lc-rs` for TLS, `rusqlite` with `bundled` feature for SQLite, `zlib-rs` for compression) are statically compiled into the binary. There are no dependencies on system OpenSSL, libgit2, or libz.
65
69
@@ -75,7 +79,11 @@ All 6 (or 8) `runtime.node` binaries are bundled inside the single `copilot-sdk-
75
79
76
80
**Drawbacks:**
77
81
- Every user downloads every platform regardless of their target. A developer on Apple Silicon downloads 105+ MB of Linux and Windows binaries they will never use.
82
+
<<<<<<< HEAD
78
83
- Build tooling (thin Docker layers, incremental CI caches, artifact registries) penalises large JARs. A single 132–180 MB JAR invalidates the entire cache whenever any platform's binary changes.
84
+
=======
85
+
- Build tooling (thin Docker layers, incremental CI caches, artifact registries) penalises large JARs. A single 134–182 MB JAR invalidates the entire cache whenever any platform's binary changes.
- Maven's dependency resolution has no mechanism to supply platform-appropriate variants automatically; platform selection must happen entirely at runtime inside the JAR.
80
88
- Conflicts with the principle that Maven artifacts should be reproducible and minimal.
81
89
@@ -105,7 +113,11 @@ Build tools can be configured to resolve the correct classifier automatically:
105
113
-**Uber-jar builds**: include all classifiers; the coordination artifact picks the right one at runtime.
106
114
107
115
**Advantages:**
116
+
<<<<<<< HEAD
108
117
- Default download is the tiny coordination artifact (~1.5 MB) plus one platform JAR (~20–26 MB compressed) — approximately **22–28 MB total** vs. 132–180 MB for a monolithic JAR.
118
+
=======
119
+
- Default download is the tiny coordination artifact (~1.5 MB) plus one platform JAR (~20–26 MB compressed) — approximately **22–28 MB total** vs. 134–182 MB for a monolithic JAR.
@@ -137,7 +149,11 @@ The SDK ships a minimal placeholder that detects the current platform at runtime
137
149
138
150
### Rationale
139
151
152
+
<<<<<<< HEAD
140
153
1.**User download cost matches actual need.** Most users run on one OS and architecture. Option 2 makes their download approximately 22–28 MB (coordination JAR + one platform JAR), versus 132–180 MB for Option 1 and an unbounded deferred network cost for Option 3.
154
+
=======
155
+
1.**User download cost matches actual need.** Most users run on one OS and architecture. Option 2 makes their download approximately 22–28 MB (coordination JAR + one platform JAR), versus 134–182 MB for Option 1 and an unbounded deferred network cost for Option 3.
2.**Proven ecosystem pattern.** DJL, Netty, and others have established the per-classifier pattern as the correct Maven idiom for large native binaries. Build tooling already knows how to handle it; users and framework integrations (Spring Boot, Quarkus, Micronaut) are familiar with it.
143
159
@@ -347,8 +363,11 @@ The pattern is identical to how DJL's `LibUtils.loadLibrary()` works — detect
0 commit comments