Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2026 07:47:46 +0000
From:      Mikael Urankar <mikael@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Cc:        Matt Kempe <fsbruva@yahoo.com>
Subject:   git: 0eb5320b1e14 - main - www/onlyoffice-documentserver: Bugfix Node OOM error on aarch64
Message-ID:  <69f1b7a2.38995.9960722@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0eb5320b1e149346b57d582720dfb09d66d07fa1

commit 0eb5320b1e149346b57d582720dfb09d66d07fa1
Author:     Matt Kempe <fsbruva@yahoo.com>
AuthorDate: 2026-04-18 01:56:53 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2026-04-29 07:46:40 +0000

    www/onlyoffice-documentserver: Bugfix Node OOM error on aarch64
    
    Also update cache fetch method, and yao-pkg/node versions
    
    PR:             294620
---
 www/onlyoffice-documentserver/Makefile             | 40 ++++++++------
 www/onlyoffice-documentserver/distinfo             | 10 ++--
 www/onlyoffice-documentserver/files/npm            |  2 +-
 .../patch-build__tools_scripts_build__server.py    | 10 ++--
 .../files/patch-server_Metrics_package.json        | 10 ++++
 .../files/patch-server_Metrics_patches_statsd      | 64 ++++++++++++++++++++++
 6 files changed, 107 insertions(+), 29 deletions(-)

diff --git a/www/onlyoffice-documentserver/Makefile b/www/onlyoffice-documentserver/Makefile
index c22324ee4f96..af0e06a1217f 100644
--- a/www/onlyoffice-documentserver/Makefile
+++ b/www/onlyoffice-documentserver/Makefile
@@ -1,12 +1,14 @@
 PORTNAME=	onlyoffice-documentserver
 DISTVERSIONPREFIX=	v
 DISTVERSION=	9.3.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES+=	LOCAL/mikael/v8/:source1 \
-		https://nodejs.org/dist/v${_PKGFETCH_NODE_VERSION}/:source2
+		https://nodejs.org/dist/v${_PKGFETCH_NODE_VERSION}/:source2 \
+		https://github.com/fsbruva/onlyoffice-DS-npm-cache/releases/download/${_NPM_CACHE_TAG}/:source3
 DISTFILES+=	v8-8.9.255.25_all.tar.gz:source1 \
-		node-v${_PKGFETCH_NODE_VERSION}.tar.gz:source2
+		node-v${_PKGFETCH_NODE_VERSION}.tar.gz:source2 \
+		onlyoffice-DS-npm-cache-${_NPM_CACHE_TAG}.tar.gz:source3
 
 MAINTAINER=	fsbruva@yahoo.com
 COMMENT=	Secure office and productivity apps
@@ -18,13 +20,15 @@ LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 ONLY_FOR_ARCHS=	aarch64 amd64
 ONLY_FOR_ARCHS_REASON=	Upstream only supports amd64 and arm64
 
-# node version used with "npm install @yao-pkg/pkg@6.14.1"
-# keep in sync with patch-build__tools_scripts_build__server.py and patch-document-server-package_Makefile
+# node version used with "npm install" inside ${WRKSRC}/yao-pkg
+# kept in sync with patch-build__tools_scripts_build__server.py and patch-document-server-package_Makefile
 _DS_BUILD=		8
-_DS_SHARP_VER=		0.32.6
-_PKGFETCH_NODE_VERSION=	20.20.0
-_YAOPKG_VER=		6.14.1
+_PKGFETCH_NODE_VERSION=	24.14.1
+_NPM_CACHE_TAG= ${_DS_TAGNAME}-202604230220
+# end of cache build config
+
 _NODE_DISTFILE=	node-v${_PKGFETCH_NODE_VERSION}.tar.gz
+WRKSRC_npm_cache= ${WRKDIR}/onlyoffice-DS-npm-cache-${_NPM_CACHE_TAG}
 
 # Map FreeBSD ARCH to the node/sharp platform-arch suffix
 .if ${MACHINE_ARCH} == aarch64
@@ -41,10 +45,9 @@ BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}Jinja2>=0:devel/py-Jinja2@${PY_FLAVOR} \
 		glib>=2.54:devel/glib20 \
 		gn:devel/gn \
 		ninja:devel/ninja \
-		npm:www/npm-node20 \
+		npm:www/npm-node24 \
 		optipng:graphics/optipng
 
-# Need libvips because npm module sharp requires it on Unix OS's
 LIB_DEPENDS=	libboost_regex.so:devel/boost-libs \
 		libbrotlicommon.so:archivers/brotli \
 		libbrotlidec.so:archivers/brotli \
