GNOME 47 to depend on SpiderMonkey 128

This is a notice that GJS 1.81.90, scheduled to be included in GNOME 47.rc, will depend on SpiderMonkey 128 (corresponding with Firefox’s extended support release, ESR128). This will not be ready for GNOME 47.beta because we will need to wait for Firefox 128.1 to be released (see below).

Mozilla has not worked out an automatic release process for SpiderMonkey tarballs yet. The official recommendation is to use the Firefox ESR128 source tarball. More information can be found here, at Building SpiderMonkey (note the pending updates for ESR128 as well).

The 128.0 release of SpiderMonkey had several bugs in it that make it unsuitable for use with GNOME. We expect that 128.1, to be released 2024-08-06, should be fine to use without any patches. However, if you are building GJS standalone on macOS, you will need a patch to be able to use pkg-config correctly. For reference, you will be able to find the set of patches that I build with in Commits · ptomato/mozjs · GitHub) after 128.1 is released.

This is the recommended set of configure options with which to build SpiderMonkey 128:

  • --disable-jemalloc: This one is strictly required, as the jemalloc allocator is incompatible with standalone SpiderMonkey.
  • --with-intl-api: This one is also strictly required, as core functionality of GJS will not work without it.
  • --with-system-zlib: This one is strongly recommended. Without it, you’ll build SpiderMonkey’s internal copy of zlib, which shouldn’t be necessary as most if not all systems include a suitable shared library.
  • --with-system-icu: This one is recommended, but at least ICU 73.1 is required. If that’s not possible on your platform, then you can use --without-system-icu to build SpiderMonkey’s internal copy instead.
  • --host: This is set to the host triplet name. I’m not entirely sure if this is strictly necessary.
  • AUTOCONF: If you make downstream changes to SpiderMonkey’s configure scripts, you will need to have a build-dependency on autoconf 2.13 (any more recent version will not work) to regenerate them. You may need to set the AUTOCONF variable on the configure command line, since different systems have different program-suffixes for autoconf 2.13. If you didn’t make changes but the build is checking for autoconf 2.13 anyway, you can bypass this check by configuring with AUTOCONF=autoconf.

You may also want to consider --enable-debug: Never, ever ship a libmozjs with this option in production, as the performance is severely degraded. However, if your platform allows for such a thing, then you might consider shipping a separate debug-enabled package that conflicts with the main package, since the debug option makes it significantly easier to develop with SpiderMonkey and diagnose crashes that might happen on user machines. (A complication is that SpiderMonkey’s ABI is different between debug and non-debug, so a separate GJS package would also be required. GJS’s ABI is the same in both cases.)

For reference, here is how SpiderMonkey 115 is configured in the GNOME SDK. SpiderMonkey 128 will likely be identical: elements/sdk/mozjs.bst · master · GNOME / gnome-build-meta · GitLab

If you run into build problems with SpiderMonkey on your platform, please open a bug on bugzilla.mozilla.org and CC me. If you can provide a patch that would be great. Mozilla has a review and backport process that’s a bit mystifying for outsiders, and I can help move your patches through it.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.