git: 8975f39f3820 - main - databases/mongodb80: restore python 3.14 support

From: Ronald Klop <ronald_at_FreeBSD.org>
Date: Tue, 13 Oct 2026 07:30:01 UTC
The branch main has been updated by ronald:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8975f39f3820748f288f5bb39f2dd6ca903cfe9c

commit 8975f39f3820748f288f5bb39f2dd6ca903cfe9c
Author:     Ronald Klop <ronald@FreeBSD.org>
AuthorDate: 2026-10-13 07:25:33 +0000
Commit:     Ronald Klop <ronald@FreeBSD.org>
CommitDate: 2026-10-13 07:29:51 +0000

    databases/mongodb80: restore python 3.14 support
    
    This always regresses after a big update. Sorry Peter :-)
    
    Peter also added Bazel --batch mode. Explanation for batch mode
    is in a comment in the Makefile and in the PR.
    
    PR:     298510
---
 databases/mongodb80/Makefile                       |  9 ++-
 .../d497aa4f770ca02f6083e93b94996a8fe32c2ff4.patch | 78 ++++++++++++++++++++++
 2 files changed, 86 insertions(+), 1 deletion(-)

diff --git a/databases/mongodb80/Makefile b/databases/mongodb80/Makefile
index 2555640b203e..c5e175a2f91e 100644
--- a/databases/mongodb80/Makefile
+++ b/databases/mongodb80/Makefile
@@ -77,7 +77,13 @@ CONFIGURE_ENV+=		PYTHON3="${PYTHON_CMD}"
 BAZEL=			${LOCALBASE}/bin/bazel
 BAZEL_OUTPUT_USER_ROOT=	${WRKDIR}/bazel
 BAZEL_REPOSITORY_CACHE=${WRKDIR}/bazel-repository-cache
-BAZEL_STARTUP_ARGS=	--output_user_root=${BAZEL_OUTPUT_USER_ROOT}
+# --batch: run the build in the bazel JVM directly instead of through the
+# client/server pair. The client's "is the server's cwd still my workspace"
+# check (GetProcessCWD() in blaze_util_bsd.cc) returns an empty path instead
+# of nullptr when the kernel cannot resolve the cwd, e.g. inside a poudriere
+# jail, which makes the client kill and restart the server forever.
+BAZEL_STARTUP_ARGS=	--output_user_root=${BAZEL_OUTPUT_USER_ROOT} \
+			--batch
 BAZEL_ENV=		BAZEL_SH=${LOCALBASE}/bin/bash \
 			CC="${CC}" \
 			CXX="${CXX}" \
@@ -185,6 +191,7 @@ MOZJS_ARCH=	${ARCH}
 post-extract:
 # Verify we downloaded the proper mozjs git tag.
 	${SH} -xc "test \"X`grep -E '^LIB_GIT_REVISION=' ${MOZJS_WRKSRC}/scripts/import.sh`\" = \"XLIB_GIT_REVISION=${MOZJS_TAG}\""
+	${PATCH} -d ${WRKDIR}/spidermonkey-${MOZJS_TAG} -p1 < ${PATCHDIR}/d497aa4f770ca02f6083e93b94996a8fe32c2ff4.patch
 
 pre-configure:
 # Replacement of ${WRKSRC}/src/third_party/mozjs/scripts/import.sh
diff --git a/databases/mongodb80/files/d497aa4f770ca02f6083e93b94996a8fe32c2ff4.patch b/databases/mongodb80/files/d497aa4f770ca02f6083e93b94996a8fe32c2ff4.patch
new file mode 100644
index 000000000000..fe8115a55227
--- /dev/null
+++ b/databases/mongodb80/files/d497aa4f770ca02f6083e93b94996a8fe32c2ff4.patch
@@ -0,0 +1,78 @@
+!!! This patch is a modified version of the phabricator mention !!!
+!!! You can diff them to see the difference !!!
+!!! Rebased on mozjs tag 7aeaf7a44d420360bde75db8453636092c3e2f56 (mongodb 8.0.29+) !!!
+
+From d497aa4f770ca02f6083e93b94996a8fe32c2ff4 Mon Sep 17 00:00:00 2001
+From: Mike Hommey <mh+mozilla@glandium.org>
+Date: Tue, 19 Aug 2025 05:09:09 +0000
+Subject: [PATCH] Bug 1969769 - Change uses of ast.Str with ast.Constant.
+ r=firefox-build-system-reviewers,ahochheiden
+
+ast.Str was deprecated in python 3.12 and removed in 3.14. It inherited
+from ast.Constant, `Str.s` was equivalent to `Constant.value`, so we can
+use the latter on both old and newer python versions.
+
+Differential Revision: https://phabricator.services.mozilla.com/D261512
+---
+ python/mozbuild/mozbuild/frontend/reader.py        | 14 +++++++-------
+ .../mozbuild/mozbuild/vendor/rewrite_mozbuild.py   |  6 ++----
+ 2 files changed, 9 insertions(+), 11 deletions(-)
+
+--- a/python/mozbuild/mozbuild/frontend/reader.py
++++ b/python/mozbuild/mozbuild/frontend/reader.py
+@@ -470,7 +470,7 @@
+             return c(
+                 ast.Subscript(
+                     value=c(ast.Name(id=self._global_name, ctx=ast.Load())),
+-                    slice=c(ast.Index(value=c(ast.Str(s=node.id)))),
++                    slice=c(ast.Index(value=c(ast.Constant(value=node.id)))),
+                     ctx=node.ctx,
+                 )
+             )
+@@ -1039,8 +1039,8 @@
+                 else:
+                     # Others
+                     assert isinstance(target.slice, ast.Index)
+-                    assert isinstance(target.slice.value, ast.Str)
+-                    key = target.slice.value.s
++                    assert isinstance(target.slice.value, ast.Constant)
++                    key = target.slice.value.value
+             elif isinstance(target, ast.Attribute):
+                 assert isinstance(target.attr, str)
+                 key = target.attr
+@@ -1051,11 +1051,11 @@
+             value = node.value
+             if isinstance(value, ast.List):
+                 for v in value.elts:
+-                    assert isinstance(v, ast.Str)
+-                    yield v.s
++                    assert isinstance(v, ast.Constant)
++                    yield v.value
+             else:
+-                assert isinstance(value, ast.Str)
+-                yield value.s
++                assert isinstance(value, ast.Constant)
++                yield value.value
+ 
+         assignments = []
+ 
+--- a/python/mozbuild/mozbuild/vendor/rewrite_mozbuild.py
++++ b/python/mozbuild/mozbuild/vendor/rewrite_mozbuild.py
+@@ -327,15 +327,13 @@
+     """
+     if isinstance(node.value, ast.List) and "elts" in node.value._fields:
+         for f in node.value.elts:
+-            if not isinstance(f, ast.Constant) and not isinstance(f, ast.Str):
++            if not isinstance(f, ast.Constant):
+                 log(
+                     "Found non-constant source file name in list: ",
+                     ast_get_source_segment(code, f),
+                 )
+                 return []
+-        return [
+-            f.value if isinstance(f, ast.Constant) else f.s for f in node.value.elts
+-        ]
++        return [f.value for f in node.value.elts]
+     elif isinstance(node.value, ast.ListComp):
+         # SOURCES += [f for f in foo if blah]
+         log("Could not find the files for " + ast_get_source_segment(code, node.value))