@@ -95,8 +98,7 @@ GH_TUPLE=	ONLYOFFICE:build_tools:${_DS_TAGNAME}:buildtools/build_tools \
 		ONLYOFFICE:DocumentBuilder:626d1e44db3d06ceb8298215a67ef0475912d89a:document_builder/DocumentBuilder \
 		ONLYOFFICE:onlyoffice.github.io:b26d001664d771df4f663d2d3ba7dd4a188b6cab:sdkjs_plugins_v1/onlyoffice.github.io \
 		jasenhuang:katana-parser:be6df45:jasenhuang_katana/core/Common/3dParty/html/katana-parser \
-		hunspell:hyphen:73dd296:hunspell_hyphen/core/Common/3dParty/hyphen/hyphen \
-		fsbruva:onlyoffice-DS-npm-cache:${_DS_TAGNAME}-202603231741-prodmatch:npm_cache
+		hunspell:hyphen:73dd296:hunspell_hyphen/core/Common/3dParty/hyphen/hyphen
 
 JAVA_VERSION=	11+
 
@@ -106,6 +108,7 @@ USE_QT=		qmake:build
 MAKE_ENV=	BUILD_NUMBER=${_DS_BUILD} \
 		npm_package_config_node_gyp_nodedir=${LOCALBASE} \
 		npm_package_config_node_gyp_python=${PYTHON_CMD} \
+		NODE_OPTIONS=--max-old-space-size=3072 \
 		PKG_BUILD_PATH=${WRKDIR}/.pkg-build \
 		PKG_CACHE_PATH=${WRKDIR}/.pkg-cache \
 		PRODUCT_VERSION=${DISTVERSION} \
@@ -115,8 +118,6 @@ MAKE_ENV=	BUILD_NUMBER=${_DS_BUILD} \
 # This is a workaround to avoid filesystem violations during poudriere build
 MAKE_ENV+=	PYTHONDONTWRITEBYTECODE=1
 
-CONFLICTS_BUILD=	devel/googletest
-
 # do not strip docservice, converter, metrics and json
 STRIP=
 
@@ -271,17 +272,20 @@ do-build:
 	@cd ${WRKSRC}/server/DocService ; node_modules/.bin/patch-package
 	@cd ${WRKSRC}/server/DocService/node_modules/sharp ; ${SETENV} ${MAKE_ENV} NODE_ENV=production npm run install
 
+	# Install Metrics dependencies and patch statsd for Node 24 compatibility
+	# (util.log was removed in Node 23; patch replaces it with console.log)
+	@cd ${WRKSRC}/server/Metrics ; ${SETENV} ${MAKE_ENV} NODE_ENV=production npm install --ignore-scripts
+	@cd ${WRKSRC}/server/Metrics ; node_modules/.bin/patch-package
+
 	@${MKDIR} ${WRKSRC}/yao-pkg
 	@${CP} ${WRKSRC_npm_cache}/yao-pkg-package.json      ${WRKSRC}/yao-pkg/package.json
-	@${CP} ${WRKSRC_npm_cache}/yao-pkg-package-lock.json ${WRKSRC}/yao-pkg/package-lock.json
-	@cd ${WRKSRC}/yao-pkg ; ${SETENV} ${MAKE_ENV} npm install @yao-pkg/pkg@${_YAOPKG_VER}
+	@${CP} ${WRKSRC_npm_cache}/yao-pkg-npm-shrinkwrap-${MACHINE_ARCH}.json ${WRKSRC}/yao-pkg/npm-shrinkwrap.json
+	@cd ${WRKSRC}/yao-pkg ; ${SETENV} ${MAKE_ENV} npm install
 
 	@cd ${WRKSRC} && ${PATCH} -N -s -i ${FILESDIR}/extra-patch-pkg-fetch_lib-es5_build.js || ${TRUE}
 	@cd ${WRKSRC} && ${PATCH} -N -s -i ${WRKSRC_npm_cache}/extra-patch-pkg-fetch_patches_node.v${_PKGFETCH_NODE_VERSION}.cpp.patch || ${TRUE}
 
 	cd ${WRKSRC}/build_tools/tools/freebsd ; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} automate.py
-
-# Warning regarding missing modern-syslog is harmless - unused syslog backend of statsd requires it
 	cd ${WRKSRC}/document-server-package ; ${SETENV} ${MAKE_ENV} ${GMAKE} freebsd
 
 do-install:
diff --git a/www/onlyoffice-documentserver/distinfo b/www/onlyoffice-documentserver/distinfo
index c19343463f41..f3410c9cd3f2 100644
--- a/www/onlyoffice-documentserver/distinfo
+++ b/www/onlyoffice-documentserver/distinfo
@@ -1,8 +1,10 @@
-TIMESTAMP = 1774288218
+TIMESTAMP = 1776911257
 SHA256 (v8-8.9.255.25_all.tar.gz) = 54853ef93accc063a82a0dc29457b25c9b6d88315431d62e06ab1f84797c5f80
 SIZE (v8-8.9.255.25_all.tar.gz) = 72818814
