Closed Bug 1694318 Opened 3 months ago Closed 3 months ago

Remove the mozjs_sys and js crates

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(3 files)

cmake is used to build exactly one source file, which could just as well be done with the cc crate instead.

Fun facts:

At this point, I'm wondering if we shouldn't remove the crate, and the corresponding build tasks.

Flags: needinfo?(jdemooij)

Hey Josh, how do you feel about comment 1?

It sounds like upstream Servo has diverged from the code in mozilla-central and this crate is making things difficult for glandium, so if Servo isn't using it anyway it's worth reconsidering.

Flags: needinfo?(josh)
Blocks: 1694785

Filed https://github.com/servo/mozjs/issues/270 after some more investigation.

Yep, Servo doesn't use the crate in mozilla-central. You're free to remove it.

Flags: needinfo?(josh)

Thanks Josh.

Summary: Avoid dependency on cmake in the js crate → Remove the mozjs_sys and js crates

The sm-rust-bindings task that builds and runs tests for it actually only
doesn't fail by three(!) distinct happenstances of chance:

  • It somehow doesn't hit a race condition that can happen, but that
    attempting to change the build process for jsglue.cpp did,
  • The second call to cargo test without --feature debugmozjs only
    works because nothing was cleaned up from the first and the second
    build uses artifacts from the first that are otherwise not there if
    only running the second.
  • The addition of rust code to spidermonkey (the jsrust crate in
    js/src/rust) somehow didsn't cause problems in the current
    configuration, but in other configurations (which fixing the second
    thing above unveils) the build fails because of the multiple
    definition of rust_eh_personality between the jsrust staticlib and the
    rust stdlib that rustc links to test programs.

On top of all the above, the content of the crate in mozilla-central
has not received updates from upstream servo in years, and doesn't
reflect what servo actually uses.

The mozjs_sys crate is actually responsible for all the problems
encountered with the js crate we just removed, but the sm-mozjs-crate
task that builds and runs tests for it doesn't fail because... there is
actually no test to build and run, so all it builds is a static library,
which doesn't expose all the problems that exist.

The content of this crate in mozilla-central is also outdated compared
to servo upstream.

The task that was using it was removed. While here, we remove the now
unused cmake backport for Debian jessie.

Attachment #9205303 - Attachment description: Bug 1694318 - Remove the mozjs_sys rust crate. → Bug 1694318 - Remove the mozjs_sys rust crate. r?jandem
Attachment #9205303 - Attachment description: Bug 1694318 - Remove the mozjs_sys rust crate. r?jandem → Bug 1694318 - Remove the mozjs_sys rust crate.
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/6ceacb906b5e
Remove the js rust crate. r=jandem,sheehan
https://hg.mozilla.org/integration/autoland/rev/4d19c36b6b32
Remove the mozjs_sys rust crate. r=jandem
https://hg.mozilla.org/integration/autoland/rev/3d54ca5931f0
Remove the debian8-mozjs-rust-build docker image. r=firefox-build-system-reviewers,andi,mhentges
Flags: needinfo?(jdemooij)
You need to log in before you can comment on or make changes to this bug.