Bug 1434410: Move the WebRender revision to a separate file and include it in captures. r=kats
authorDzmitry Malyshau <kvark@mozilla.com>
Tue, 30 Jan 2018 23:24:55 -0500
changeset 401586 05f077d8f612a29db4495988e5b1fbafc8d12263
parent 401585 5ada933db7e2887646d64b44525da5daf5f44b85
child 401587 d7e5e7c4cf8857e267c60689e355aafeddfd2bdd
child 401683 7b46ef2ae1412b15ed45e7d2367ca491344729f7
push id99406
push userkgupta@mozilla.com
push dateWed, 31 Jan 2018 04:25:39 +0000
treeherdermozilla-inbound@05f077d8f612 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1434410: Move the WebRender revision to a separate file and include it in captures. r=kats MozReview-Commit-ID: 9ZgALwny1p2
--- a/gfx/doc/README.webrender
+++ b/gfx/doc/README.webrender
@@ -31,34 +31,34 @@ try pushes to verify the update. After t
 actually land the update into the tree.
 Option A:
    Use a script to do the update for you. This will usually work, if you satisfy
    all the assumptions the script is making. The script can be found at
    and contains documentation on how to use it. Read the documentation carefully
    before trying to use it. The only extra change you need to make with this
-   option is to manually update the revision at the bottom of gfx/doc/README.webrender
+   option is to manually update the revision in gfx/webrender_bindings/revision.txt
    so that it points to the new WR version you are landing. The script doesn't
    do that yet.
 Option B:
    Do the update manually. This is a little more cumbersome but may be required
    if the script doesn't work or the repos are in a state that violates hidden
    assumptions in the script (e.g. if the webrender_bindings/Cargo.toml file is
    no longer in the format expected by the script). The steps to do this are,
    - Update your mozilla-central checkout to the latest code on mozilla-central.
    - Check out and update the webrender repo to the version you want
    - Copy over the webrender, webrender_api, and part of the wrench folders into
      gfx/. The best way to do this is to simply delete the gfx/webrender,
      gfx/webrender_api, and gfx/wrench folders and use |cp -R| to copy them in
      again from the webrender repo, and then delete the gfx/wrench/reftests,
-     gfx/wrench/benchmarks, and gfx/wrench/script folders. Update the "latest
-     commit" information at the bottom of this file with the version.
+     gfx/wrench/benchmarks, and gfx/wrench/script folders. Update the revision
+     in gfx/webrender_bindings/revision.txt file with the git changeset hash.
    - If you need to modify webrender_bindings/Cargo.toml file, do so now. Changes
      at this step usually consist of:
      (a) Updating version numbers. Go through the version numbers of ALL the
          dependencies in the Cargo.toml file (webrender, euclid, etc.) and make
          sure the version numbers listed match what's in the new
          gfx/webrender/Cargo.toml and gfx/webrender_api/Cargo.toml files.
      (b) Turning on or off any new features that were added in upstream WR. This
          used to happen a lot but is pretty rare now.
@@ -171,10 +171,9 @@ 2. Sometimes autoland tip has changed en
    on top of autoland tip rather than central. (The script-based update in option A
    has an env var you can set to do this). In theory you can get the same
    result by resolving the conflict manually but Cargo.lock files are usually not
    trivial to merge by hand. If it's just the third_party/rust dir that has conflicts
    you can delete it and run |mach vendor rust| again to repopulate it.
-The version of WebRender currently in the tree is:
+The current WebRender revision can be found in gfx/webrender_bindings/revision.txt file.
new file mode 100644
--- /dev/null
+++ b/gfx/webrender_bindings/revision.txt
@@ -0,0 +1,1 @@
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -1158,20 +1158,30 @@ pub extern "C" fn wr_resource_updates_ad
 pub extern "C" fn wr_api_capture(
     dh: &mut DocumentHandle,
     path: *const c_char,
     bits_raw: u32,
 ) {
+    use std::fs::File;
+    use std::io::Write;
     let cstr = unsafe { CStr::from_ptr(path) };
     let path = PathBuf::from(&*cstr.to_string_lossy());
+    let revision_path = path.join("wr.txt");
     let bits = CaptureBits::from_bits(bits_raw as _).unwrap();
     dh.api.save_capture(path, bits);
+    let revision = include_bytes!("../revision.txt");
+    File::create(revision_path)
+        .unwrap()
+        .write(revision)
+        .unwrap();
 #[cfg(target_os = "windows")]
 fn read_font_descriptor(
     bytes: &mut WrVecU8,
     index: u32
 ) -> NativeFontHandle {
     let wchars = bytes.convert_into_vec::<u16>();