-SHA256 (node-v20.20.0.tar.gz) = cafc92e90917c17869d982fdff10104c2eb328437ed9bbf03fdda78ebc0accdd
-SIZE (node-v20.20.0.tar.gz) = 88277321
+SHA256 (node-v24.14.1.tar.gz) = 8298cf1f5774093ca819f41b8dd392fd2cff058688b4d5c8805026352e2d31b3
+SIZE (node-v24.14.1.tar.gz) = 113042895
+SHA256 (onlyoffice-DS-npm-cache-v9.3.1.8-202604230220.tar.gz) = fdebf49310b42a8784a7e240df0132ada1b5878a9d62b521ae76d8f5c01a379c
+SIZE (onlyoffice-DS-npm-cache-v9.3.1.8-202604230220.tar.gz) = 123896527
 SHA256 (ONLYOFFICE-DocumentServer-v9.3.1_GH0.tar.gz) = 6df95aa91341504dbee888612552cfd474797d9e1c1f3d97553c4090f9230dcd
 SIZE (ONLYOFFICE-DocumentServer-v9.3.1_GH0.tar.gz) = 982188
 SHA256 (ONLYOFFICE-build_tools-v9.3.1.8_GH0.tar.gz) = 68204c339f27ddf56e1d8aacb1ea79afab18555bb3c964fe70a8142539d64e13
@@ -35,5 +37,3 @@ SHA256 (jasenhuang-katana-parser-be6df45_GH0.tar.gz) = 363ede45ba6d125fdb7323c43
 SIZE (jasenhuang-katana-parser-be6df45_GH0.tar.gz) = 97712
 SHA256 (hunspell-hyphen-73dd296_GH0.tar.gz) = 93e80ad69ee7afd507b12f0b58ca34a6a78347dcbb5fe5d9b6f0e19b02397ef7
 SIZE (hunspell-hyphen-73dd296_GH0.tar.gz) = 292528
-SHA256 (fsbruva-onlyoffice-DS-npm-cache-v9.3.1.8-202603231741-prodmatch_GH0.tar.gz) = 9cd92a0e34fd5c1d5752a6ea7214fbd7eca08ca68dc6235b13cd9e5f5d6e93e8
-SIZE (fsbruva-onlyoffice-DS-npm-cache-v9.3.1.8-202603231741-prodmatch_GH0.tar.gz) = 126774789
diff --git a/www/onlyoffice-documentserver/files/npm b/www/onlyoffice-documentserver/files/npm
index 303b86ba9102..c2ab697743bc 100644
--- a/www/onlyoffice-documentserver/files/npm
+++ b/www/onlyoffice-documentserver/files/npm
@@ -1,3 +1,3 @@
 #!/bin/sh
-exec %%LOCALBASE%%/bin/npm --offline "$@"
+exec %%LOCALBASE%%/bin/npm --offline --no-fund --no-audit "$@"
 #exec %%LOCALBASE%%/bin/npm "$@"
