Platform/GFX/Quantum Render: Difference between revisions

Jump to navigation Jump to search
Update instructions for modifying vendored code
(→‎Vital stats: priority defs)
(Update instructions for modifying vendored code)
Line 67: Line 67:
Sometimes when hacking on Quantum Render, you'll need to make a change to one of the upstream dependencies of the webrender library (say for example [https://github.com/servo/euclid euclid]). However, you may need to test out your changes in the QR build. The way to do this is not obvious, because the QR build uses the vendored copy of euclid (in third_party/rust/euclid) which you can't directly modify without violating the checksum checks. Instead, what you need to do is this:
Sometimes when hacking on Quantum Render, you'll need to make a change to one of the upstream dependencies of the webrender library (say for example [https://github.com/servo/euclid euclid]). However, you may need to test out your changes in the QR build. The way to do this is not obvious, because the QR build uses the vendored copy of euclid (in third_party/rust/euclid) which you can't directly modify without violating the checksum checks. Instead, what you need to do is this:


* First we make a copy of the vendored euclid repo
In $MOZILLA_ROOT/Cargo.toml, there should be a section at the bottom called [patch.crates-io]. Add an entry like so:
  cd $MOZILLA_ROOT/third_party/rust
 
  cp -R euclid euclid_modified
[patch.crates-io]
* Then, make your desired changes to euclid_modified.
...
* Then, we need to tell the build system to use euclid_modified instead of euclid. Note that for this to work, the version numbers in the Cargo.toml files should be the same in euclid and euclid_modified. The following steps add a [replace] section to the top-level libgkrust Cargo.toml file to use the modified euclid. See http://doc.crates.io/manifest.html#the-replace-section for details. You'll need to replace the <tt>0.10.3</tt> in the command below with whatever the library version in (as of this writing euclid is at v0.10.3 in the graphics repo).
euclid = { path = "third_party/rust/euclid" }
  cd $MOZILLA_ROOT/toolkit/library/rust/
 
  echo -e '[replace]\n"euclid:0.10.3" = { path = "../../../third_party/rust/euclid_modified" }" >> Cargo.toml
Then run ./mach vendor rust
  cargo update -p euclid # This updates Cargo.lock
* And then build with your modified euclid:
  cd $MOZILLA_ROOT
  mach build


== Hacking ==
== Hacking ==
Confirmed users
156

edits

Navigation menu