17 unstable releases (4 breaking)
|0.61.6||Dec 29, 2018|
|0.61.5||Nov 30, 2018|
|0.61.2||Oct 23, 2018|
|0.51.4||Jul 7, 2018|
|0.1.0||Nov 30, 2015|
#13 in Video
2,220 downloads per month
Used in 2 crates (1 directly)
The bindings are to the raw SpiderMonkey API, higher-level bindings are in the rust-mozjs repository.
Install Clang (at least version 3.9), for example in a Debian-based Linux:
sudo apt-get install clang-6.0
If you have more than one version of Clang installed, you can set the
environment variable, for example:
Open up a shell configured to use Visual Studio. This could be the one included with Visual Studio (e.g. Visual Studio 2017 / X64 Native Tools Command Prompt for VS 2017) or a shell in which you have run
"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
- Set the
MOZTOOLS_PATHenvironment variable to point to the tools from the Mozilla Build Package:
- Download and install Clang for Windows (64 bit) from https://releases.llvm.org/download.html
and set the
LIBCLANG_PATHenvironment variable to its
set LIBCLANG_PATH=C:\Program Files\LLVM\lib
- Set environment variables so the build script can find Python 2.7 and Autoconf 2.13:
set AUTOCONF=C:\mozilla-build\msys\local\bin\autoconf-2.13 set NATIVE_WIN32_PYTHON=C:\mozilla-build\python\python2.7.exe
You can now build and test the crate using cargo:
cargo build cargo test cargo build --features debugmozjs cargo test --features debugmozjs
In order to upgrade to a new version of SpiderMonkey:
Find the mozilla-release commit for the desired version of SpiderMonkey, at https://treeherder.mozilla.org/#/jobs?repo=mozilla-release&filter-searchStr=spidermonkey%20pkg. You are looking for an SM(pkg) tagged with FIREFOX_RELEASE. Take a note of the commit number to the left (a hex number such as ac4fbb7aaca0).
Click on the SM(pkg) link, which will open a panel with details of the commit, including an artefact uploaded link, with a name of the form mozjs-version.tar.bz2. Download it and save it locally.
Look at the patches in
etc/patches/*.patch, and remove any that no longer apply (with a bit of luck this will be all of them).
python3 ./etc/update.py path/to/tarball.
etc/COMMITwith the commit number.
Build and test the bindings as above, then submit a PR!