diff --git a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py
index 8cd2beb29729..6bba2b42f322 100644
--- a/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py
+++ b/www/onlyoffice-documentserver/files/patch-build__tools_scripts_build__server.py
@@ -21,19 +21,19 @@
 -  base.cmd_in_dir(server_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=6144", "-o", "docservice"])
 -  base.cmd_in_dir(server_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"])
 -  base.cmd_in_dir(server_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"])
-+  base.cmd_in_dir(server_dir + "/DocService", pkgBin, [".", "-t", pkg_target, "--options", "max_old_space_size=6144", "-o", "docservice"])
-+  base.cmd_in_dir(server_dir + "/FileConverter", pkgBin, [".", "-t", pkg_target, "-o", "converter"])
-+  base.cmd_in_dir(server_dir + "/Metrics", pkgBin, [".", "-t", pkg_target, "-o", "metrics"])
++  base.cmd_in_dir(server_dir + "/DocService", pkgBin, [".", "-t", pkg_target, "--options", "max_old_space_size=6144", "-o", "docservice", "--fallback-to-source"])
++  base.cmd_in_dir(server_dir + "/FileConverter", pkgBin, [".", "-t", pkg_target, "-o", "converter", "--fallback-to-source"])
++  base.cmd_in_dir(server_dir + "/Metrics", pkgBin, [".", "-t", pkg_target, "-o", "metrics", "--fallback-to-source"])
    if "server-admin-panel" in base.get_server_addons() and base.is_exist(server_admin_panel_dir):
 -    base.cmd_in_dir(server_admin_panel_dir + "/server", "pkg", [".", "-t", pkg_target, "-o", "adminpanel"])
-+    base.cmd_in_dir(server_admin_panel_dir + "/server", pkgBin, [".", "-t", pkg_target, "-o", "adminpanel"])
++    base.cmd_in_dir(server_admin_panel_dir + "/server", pkgBin, [".", "-t", pkg_target, "-o", "adminpanel", "--fallback-to-source"])
  
    example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs"
 -  base.delete_dir(example_dir  + "/node_modules")
 +#  base.delete_dir(example_dir  + "/node_modules")
    base.cmd_in_dir(example_dir, "npm", ["ci"])
 -  base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"])
-+  base.cmd_in_dir(example_dir, pkgBin, [".", "-t", pkg_target, "-o", "example"])
++  base.cmd_in_dir(example_dir, pkgBin, [".", "-t", pkg_target, "-o", "example", "--fallback-to-source"])
  
  def build_server_with_addons():
    addons = {}
diff --git a/www/onlyoffice-documentserver/files/patch-server_Metrics_package.json b/www/onlyoffice-documentserver/files/patch-server_Metrics_package.json
new file mode 100644
index 000000000000..ef7e91561bea
--- /dev/null
+++ b/www/onlyoffice-documentserver/files/patch-server_Metrics_package.json
@@ -0,0 +1,10 @@
+--- server/Metrics/package.json.orig	2026-02-24 18:13:24 UTC
++++ server/Metrics/package.json
+@@ -5,6 +5,7 @@
+   "private": true,
+   "bin": "node_modules/statsd/bin/statsd",
+   "dependencies": {
++    "patch-package": "^8.0.0",
+     "statsd": "0.9.0"
+   },
+   "pkg": {
diff --git a/www/onlyoffice-documentserver/files/patch-server_Metrics_patches_statsd b/www/onlyoffice-documentserver/files/patch-server_Metrics_patches_statsd
new file mode 100644
index 000000000000..3b2c6e7a0f28
--- /dev/null
+++ b/www/onlyoffice-documentserver/files/patch-server_Metrics_patches_statsd
@@ -0,0 +1,64 @@
+--- server/Metrics/patches/statsd+0.9.0.patch.orig	2026-04-22 04:51:23 UTC
++++ server/Metrics/patches/statsd+0.9.0.patch
+@@ -0,0 +1,61 @@
++diff --git a/node_modules/statsd/lib/config.js b/node_modules/statsd/lib/config.js
++index 11ff71c..d36abae 100644
++--- a/node_modules/statsd/lib/config.js
+++++ b/node_modules/statsd/lib/config.js
++@@ -10,7 +10,7 @@ let Configurator = function (file) {
++   let oldConfig = {};
++ 
++   this.updateConfig = function () {
++-    util.log('[' + process.pid + '] reading config file: ' + file);
+++    console.log('[' + process.pid + '] reading config file: ' + file);
++ 
++     fs.readFile(file, function (err, data) {
++       if (err) { throw err; }
++diff --git a/node_modules/statsd/lib/logger.js b/node_modules/statsd/lib/logger.js
++index 8867f82..81e2108 100644
++--- a/node_modules/statsd/lib/logger.js
+++++ b/node_modules/statsd/lib/logger.js
++@@ -22,7 +22,7 @@ Logger.prototype = {
++       if (!type) {
++         type = 'DEBUG';
++       }
++-      this.util.log(type + ": " + msg);
+++      this.console.log(type + ": " + msg);
++     } else {
++       let level;
++       if (!type) {
++@@ -35,7 +35,7 @@ Logger.prototype = {
++         throw "Undefined log level: " + level;
++       }
++ 
++-      this.util.log(this.util[level], msg);
+++      this.console.log(this.util[level], msg);
++     }
++   }
++ };
++diff --git a/node_modules/statsd/lib/process_mgmt.js b/node_modules/statsd/lib/process_mgmt.js
++index a0dcf7b..bca534c 100644
++--- a/node_modules/statsd/lib/process_mgmt.js
+++++ b/node_modules/statsd/lib/process_mgmt.js
++@@ -8,7 +8,7 @@ exports.init = function(config) {
++ 
++   process.on('SIGTERM', function() {
++    if (conf.debug) {
++-     util.log('Starting Final Flush');
+++     console.log('Starting Final Flush');
++    }
++    healthStatus = 'down';
++    process.exit();
++diff --git a/node_modules/statsd/stats.js b/node_modules/statsd/stats.js
++index 75f5741..d8fae0c 100644
++--- a/node_modules/statsd/stats.js
+++++ b/node_modules/statsd/stats.js
++@@ -442,7 +442,7 @@ config.configFile(process.argv[2], function (config) {
++     );
++ 
++     serversLoaded = true;
++-    util.log("server is up", "INFO");
+++    console.log("server is up", "INFO");
++ 
++     pctThreshold = config.percentThreshold || 90;
++     if (!Array.isArray(pctThreshold)) {


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f1b7a2.38995.9960722>