Hi! We'd love to have your contributions! If you want help or mentorship, reach
out to us in a GitHub issue, or ping fitzgen
in
#starling on irc.mozilla.org and introduce yourself.
We abide by the Rust Code of Conduct and ask that you do as well.
To build Starling, you need autoconf
2.13 and libclang
at least 3.9. You
should set the LIBCLANG_PATH
environment variable to the directory containing
libclang.so
.
For example, in Ubuntu 16.04:
$ sudo apt-get install autoconf2.13 clang-4.0
$ sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 100
$ sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 100
$ LIBCLANG_PATH=/usr/lib/llvm-4.0/lib cargo build
The LIBCLANG_PATH
environment variable is only needed by codegen when
compiling mozjs
. Once it is built, you can use the usual cargo commands such
as cargo +nightly test
.
To run all the tests:
$ cargo test
Ensure that each commit stands alone, and passes tests. This enables better git bisect
ing when needed. If your commits do not stand on their own, then rebase
them on top of the latest master and squash them into a single commit.
All pull requests undergo code review before merging. To request review, use GitHub's pull request review functionality.
Unsure who to ask for review? Ask any of:
@fitzgen
@tschneidereit
We use rustfmt
to enforce a
consistent code style across the whole code base.
You can install the latest version of rustfmt
with this command:
$ rustup update nightly
$ cargo +nightly install -f rustfmt-nightly
Ensure that ~/.cargo/bin
is on your path.
Once that is taken care of, you can (re)format all code by running this command:
$ cargo +nightly fmt