Skip to content

Update SpiderMonkey to 153_0esr_RELEASE - #803

Merged
sagudev merged 13 commits into
servo:mainfrom
sagudev:153-off
Aug 29, 2026
Merged

sagudev merged 13 commits into
servo:mainfrom
sagudev:153-off

Conversation

@sagudev

@sagudev sagudev commented Aug 24, 2026 •

Copy link
Copy Markdown
Member

There are some changes in hazard packaging in TC so we repackage to older format to avoid more work.

SM now unconditionally depends on some rust code: vendored&patched icu crates and some glue crates that bridge icu through rust to C. Because recursive cargo invocation are no go we extract rust crates from tar and import them in our tree. This means we will publish all those mozilla and patched icu crates under mozjs- prefix. We also need to provide headers from cbindgen to SM, so we reuse same pattern as we used for zlib for this.

Then there are some boring changes like requiring newer clang, NDK.

We fixed and added some more patches and some glue. The most important parts are changes to JobQueue (for microtask changes) and some additional moduleloading code. For their use see corresponding commits in servo companion PR.

Reviewable per commits. During working on this I squashed many commits otherwise rebase would be hellish.

Testing: Covered by existing tests.
Servo PR: servo/servo#47489
Fixes #687

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev sagudev changed the title Update SpiderMonkey to ESR7153.0.0 Update SpiderMonkey to ESR 153.0.0 Aug 24, 2026
@sagudev sagudev changed the title Update SpiderMonkey to ESR 153.0.0 Update SpiderMonkey to 153_0esr_RELEASE Aug 24, 2026
@jschwe

jschwe commented Aug 24, 2026

Copy link
Copy Markdown
Member

Whats the reason for removing the Linux armv7 builds? Upstream dropped support?

@sagudev

sagudev commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Whats the reason for removing the Linux armv7 builds? Upstream dropped support?

No, we would just need to update cross images, but my rationale was that armv7 as an arch is covered by android and arm64-linux means that it will probably also work on linux. Ideally we should be able to run/compile it on arm64 runners anyway.

@atouchet

Copy link
Copy Markdown
Contributor

https://github.com/servo/mozjs/blob/main/README.md instructions are still for 140. Should that be updated to 153 as well?

@sagudev
sagudev requested a review from jdm August 25, 2026 04:52
Comment thread mozjs-extracted-crates/collator_glue/Cargo.toml
Comment thread mozjs-sys/etc/update.py Outdated
@jschwe

jschwe commented Aug 25, 2026

Copy link
Copy Markdown
Member

I think we might want to still do something about HOST_CC / HOST_CXX before this lands (could be in a seperate PR that we rebase on). My suggestion would be to not just check clang but also search for clang-XX so if a user on ubuntu has a newer (non-default) clang in PATH, then we choose that as the host compiler. Ubuntu 24.04 LTS still ships with clang-18 by default, so I think if we don't do anything it would be more breaking than it needs to be.
What do you think? I could probably make a PR.
I think the code should probably be in our build.rs so also embedders benefit from it (they are still free to override HOST_CC).

@sagudev

sagudev commented Aug 25, 2026

Copy link
Copy Markdown
Member Author

I think we might want to still do something about HOST_CC / HOST_CXX before this lands (could be in a seperate PR that we rebase on). My suggestion would be to not just check clang but also search for clang-XX so if a user on ubuntu has a newer (non-default) clang in PATH, then we choose that as the host compiler. Ubuntu 24.04 LTS still ships with clang-18 by default, so I think if we don't do anything it would be more breaking than it needs to be. What do you think? I could probably make a PR. I think the code should probably be in our build.rs so also embedders benefit from it (they are still free to override HOST_CC).

So you propose we populate HOST_CC with newer clang? I am not sure how I feel about this aditional logic. It would be ok if we could reuse something from cc-rs or bindgen, but I am not sure something version oriented like this exists there.

Anyway I consider those stuff non blocking as most user will use artifact anyway, meaning they will get away with older clang.

