mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 05:28:19 -05:00
Some deps ship their native binary in a per-platform package declared as an *optional* dependency of a small base package (e.g. `@openai/codex` -> `@openai/codex-<platform>-<arch>`, `@anthropic-ai/claude-agent-sdk` -> `@anthropic-ai/claude-agent-sdk-<platform>-<arch>`). npm does not fail when an optional dependency can't be installed, so a transient hiccup can leave the base package present but the per-platform package missing — and that broken tree then gets frozen into the shared node_modules cache and served to every consumer (see #323881). Add build/azure-pipelines/common/checkNativeOptionalDeps.ts and run it after `npm ci` in the linux, macOS and windows cache-build jobs (before the cache is saved). For each configured base package that is installed, it asserts the matching `<base>-<platform>-<arch>` package exists, and fails the job otherwise so a poisoned cache is never saved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>