Skip to content

Commit 1a6be12

Browse files
committed
no-mistakes(document): correct stale engine platform counts in client docs
1 parent ef37289 commit 1a6be12

7 files changed

Lines changed: 65 additions & 16 deletions

File tree

jetbrains/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ the dependency ever becomes a problem.
3939
## Engine resolution
4040

4141
The plugin does **not** bundle engine binaries, and neither does any other
42-
client any more: bundling all four platforms meant a ~120 MB download for the
43-
one binary a given user can actually run.
42+
client any more: bundling every platform meant a download several times the size
43+
of the one binary a given user can actually run.
4444
The engine is published once as GitHub release assets and each client fetches
4545
what its platform needs, into the shared `~/.codegraph/bin`.
4646

jetbrains/src/main/kotlin/ai/codegraph/jetbrains/server/CodeGraphServerResolver.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ data class ResolverEnvironment(
5959
/**
6060
* Locates the `codegraph-server` engine binary.
6161
*
62-
* Resolution order mirrors `vscode/src/server.ts`, with one deliberate
63-
* difference: the JetBrains plugin does not bundle platform binaries. The VSIX
64-
* carries four of them (100-126 MB each) because VS Code can ship per-platform
65-
* artifacts; the JetBrains Marketplace cannot, so a bundled plugin would be a
66-
* ~120 MB download for every user regardless of platform. Instead the binary is
67-
* resolved from an existing install and, failing that, downloaded once into the
68-
* managed install directory (Phase 1).
62+
* Resolution order mirrors `vscode/src/server.ts`. No client bundles platform
63+
* binaries any more (each engine is 100-126 MB), and the case against it is
64+
* strongest here: VS Code could at least ship one artifact per platform, while
65+
* the JetBrains Marketplace serves a single artifact to everyone, so a bundled
66+
* plugin would carry every published engine to every user. Instead the binary
67+
* is resolved from an existing install and, failing that, downloaded once into
68+
* the managed install directory (Phase 1).
6969
*
7070
* Order:
7171
* 1. Explicit user override (settings)

jetbrains/src/main/kotlin/ai/codegraph/jetbrains/server/EngineDownloader.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import java.util.Locale
1818
* Fetches the engine for this platform into the managed install directory.
1919
*
2020
* The plugin does not bundle engines: the JetBrains Marketplace serves one
21-
* artifact to every platform, so bundling all four would mean a ~120 MB
22-
* download for every user to obtain the ~30 MB they can run. The alternative
23-
* for users without Node is worse - install a 498 MB npm package for one
24-
* binary - so the engine is fetched directly from the release that
21+
* artifact to every platform, so bundling every published engine would mean a
22+
* download several times the size of the one a given user can run. The
23+
* alternative for users without Node is worse - install a 498 MB npm package
24+
* for one binary - so the engine is fetched directly from the release that
2525
* `scripts/publish-release-assets.sh` produces.
2626
*
2727
* Downloads are verified against the checksum published beside each asset. An

jetbrains/src/test/kotlin/ai/codegraph/jetbrains/server/EngineDownloaderTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@ class EngineDownloaderTest : BasePlatformTestCase() {
8484
assertTrue("the engine must be executable", path.toFile().canExecute())
8585
}
8686

87+
fun `test an arm64 linux ide installs the arm64 engine`() {
88+
// The platform this channel gained. Both Linux assets are published, so
89+
// a mapping that fell back to x64 would install cleanly here and only
90+
// fail when the IDE tried to start the engine - which is why the whole
91+
// download is exercised and not just the name it resolves to.
92+
publish("0.20.1", "codegraph-server-linux-arm64", "arm64 engine".toByteArray())
93+
publish("0.20.1", "codegraph-server-linux-x64", "x64 engine".toByteArray())
94+
95+
val path = downloader("Linux").download("0.20.1")
96+
97+
assertEquals("codegraph-server-linux-arm64", path.fileName.toString())
98+
assertEquals("arm64 engine", Files.readString(path))
99+
assertTrue("the engine must be executable", path.toFile().canExecute())
100+
}
101+
87102
fun `test windows also installs the runtime library the engine loads`() {
88103
publish("0.19.1", "codegraph-server-win32-x64.exe", "engine".toByteArray())
89104
publish("0.19.1", EngineDownloader.WINDOWS_SIDECAR, "onnx".toByteArray())

mcp-package/test/fetch-engine.test.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,39 @@ async function run() {
110110
}
111111
}
112112

113+
// --- an arm64 linux machine installs the arm64 engine ----------------
114+
// The whole install, not just the name mapping: before linux-arm64 was
115+
// published this threw, and the failure worth guarding against now is the
116+
// quiet one - the x64 asset is served alongside, so a rule that fell back to
117+
// it would install cleanly here and only fail when the user tried to run it.
118+
{
119+
const dir = scratch();
120+
const release = await startRelease({
121+
"codegraph-server-linux-arm64": { content: "arm64 engine" },
122+
"codegraph-server-linux-x64": { content: "x64 engine" },
123+
});
124+
try {
125+
const { binary, fetched } = await ensureEngine(VERSION, dir, {
126+
platform: "linux",
127+
arch: "arm64",
128+
baseUrl: release.baseUrl,
129+
});
130+
check(
131+
path.basename(binary) === "codegraph-server-linux-arm64",
132+
"an arm64 linux install fetches the arm64 engine"
133+
);
134+
check(fs.readFileSync(binary, "utf8") === "arm64 engine", "and it is the arm64 build");
135+
check(
136+
fetched.length === 1 && !fs.existsSync(path.join(dir, "codegraph-server-linux-x64")),
137+
"and nothing else, least of all the x64 build"
138+
);
139+
check(installedVersion(dir) === VERSION, "and the release it came from is recorded");
140+
} finally {
141+
release.server.close();
142+
fs.rmSync(dir, { recursive: true, force: true });
143+
}
144+
}
145+
113146
// --- a corrupted download installs nothing ---------------------------
114147
{
115148
const dir = scratch();

scripts/package-npm.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ fi
102102
# a rate limit part-way through leaves the release with some platforms attached
103103
# and others missing - and a one-platform probe would wave that through, giving
104104
# users on the missing platforms exactly the empty install this gate exists to
105-
# prevent. The list mirrors BINARIES + WINDOWS_SIDECAR there, which is the same
106-
# set bin/fetch-engine.js resolves against.
105+
# prevent.
107106
ENGINE_VERSION=$(node -e "console.log(require('$PKG_DIR/bin/fetch-engine').ENGINE_VERSION)")
108107
# Read from fetch-engine.js rather than repeating it here. A copy of this list
109108
# drifts silently: it stays green while probing a set that no longer matches

scripts/publish-release-assets.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#
1414
# This does not build anything. It uploads what ./scripts/package-*.sh already
1515
# expect to find in vscode/bin/, so it slots in after the existing
16-
# cross-platform build (see cross-platform-builds.md).
16+
# cross-platform build (see cross-platform-builds.md). The one exception is
17+
# linux-arm64, which has no build host of its own: ./scripts/build-linux-arm64.sh
18+
# builds it in a container and stages and stamps it into vscode/bin/ itself.
1719
#
1820
# Usage:
1921
# ./scripts/publish-release-assets.sh # stage + verify only

0 commit comments

Comments
 (0)