@sagudev
sagudev marked this pull request as draft August 25, 2026 09:47
@jdm

jdm commented Aug 27, 2026

Copy link
Copy Markdown
Member

I will have time tomorrow to review this.

@sagudev
sagudev marked this pull request as ready for review August 27, 2026 20:01
@sagudev

sagudev commented Aug 27, 2026 •

Copy link
Copy Markdown
Member Author

I published dummy version of mozjs extracted crates and invited jdm as co-owner and setup trusted publishing, so it should just work on land.

Comment thread mozjs-sys/Cargo.toml Outdated
Comment thread mozjs-extracted-crates/icu_collections/.cargo-checksum.json Outdated
Comment thread mozjs-extracted-crates/icu_collections/Cargo.toml.orig Outdated
Comment thread mozjs-extracted-crates/collator_glue/Cargo.toml Outdated
sagudev and others added 3 commits August 28, 2026 10:45
updated filters
extract patched icu crates as mozjs-extracted-crates
update patches

Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@jschwe

jschwe commented Aug 28, 2026

Copy link
Copy Markdown
Member

For some reason I can't see jsglue.cpp in the github diff, but in SavedQueue cx is added as a member, and I don't see it being initialized anywhere. (This was reported in an agent review with the claim that it causes ./mach test-devtools to segfault. I didn't check if it crashes, but I looked at the code, and definitly don't see cx being initialized anywhere, so seems legit)

@sagudev

sagudev commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

For some reason I can't see jsglue.cpp in the github diff, but in SavedQueue cx is added as a member, and I don't see it being initialized anywhere. (This was reported in an agent review with the claim that it causes ./mach test-devtools to segfault. I didn't check if it crashes, but I looked at the code, and definitly don't see cx being initialized anywhere, so seems legit)

We run devtools test CI and it doesn't crashes, but it sure looks wrong (C++ compilers are useless).

use extracted icu stuff and other glue fixes (mainly microtasks)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Comment thread mozjs-extracted-crates/icu_normalizer_data/Cargo.toml
@sagudev

sagudev commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

For some reason I can't see jsglue.cpp in the github diff, but in SavedQueue cx is added as a member, and I don't see it being initialized anywhere. (This was reported in an agent review with the claim that it causes ./mach test-devtools to segfault. I didn't check if it crashes, but I looked at the code, and definitly don't see cx being initialized anywhere, so seems legit)

We run devtools test CI and it doesn't crashes, but it sure looks wrong (C++ compilers are useless).

They did crash, but they work now so good catch.

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this PR look reasonable to me. I'm going to take a look at the servo one next.

Comment thread mozjs-sys/etc/patches/0032-macos-sdk-min.patch Outdated
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev
sagudev requested a review from jdm August 29, 2026 06:39
@sagudev
sagudev merged commit 29ba719 into servo:main Aug 29, 2026
45 checks passed
pull Bot pushed a commit to Haofei/servo that referenced this pull request Aug 29, 2026
Companion PR to servo/mozjs#803

So this has been in the baking for a month at
servo/mozjs#687.

As in mozjs we need to update clang, NDK.

The most interesting changes are microtask as jobqueue now lives in SM
which greatly simplifies our logic, but running the queue is somehow
harder. There is no need for enqueue promise job hook and we now have
special hook to define incubemnt global of task (we do things more
correctly now which brings two more passes).

The second big change is moduleloading which is now mainly implemented
in SM. Moduleloading commit was mainly written by @Gae24.

Reviewable per commit.

Testing: Covered by WPT.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Co-authored-by: Gae24 <96017547+Gae24@users.noreply.github.com>
sagudev added a commit that referenced this pull request Aug 29, 2026
We already run publish there. I did this in #803 for testing but when
squashing forgot to revert it.

Signed-off-by: Sam <16504129+sagudev@users.noreply.github.com>
@atouchet atouchet mentioned this pull request Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notes on ESR153

4 participants