diff --git a/libraries/source/spidermonkey/build.sh b/libraries/source/spidermonkey/build.sh index 7c71a7bc90..396e5e5b3e 100755 --- a/libraries/source/spidermonkey/build.sh +++ b/libraries/source/spidermonkey/build.sh @@ -9,7 +9,7 @@ cd "$(dirname "$0")" PV=128.13.0 FOLDER="mozjs-${PV}" # If same-version changes are needed, increment this. -LIB_VERSION="${PV}+wfg2" +LIB_VERSION="${PV}+wfg3" LIB_NAME="mozjs128" build_archive() diff --git a/libraries/source/spidermonkey/patches/FixPython3_14.diff b/libraries/source/spidermonkey/patches/FixPython3_14.diff new file mode 100644 index 0000000000..fa3d3544bb --- /dev/null +++ b/libraries/source/spidermonkey/patches/FixPython3_14.diff @@ -0,0 +1,45 @@ +From b1c04fc534205e978d2efa0be391d4f39bbd22de Mon Sep 17 00:00:00 2001 +From: Ralph Sennhauser +Date: Fri, 10 Oct 2025 20:04:48 +0200 +Subject: [PATCH] Fixes for python 3.14 + +Upstream fixes are incomplete but can be found at +https://bugzilla.mozilla.org/show_bug.cgi?id=1983713 + +Add addional fixes for reader.py + +Signed-off-by: Ralph Sennhauser +--- + python/mach/mach/command_util.py | 2 +- + python/mozbuild/mozbuild/frontend/reader.py | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/python/mach/mach/command_util.py b/python/mach/mach/command_util.py +index a8a7cb9018a1..a4fdd63ca947 100644 +--- a/python/mach/mach/command_util.py ++++ b/python/mach/mach/command_util.py +@@ -289,7 +289,7 @@ class DecoratorVisitor(ast.NodeVisitor): + kwarg_dict = {} + + for name, arg in zip(["command", "subcommand"], decorator.args): +- kwarg_dict[name] = arg.s ++ kwarg_dict[name] = arg.value + + for keyword in decorator.keywords: + if keyword.arg not in relevant_kwargs: +diff --git a/python/mozbuild/mozbuild/frontend/reader.py b/python/mozbuild/mozbuild/frontend/reader.py +index 5cb627b0ed7f..7ef5988d259c 100644 +--- a/python/mozbuild/mozbuild/frontend/reader.py ++++ b/python/mozbuild/mozbuild/frontend/reader.py +@@ -470,7 +470,7 @@ class TemplateFunction(object): + 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, + ) + ) +-- +2.49.1 + diff --git a/libraries/source/spidermonkey/patches/patch.sh b/libraries/source/spidermonkey/patches/patch.sh index 201a8a800a..04bbe2bf4e 100755 --- a/libraries/source/spidermonkey/patches/patch.sh +++ b/libraries/source/spidermonkey/patches/patch.sh @@ -44,3 +44,6 @@ fi # Supress warning on newer GCC compilers. # https://bugzilla.mozilla.org/show_bug.cgi?id=1953622 patch -p1 <"${PATCHES}"/SuppressDanglingPointerWarning.patch + +# Fix building with python 3.14 +patch -p1 <"${PATCHES}"/FixPython3_14.diff