gecko-dev/README.webrender
Kartikaya Gupta 9ba37c3847 Bug 1329574 - Downgrade core-graphics from 0.4.3 to 0.4.1. r=gfx?
MozReview-Commit-ID: 5bNkGbkaqwD
2017-01-13 09:54:38 -05:00

63 lines
3.2 KiB
Plaintext

Step 1: Install Rust if you don't have it already
If you are doing gecko builds already, you should already have Rust as it is a build requirement.
If not, you can install it using |mach bootstrap| (recommended) or from https://www.rust-lang.org/
Note: If installing manually, use the stable 64-bit release - on Windows make sure to use the MSVC ABI installer.
Ensure that rustc and cargo are in your $PATH (adding $HOME/.cargo/bin/ should be sufficient)
Step 2: Set up mozconfig
Add the following line to your mozconfig:
ac_add_options --enable-webrender
The first time you do a build with this changes, you should also run |mach clobber|
Step 3:
Build using |mach build|
When making changes:
- Make the changes you want.
- Run |mach build| or |mach build binaries| as desired.
For a debug webrender build:
Use a debug mozconfig (ac_add_options --enable-debug)
You can also use an opt build but make webrender less optimized by putting opt-level=0 in the [profile.release] section of your toolkit/library/rust/Cargo.toml file
See also https://groups.google.com/forum/#!topic/mozilla.dev.servo/MbeMcqqO1fs
What if you have to make changes to webrender itself?
1) Update your graphics branch checkout to the latest code on the
graphics branch
2) Check out and update the webrender repo to the version you want
3) Copy over the webrender and webrender_traits folders into gfx/. The best way
to do this is to simply delete the gfx/webrender and gfx/webrender_traits
folders and use |cp -R| to copy them in again from the webrender repo. Update
the "latest commit" information at the bottom of this file with the version.
4) If you need to modify webrender_bindings/Cargo.toml to include or remove
features, do so now.
4) Commit your changes to the graphics branch locally
5) Go into toolkit/library/rust and run |cargo update --aggressive -p webrender|.
Do the same in toolkit/library/gtest/rust. This will update the corresponding
Cargo.lock files with the latest webrender dependencies.
Note that this will update all webrender dependencies to their latest allowed
versions. In particular, the latest allowed minor version will be used (this
in theory should always be safe, but may not be so). If you need to force a
particular dependency to a particular version, you can run |cargo update -p
<package> --precise <version>|. Make sure to do this in both toolkit/library/
rust/ and toolkit/library/gtest/rust/.
6) Run |mach vendor rust| to update the rust dependencies in third_party/rust
7) Commit the vendored changes locally
8) Build and test. You may need to make changes in bindings.rs or on
the C++ side depending on what changed in webrender. This can
potentially be quite tricky if you don't fully understand the API
changes on the webrender side. In this step, try to not use your new
features yet, just get the build working with the minimal changes.
9) Commit the changes locally from step 7, and push everything to the
graphics branch.
10) Now you have an update webrender with the new features you wanted,
so you can write gecko code against them.
Yes, this is somewhat painful. It used to be worse. :)
Latest Commit: ee97fcaa4ee8eda89f7bd67b1a8920d3382af294