From e7d2d57da27d53a73d0570fbda4aa818b16a4848 Mon Sep 17 00:00:00 2001 From: JF Date: Thu, 20 Aug 2026 21:59:52 -0400 Subject: [PATCH] fix(docker): vendor only the image's platform in the builder stage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The builder's `pnpm run build` triggers prebuild -> vendor:adapters -> vendor-codelldb.js, which defaults to all five platforms because CI is unset inside docker build. The .dockerignore deliberately ships only the linux payloads into the context, so every fresh image build re-downloaded ~450 MB of win32/darwin CodeLLDB the Linux image never uses — a needless network dependency that failed the build on a GitHub connectivity blip (loudly, now that #389's exit guard works). CODELLDB_VENDOR_ALL=false flips the script's local default to current-platform-only, which the Dockerfile's digest-verified shell vendor step already satisfied, so the prebuild vendor pass downloads nothing and the build is deterministic. (SKIP_ADAPTER_VENDOR would be wrong here: it also skips the js-debug vendoring the bundle needs.) Verified: docker build passes with the vendor step skipping instantly; the built image's vendor tree contains only linux-x64/linux-arm64 + the current symlink, and CODELLDB_PATH's engine is present/executable. Co-Authored-By: Claude Fable 5 --- CHANGELOG.md | 1 + Dockerfile | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b517242..77118917 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **CodeLLDB ships as per-platform npm packages (esbuild pattern)** — five new packages `@debugmcp/codelldb-{win32-x64,darwin-x64,darwin-arm64,linux-x64,linux-arm64}` (versioned by the CodeLLDB release, currently 1.11.8, payload staged from the digest-pinned VSIXs) are `optionalDependencies` of `@debugmcp/mcp-debugger`, so npm installs exactly the one matching your os/cpu. Rust and C/C++ debugging now work out of the box on every platform npm serves — previously the CLI tarball bundled linux-x64 only — and the core tarball shrinks from ~54 MB to a few MB. The resolver probes the installed platform package last — after the vendor tree and after `CODELLDB_PATH` — so an explicit `CODELLDB_PATH` still overrides the auto-installed package, and installs with `--omit=optional` keep working via `CODELLDB_PATH` (#383) ### Fixed +- **Docker image builds vendor only the image's own platform** — the builder stage now sets `CODELLDB_VENDOR_ALL=false`, so the prebuild vendor step reuses the digest-verified engine the Dockerfile already fetched instead of re-downloading ~450 MB of win32/darwin CodeLLDB payloads the Linux image never uses (the `.dockerignore` excludes them from the context, so every fresh build paid that download and could fail on any network blip) - **vendor-codelldb.js can no longer die silently with exit 0** — the script-level root cause behind #389 (the Docker workaround shipped in v0.24.2 stands): a stalled extract-zip promise drained the event loop and Node exited 0 with no failure output. Extraction now runs under a watchdog (default 120 s, `CODELLDB_EXTRACT_TIMEOUT_MS`) whose pending timer keeps the event loop alive and converts a stall into a normal retry/failure, and a premature-exit guard forces exit code 1 with a requested/completed/unresolved-platforms diagnostic if the process would otherwise exit 0 before vendoring finished (#389) ## [0.24.2] - 2026-08-19 diff --git a/Dockerfile b/Dockerfile index 030f32c3..df227d12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,13 @@ RUN set -eux; \ test -x "$DEST/adapter/codelldb"; \ ln -sfn "$CODELLDB_ARCH" /app/packages/codelldb-common/vendor/codelldb/current -# 5) Build workspace packages and main project (root build runs build:packages); then bundle +# 5) Build workspace packages and main project (root build runs build:packages); then bundle. +# The node vendor script runs via prebuild -> vendor:adapters; without this env it +# would default to all five platforms and re-download the win32/darwin payloads the +# .dockerignore deliberately excludes (~450 MB the Linux image never uses, and a +# needless network dependency that can fail the build). Host-only mode finds the +# shell-vendored engine above already fresh and downloads nothing. +ENV CODELLDB_VENDOR_ALL=false RUN pnpm run build --silent RUN node scripts/bundle.js