Skip to content
brson edited this page May 14, 2011 · 90 revisions

Prerequisites

Version numbers listed here are “what we’re using”; the code may well work with earlier versions of these tools, we do not know minimum version requirements.

  • A recent linux, OSX or win32 system.
  • Python 3.1 (download link)
  • 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 OSX.
  • curl
  • Valgrind 3.5 (recommended but not required for linux)
  • Texinfo’s makeinfo and/or texi2pdf commands, if you wish to build HTML or PDF docs, respectively
  • LLVM SVN, built for x86 (not x64 if you have one!).

Rust regularly incorporates new features and fixes from LLVM so it’s best to just assume that the very latest LLVM SVN revision is required.

Debian-based Linux distributions

sudo apt-get install ocaml ocaml-native-compilers curl

64-bit systems: sudo apt-get install g++-multilib ia32-libs.

Windows

We recommend developing under the newest MinGW packages using their auto-installer.

Installing LLVM

You’ll need LLVM if you want anything other than the x86 backend of the bootstrap compiler. Because Rust doesn’t support x64 yet you may need to configure LLVM using some special flags. On the Mac, use:

$ CXX='g++ -m32' CC='gcc -m32' CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 ./configure --disable-bindings --{build,host,target}=i686-apple-darwin --enable-targets=x86,x86_64,cbe --enable-optimized
$ make
$ make install

On 64-bit Linux, use:

$ CXX='g++ -m32' CC='gcc -m32' CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 ./configure --disable-bindings --{build,host,target}=i686-unknown-linux-gnu --enable-targets=x86,x86_64,cbe --enable-optimized
$ make
$ make install

On 32-bit Linux ./configure --enable-optimized; make; make install should be sufficient. If you omit the --enable-optimized flag, it’ll work, but more slowly.

Downloading and building


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

This will build and test the bootstrap 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.

Notes specific to Mac OS X 10.5

Getting rust to build on OS X 10.5 requires some tweaking:

  • Assuming you’re using a gcc that came with Xcode 3.1, make sure it is gcc 4.2 rather than 4.0.1. Xcode should come with both, although 4.0.1 is the default. (See, for instance, how to set gcc 4.2 as the default compiler on OS X Leopard).
  • In addition to the LD_LIBRARY_PATH environment variable, which should be set to something like $HOME/rust/src:/usr/local/lib, you’ll need to export the DYLD_LIBRARY_PATH environment variable with the same value as LD_LIBRARY_PATH. Use something like export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH.
  • Remove (or comment out) the DSYMUTIL := dsymutil line of rust/src/Makefile.

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.

Dealing with the issue tracker

The github issue tracker is somewhat weak. However, it exposes itself through an API and 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

We’ve recently transitioned off of the bootstrap compiler and are moving full steam ahead with the self-hosted compiler. To get an idea of where we’re going see the Roadmap.

Many of the features of the bootstrap compiler that were not needed for self-hosting have not yet been implemented in the new compiler. As such, the test suite is full of tests that don’t yet pass, and this is a good way to jump into Rust development. Just look for files in the test/run-pass directory containing the string ‘xfail-stage1’. Those are all missing features that someone needs to finish.

Another way to get involved is to look through the issue tracker for bugs marked with the ‘easy’ tag.

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

Communicating

Join irc.mozilla.org #rust if you want to discuss anything more “interactively”, we try to remain on that channel during working hours in UTC-7 (US Pacific).

Join the mailing list if you want to have longer conversations.

In both cases, please follow the conduct guidelines on the Development policy page.

Clone this wiki locally