Upgrading embedding from 128ESR to 140ESR. Any major changes?

Hi all,

I target the ESR versions of Spidermonkey to use in our embedding and hope to get some time over the next month to update our embedding from 128ESR to 140ESR now that 140ESR has been released.
Are there any significant features that have changed or any breaking API changes that I should be aware of? Any big changes in toolchain required to compile (e.g. minimum version of Rust etc)?

I grabbed an alpha version of 140 a while ago and tried to compile it on Windows. The only (trivial) niggle I found was that the order of arguments in JS::DescribeScriptedCaller had swapped around so I don’t think that there is anything major.
I didn’t actually try running any tests though. All I tested was compiling and linking Spidermonkey to my application so I could easily be missing something.

If anybody has any information or can point me towards some documentation I would be very grateful. Also, as ever, I’m incredibly grateful that you make this available for me to embed in the first place. Many thanks… :slight_smile:

Thanks in advance

Miles

1 Like

We’ve added some of the JSAPI changes in ESR140 to this GitHub issue:

Probably incomplete but it’s a start :slight_smile:

That’s great. I’ll take a look.
Many thanks

We also have some initial findings at SpiderMonkey 140 (#690) · Issues · GNOME / gjs · GitLab

I also had the issue with the BaseProfilingCatagory.h header as reported in
https://bugzilla.mozilla.org/show_bug.cgi?id=1973993
and fixed it in the same way.

Just to make you aware of another (potential) issue.
I downloaded the firefox source tarball from Directory Listing: /pub/firefox/releases/140.0esr/source/
and I extract the mozjs source package from that by doing
python3 make-source-package.py
in the js/src directory (so I can save it as a record of what I used).

I found that when I tried running tests with mach jit_test, mach jstests etc they did not work, because the file testing/clean_skipfails.py was missing. I manually added it back in from firefox src.

Huh, I didn’t see how that was possible, since there is an automated test that creates the package, then unpacks + builds + tests it. But it turns out that it tests by cd’ing into the objdir and running make check-jit-test, which works.

Ugh. I need to dismantle more of autospider.py.

It was easy to workaround so if it’s a pain to fix feel free to ignore it. I just thought I should let you know, just in case…

Incidentally, to build, test and install I normally do the following steps:

  1. Make a mozconfig file and set MOZCONFIG to path
  2. mach build
  3. mach jsapi-tests
  4. mach jit-test
  5. mach jstests
  6. cd js/src/releaseobj && make install (releaseobj set with ‘mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/js/src/releaseobj’ in mozconfig)

You mentioned using make check-jit-test. If (I’m being stupid and) I should be doing something else other than the steps above, then please say…
I don’t mind admitting if I’m being stupid, if I can find out what I should be doing… :wink:

No, your steps are good. Mine were stupid. I have a patch series in 1973993 - Build, test failures using standalone SpiderMonkey installation that should fix the problems mentioned here and test running with mach so it won’t break again. I sadly still do not have a test in CI that runs make install and does anything with the results, though.