GithubHelp home page GithubHelp logo

doc22940 / mozjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from servo/mozjs

0.0 1.0 0.0 139.19 MB

Servo's SpiderMonkey fork

Rust 0.32% C++ 36.22% JavaScript 52.03% Makefile 0.62% HTML 0.50% C 4.17% Shell 0.53% Python 4.44% Perl 0.08% Assembly 0.38% TeX 0.22% Gnuplot 0.01% Batchfile 0.01% CSS 0.01% WebIDL 0.01% Objective-C 0.03% M4 0.25% Roff 0.20% sed 0.01% CMake 0.01%

mozjs's Introduction

This repository contains Rust bindings for SpiderMonkey for use with Servo.

The bindings are to the raw SpiderMonkey API, higher-level bindings are in the rust-mozjs repository.

Building

Under Linux:

Install Clang (at least version 3.9) and autoconf v 2.13, for example in a Debian-based Linux:

sudo apt-get install clang-6.0 autoconf2.13

If you have more than one version of Clang installed, you can set the LIBCLANG_PATH environment variable, for example:

export LIBCLANG_PATH=/usr/lib/clang/4.0/lib

Under Windows:

  1. Follow the directions at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites

  2. 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"
  1. Set the MOZTOOLS_PATH environment variable to point to the tools from the Mozilla Build Package:
set MOZTOOLS_PATH=C:\mozilla-build\msys\bin;C:\mozilla-build\bin
  1. Download and install Clang for Windows (64 bit) from https://releases.llvm.org/download.html and set the LIBCLANG_PATH environment variable to its lib directory:
set LIBCLANG_PATH=C:\Program Files\LLVM\lib
  1. 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

Upgrading

In order to upgrade to a new version of SpiderMonkey:

  1. 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).

  2. 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.

  3. 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).

  4. Run python3 ./etc/update.py path/to/tarball.

  5. Update etc/COMMIT with the commit number.

  6. Build and test the bindings as above, then submit a PR!

mozjs's People

Contributors

jdm avatar nox avatar ms2ger avatar vvuk avatar michaelwu avatar metajack avatar larsbergstrom avatar simonsapin avatar brson avatar fitzgen avatar eijebong avatar emilio avatar mmatyas avatar mbrubeck avatar kmcallister avatar pcwalton avatar cybai avatar akosthekiss avatar saschanaz avatar tetsuharuohzeki avatar glennw avatar nnethercote avatar nikhilm avatar tworec avatar garbas avatar sethfowler avatar mcduke avatar asbaker avatar vmx avatar jhwgh1968 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.