-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Updating the Rust compiler used by Servo
The Rust compiler is prebuilt for Servo, targeting our main host platforms (OSX and Linux), each targeting both the native host platform and Android.
To create a new cached Rust compiler:
-
Fetch the latest upstream changes
git fetch upstream
-
Create a branch with the hash of the Rust commit you are interested in:
git checkout 0935beba717bf6d3b54ad1b2eace359dea5dfca0
-
Build with cross-compilation enabled. Linux:
./configure --target=arm-linux-androideabi --android-cross-path=/home/larsberg/ndk-standalone && make clean ; make -j4 rustc-stage2 && make dist
OSX:
./configure --target=arm-linux-androideabi --android-cross-path=/Users/larsberg/ndk-standalone/ && make clean ; make -j4 rustc-stage2 && make dist
- Upload the binary produced to the s3 bucket:
s3cmd put dist/rust-* s3://servo-rust/b3a732a3eab60862068b1006973de5924bcda9e2/
Once a build has been uploaded, the SHA of the head commit from our Rust fork needs to be entered into the file src/compiler/rust-snapshot-hash/. A subsequent run of the configure script will pull down the new compiler from our S3 bucket and use that instead of the old one.
Servo's submodules fall into two categories:
-
Libraries maintained by the servo team. For these projects, the main development "trunk" is the
master
branch in theservo/<project>
repo, and this is also the branch used in Servo builds. -
Libraries with a separate upstream maintainer. For these projects, the Servo team maintains a fork at
servo/<project>
with aservo
branch. This is the branch used in Servo builds, and it may also contain Servo-specific changes (e.g. changes that are not yet accepted upstream, or that are not useful outside of the Servo build system). Theservo
fork should not contain amaster
branch, since that branch is not used by the Servo team and could cause confusion if it is out of sync with theservo
branch or the upstreammaster
branch.
When upgrading Servo to a new version of Rust, use the following steps to update each submodule:
-
Merge any changes from the upstream repo (if there is one) into the
servo
repo'sservo
branch—except for changes that require a newer version of Rust than the one Servo is upgrading to. -
For each submodule that needs further patches to work with the new Rust version, create a new branch named
rustup_<date>
in theservo
fork of the submodule. For example,rustup_20140508
. -
Push any required changes to the
rustup_*
branch. When ready, submit a pull request to the upstream repo for any changes that apply to upstream (if there is one). Then submit a pull request to theservo
repo to merge the same changes, plus any Servo-specific changes. (If there is no separate upstream, just submit a single pull request to themaster
branch in theservo
repo.) -
After the changes are reviewed and merged, update the Rust upgrade branch in the
servo
repo to point to the new head of theservo
ormaster
branch in theservo/<project>
repo.