Skip to content

Doc getting started

marijnh edited this page Jan 16, 2012 · 6 revisions

Prerequisites

Version numbers listed here are "what we're using"; the code may well work with earlier versions of these tools, but we don't know minimum version requirements.

  • A recent Linux, OS X or Win32 system
  • Python 3.1 (versions as old as Python 2.6.2 have also been used successfully)
  • GNU make 3.81
  • git 1.7
  • g++ 4.4 at least on linux, 4.5 on win32, and the 4.x gcc in Apple's SDK for OS X.
  • curl
  • Valgrind 3.5 (recommended, but not required for Linux)
  • Texinfo's makeinfo and/or texi2pdf commands (optional), if you wish to build HTML or PDF docs, respectively
  • Naturaldocs (optional), if you wish to build the standard library documentation

Debian-based Linux distributions

You can install all the prerequisites you need to build Rust by running

sudo apt-get install python3 make git g++ curl valgrind texinfo naturaldocs

Windows

We recommend developing under the newest MSYS and MinGW using their auto-installer (the version dated 20110802 is known to work), and performing the build in the MSYS Shell.

For Git, we recommend MsysGit and if you use that you will want to put the git binary path after the MinGW path. So add a line like the following to your .bashrc:

export PATH=$PATH:/c/Program\ Files/Git/bin

If while building you receive an error that libpthread-2.dll is not found, you need to install the libpthread-2.8.0-3-mingw32-dll-2.tar.lzma package. It seems this must be installed by hand, as far as I can tell:

cd /mingw; lzma -d -c /path/to/downloaded/libpthread-2.8.0-3-mingw32-dll-2.tar.lzma | tar xf -

Downloading and building Rust

git clone git://github.com/mozilla/rust.git
cd rust
mkdir build
cd build
../configure
make check

This will build and test the compiler and standard library.

Note: On Linux or OS X, if you have Valgrind installed, the tests will run slowly because they are running under Valgrind. If you define CFG_DISABLE_VALGRIND=1 in your build environment or run configure with the --disable-valgrind flag, you can see the tests running at full speed.

If you are going to be hacking on the Rust compiler itself then it is recommended that you configure with --disable-optimize, since this will greatly speed up your compilation.

Navigating

There's a quick guide to the source of the compiler in src/comp/README. You should probably look through it if you're going to be contributing.

Editor support

Syntax highlighting for vim is included in the Rust repository, under src/etc/vim. There is also a rust-mode for emacs and a BBEdit plugin.

The issue tracker

We use the GitHub issue tracker to track bugs and feature requests in Rust. If you prefer not to use the standard GitHub issue tracker, there's a secondary front-end that is quite a bit more responsive and a tertiary front-end that is pleasantly minimal.

Picking something interesting to do

To get an idea of where we're going, see the Note development roadmap.

The way most people seem to get involved is by simply trying to write Rust code. Inevitably you will hit a bug or missing feature, at which point you may feel compelled to write a patch.

Another way to get involved is to look through the issue tracker for these issues:

Outstanding bugs or feature requests in Rust often have a corresponding test in the test suite that doesn't yet pass. One good way to jump into Rust development is to look for files in the test/run-pass directory containing the string 'xfail-test'. Those are all bugs that need to be fixed or features that someone needs to finish.

The source is also littered with hundreds of comments marked with 'FIXME' and 'TODO'. Often these refer to issues that have already been resolved or which may be resolved easily, though sometimes their purpose is rather more obscure. It can occasionally be profitable to grep through the source trying to trim these down.

If in doubt, ask on IRC. Somebody will surely have a task that needs doing.

Communicating

Join irc.mozilla.org #rust for real-time discussion of Rust development. We try to remain on that channel during working hours in UTC-7 (US Pacific).

Join the mailing list for longer conversations.

In both cases, please follow the conduct guidelines on the development policy in Note development policy.

All Categories:

Clone this wiki locally