Created attachment 265362 [details] Poudriere build log mongosh started failing to build at 2025-11-12_03h05m01s Both 2.5.5_2 and 2.5.5_3 fail in the same way: Applying patch from /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/scripts/nodejs-patches/001-configure-bz2.patch... Applying patch from /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/scripts/nodejs-patches/002-workaround-node-bug-52229... Applying patch from /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/scripts/nodejs-patches/003-no-sys-random-on-older-glibc-node-52223.patch... Applying patch from /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/scripts/nodejs-patches/004-build-fix-arm64-cross-compilation.patch... Applying patch from /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/scripts/nodejs-patches/010-src-cares_wrap.h... Applying patch from /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/scripts/nodejs-patches/011-deps-v8-src-base-small-vector.h... error: patch failed: deps/v8/src/base/small-vector.h:22 error: deps/v8/src/base/small-vector.h: patch does not apply ✖ Failed: applying patch failed with code 1 /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/compile/signable-compiler.ts:67 throw new Error(`applying patch failed with code ${code}`); ^ Error: applying patch failed with code 1 at Object.preCompileHook (/wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/compile/signable-compiler.ts:67:13) at processTicksAndRejections (node:internal/process/task_queues:105:5) at async compileJSFileAsBinaryImpl (/wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/index.ts:387:5) at async compileJSFileAsBinary (/wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/index.ts:509:5) at async SignableCompiler.compile (/wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/compile/signable-compiler.ts:172:5) at async runCompile (/wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/compile/run-compile.ts:21:3) at async release (/wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/release.ts:86:5) at async /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/index.ts:115:9 npm error Lifecycle script `evergreen-release` failed with error: npm error code 1 npm error path /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build npm error workspace @mongosh/build@3.7.0 npm error location /wrkdirs/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build npm error command failed npm error command sh -c ts-node -r ../../scripts/import-expansions.js src/index.ts compile *** Error code 1 Stop. make: stopped in /usr/ports/databases/mongosh
This is due to the newly set node24 as lts. My mongosh port follow node's lts so I have to update some patches.
I removed that patch file locally and eventually wound up dying with this at the end of the output → Running ./configure --disable-shared-readonly-heap --prefix=/usr/local --shared-brotli --shared-cares --shared-libuv --shared-nghttp2 --shared-nghttp3 --shared-ngtcp2 --shared-simdjson --shared-zlib --shared-zstd --shared-openssl --openssl-use-def-ca-store --with-intl=system-icu --without-npm --link-module ./lib-boxednode/mongosh.js ... Node.js configure: Found Python 3.11.12... gyp: --disable-shared-readonly-heap not found (cwd: /usr/ports/databases/mongosh/work/boxednode/mongosh/node-v24.11.0) while trying to load --disable-shared-readonly-heap Error running GYP ✖ Failed: Command failed: ./configure --disable-shared-readonly-heap --prefix=/usr/local --shared-brotli --shared-cares --shared-libuv --shared-nghttp2 --shared-nghttp3 --shared-ngtcp2 --shared-simdjson --shared-zlib --shared-zstd --shared-openssl --openssl-use-def-ca-store --with-intl=system-icu --without-npm --link-module ./lib-boxednode/mongosh.js (code 1) Error: Command failed: ./configure --disable-shared-readonly-heap --prefix=/usr/local --shared-brotli --shared-cares --shared-libuv --shared-nghttp2 --shared-nghttp3 --shared-ngtcp2 --shared-simdjson --shared-zlib --shared-zstd --shared-openssl --openssl-use-def-ca-store --with-intl=system-icu --without-npm --link-module ./lib-boxednode/mongosh.js (code 1) at Object.spawnBuildCommand (/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/helpers.ts:47:11) at processTicksAndRejections (node:internal/process/task_queues:105:5) at async compileNode (/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/index.ts:212:5) at async writeMainFileAndCompile (/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/index.ts:441:12) at async compileJSFileAsBinaryImpl (/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/index.ts:454:18) at async compileJSFileAsBinary (/usr/ports/databases/mongosh/work/mongosh-2.5.5/node_modules/boxednode/src/index.ts:509:5) at async SignableCompiler.compile (/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/compile/signable-compiler.ts:172:5) at async runCompile (/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/compile/run-compile.ts:21:3) at async release (/usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/release.ts:86:5) at async /usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build/src/index.ts:115:9 npm error Lifecycle script `evergreen-release` failed with error: npm error code 1 npm error path /usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build npm error workspace @mongosh/build@3.7.0 npm error location /usr/ports/databases/mongosh/work/mongosh-2.5.5/packages/build npm error command failed npm error command sh -c ts-node -r ../../scripts/import-expansions.js src/index.ts compile *** Error code 1
Created attachment 265639 [details] patch that fixes build with node24 I did not update mongosh to the latest version for now. This is just to fix the build of mongosh 2.5.5.
mongosh built with that patch but I get ">mongosh Assertion failed: (EmbedderSnapshotData::CanUseCustomSnapshotPerIsolate()), function RunNodeInstance, file ../src/node_main.cc, line 251." when I try to run it.
I opened an issue upstream: https://jira.mongodb.org/projects/MONGOSH/issues/MONGOSH-3046 I guess I'll have to set node22 as default build version for now.
Created attachment 266243 [details] git_diff_v1 I will stick to node22 for now as node24 is not supported upstream to build mongosh.
Created attachment 266678 [details] git_diff_v2 I added some debug arguments during the build time. I don't understand why I get this behaviour on 15 : > > lerna run compile --scope @mongosh/cli-repl --include-dependencies > > lerna notice cli v8.1.8 > memory allocation of 84 bytes failed > lerna ERR! RuntimeError: unreachable > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3313]:0x24558e > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3235]:0x245345 > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3249]:0x2453bb > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3123]:0x244df9 > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3136]:0x244ea3 > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3135]:0x244e98 > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[3131]:0x244e66 > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[2919]:0x243a87 > lerna ERR! at wasm://wasm/00b1b5a2:wasm-function[1093]:0x1e408d > lerna ERR! lerna unreachable > *** Error code 1 > > Stop. > make: stopped making "build" in /usr/ports/databases/mongosh
Just stumbled upon this as well; is there a working fix on the way? I find myself in the middle of an upgrade and with no working CLI this is very difficult :-D I found that `npm install mongosh` gives me a working version, even with node/npm 24..
(In reply to Eirik Oeverby from comment #8) The fix attached works fine on 13 et 14 but randomly fails on 15, I don't know why. Of course you can install it with npm but the space taken by the project is significantly larger :(
This hit me today on FreeBSD 14.3 on head - a rough place to be right now.
(In reply to Fabien Amelinck from comment #5) Choosing to use node22 is not an option. The port contains: "USES= nodejs:lts,build"
(In reply to Dan Langille from comment #11) Yes I chose lts in the past to follow node's lts but mongosh does not support it currently so I froze the version to node22 in my attached patch. You can set "nodejs:22,build" to test yourself.
This patch applies cleanly and builds here at $WORK.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=41be8a32ce0abd7aceb444172c787518a086cd22 commit 41be8a32ce0abd7aceb444172c787518a086cd22 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2026-01-14 19:27:42 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2026-01-14 19:27:42 +0000 databases/mongosh: Fix build by using nodejs22 This doesn't build with lts any more. PR: 290975 databases/mongosh/Makefile | 6 +++--- databases/mongosh/files/patch-package.json | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-)
I think this should be backported to 2026Q1, otherwise, quarterly uses will be broken for another 3 months. I'll do that soon.
Thanks a lot ! I added the flag to request quarterly merge. See you.
A commit in branch 2026Q1 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=bd3148af2d6a320e7ff5352915fd32d958bab741 commit bd3148af2d6a320e7ff5352915fd32d958bab741 Author: Dan Langille <dvl@FreeBSD.org> AuthorDate: 2026-01-14 19:27:42 +0000 Commit: Dan Langille <dvl@FreeBSD.org> CommitDate: 2026-01-19 14:11:10 +0000 databases/mongosh: Fix build by using nodejs22 This doesn't build with lts any more. PR: 290975 (cherry picked from commit 41be8a32ce0abd7aceb444172c787518a086cd22) databases/mongosh/Makefile | 6 +++--- databases/mongosh/files/patch-package.json | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-)