fix(addon): fix Docker build failure under pnpm 11 (ERR_PNPM_IGNORED_BUILDS)#6
Open
YangXu1990uiuc wants to merge 1 commit into
Open
fix(addon): fix Docker build failure under pnpm 11 (ERR_PNPM_IGNORED_BUILDS)#6YangXu1990uiuc wants to merge 1 commit into
YangXu1990uiuc wants to merge 1 commit into
Conversation
pnpm 11 no longer reads the "pnpm" field in package.json, so the onlyBuiltDependencies allowlist was silently ignored. With strictDepBuilds (default true) every dependency build script then hard-fails install with ERR_PNPM_IGNORED_BUILDS, breaking the Supervisor build on all architectures. - Add mcp-server/pnpm-workspace.yaml with the new allowBuilds allowlist: better-sqlite3 needs its native build; esbuild, onnxruntime-node, protobufjs and sharp keep their scripts disabled, matching the behavior that shipped with pnpm 10 - COPY pnpm-workspace.yaml into the mcp-builder stage before pnpm install - Pin pnpm to major version 11 so future majors can't silently break builds - Replace the error-swallowing `pnpm install --frozen-lockfile 2>/dev/null || pnpm install` with an explicit lockfile-presence check Fixes dkmaker#4 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4
Problem
The Supervisor build of the add-on fails on all architectures at the
mcp-builderstage:Root cause chain:
npm install -g pnpm), so builds silently moved to pnpm 11 when it becamelatest.pnpmfield inpackage.json(the build log warns about this), so the existingpnpm.onlyBuiltDependencies: ["better-sqlite3"]allowlist is ignored. Its replacement isallowBuildsinpnpm-workspace.yaml(available since pnpm 10.26, see https://pnpm.io/settings).strictDepBuilds(defaulttrue) treats every dependency build script as unreviewed and hard-fails the install. UnderstrictDepBuilds, every package that wants to run a build script must be listed explicitly — which is why the new file lists all five, not just better-sqlite3.pnpm-lock.yaml, sopnpm install --frozen-lockfilealways fails withERR_PNPM_NO_LOCKFILE, but the error was hidden by2>/dev/null || pnpm install.Note: the
pnpm approve-builds --yesworkaround suggested in #4 doesn't address the config migration; the declarativeallowBuildsfile is the intended replacement.Changes
addon/mcp-server/pnpm-workspace.yamlwith theallowBuildsallowlist.better-sqlite3: true(needs its native build); esbuild, onnxruntime-node, protobufjs and sharp are set tofalse, which reproduces exactly the behavior that shipped under pnpm 10 (their scripts were skipped byonlyBuiltDependenciesand the add-on worked).pnpm installso the allowlist is actually in effect during the Docker build.npm install -g pnpm@11) so a future major can't silently break the build again.pnpm install --frozen-lockfile 2>/dev/null || pnpm installwith an explicit lockfile-presence check.The old
pnpm.onlyBuiltDependenciesfield inpackage.jsonis kept for compatibility with pnpm < 10.26 (pnpm 11 prints a one-line warning that it's ignored; harmless).Validation
Built the previously-failing stage locally from the
addon/directory:Completes successfully end-to-end on amd64:
pnpm installpasses, the build-time doc index is created (355 markdown files — this exercises the compiled better-sqlite3 native module),tsccompiles, andpnpm prune --prodsucceeds.🤖 Generated with Claude Code