Backed out 3 changesets (bug 1551611) for tidy bustage CLOSED TREE
authorBogdan Tara <btara@mozilla.com>
Wed, 15 May 2019 18:00:25 +0300
changeset 532776 bfddd86062409ba22bf888f09d478041cf4391e7
parent 532775 f60b2e760d1adf5be0aae2485ab685dc8b2fb039
child 532777 74151c255b07c9a3b0665f49d4fa1f3f617596f0
push id11272
push userapavel@mozilla.com
push dateThu, 16 May 2019 15:28:22 +0000
treeherdermozilla-beta@2265bfc5920d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1551611
milestone68.0a1
backs outf60b2e760d1adf5be0aae2485ab685dc8b2fb039
85ac4e68a63e4cf49def39381105131d3520e813
df4a76b3e6ce045afbe647a2a99fbe6386fe296d
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
Backed out 3 changesets (bug 1551611) for tidy bustage CLOSED TREE Backed out changeset f60b2e760d1a (bug 1551611) Backed out changeset 85ac4e68a63e (bug 1551611) Backed out changeset df4a76b3e6ce (bug 1551611)
gfx/wr/Cargo.lock
gfx/wr/wrench/Cargo.toml
gfx/wr/wrench/reftests/text/reftest.list
gfx/wr/wrench/src/parse_function.rs
gfx/wr/wrench/src/reftest.rs
--- a/gfx/wr/Cargo.lock
+++ b/gfx/wr/Cargo.lock
@@ -1804,17 +1804,16 @@ dependencies = [
  "glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "mozangle 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "osmesa-src 0.1.1 (git+https://github.com/servo/osmesa-src)",
  "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
  "serde_json 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender 0.60.0",
  "webrender_api 0.60.0",
  "winit 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "yaml-rust 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
--- a/gfx/wr/wrench/Cargo.toml
+++ b/gfx/wr/wrench/Cargo.toml
@@ -24,17 +24,16 @@ ron = "0.1.5"
 time = "0.1"
 crossbeam = "0.2"
 osmesa-sys = { version = "0.1.2", optional = true }
 osmesa-src = { git = "https://github.com/servo/osmesa-src", optional = true }
 webrender = {path = "../webrender", features=["capture","replay","debugger","png","profiler","no_static_freetype"]}
 webrender_api = {path = "../webrender_api", features=["serialize","deserialize"]}
 winit = "0.16"
 serde = {version = "1.0", features = ["derive"] }
-semver = "0.9.0"
 
 [target.'cfg(target_os = "macos")'.dependencies]
 core-graphics = "0.17.1"
 core-foundation = "0.6"
 
 [features]
 default = [ "env_logger" ]
 headless = [ "osmesa-sys", "osmesa-src" ]
--- a/gfx/wr/wrench/reftests/text/reftest.list
+++ b/gfx/wr/wrench/reftests/text/reftest.list
@@ -27,17 +27,17 @@ fuzzy(1,1) platform(linux) == shadow-ord
 != synthetic-bold.yaml synthetic-bold-not-ref.yaml
 fuzzy(1,1786) options(disable-subpixel) == synthetic-bold-transparent.yaml synthetic-bold-transparent-ref.yaml
 != synthetic-bold-transparent.yaml synthetic-bold.yaml
 != synthetic-italics.yaml synthetic-italics-ref.yaml
 != synthetic-italics-custom.yaml synthetic-italics-ref.yaml
 != synthetic-italics-custom.yaml synthetic-italics.yaml
 options(disable-aa) == ahem.yaml ahem-ref.yaml
 platform(linux) == isolated-text.yaml isolated-text.png
-platform(mac) skip_on(mac,>=10.14) fuzzy(3,67) == white-opacity.yaml white-opacity.png
+platform(mac) fuzzy(3,67) == white-opacity.yaml white-opacity.png
 fuzzy(1,4) platform(linux) options(disable-subpixel) == colors.yaml colors-alpha.png
 # Run without dual-source blending path, batches are broken when text colors change.
 fuzzy(1,6) platform(linux) options(disable-dual-source-blending) draw_calls(5) == colors.yaml colors-subpx.png
 # Run with both dual-source blending, ensuring batching is improved.
 fuzzy(1,6) platform(linux) draw_calls(2) == colors.yaml colors-subpx.png
 platform(linux) options(disable-subpixel) == border-radius.yaml border-radius-alpha.png
 platform(linux) == border-radius.yaml border-radius-subpx.png
 options(disable-aa) == transparent-no-aa.yaml transparent-no-aa-ref.yaml
@@ -55,17 +55,17 @@ platform(mac) fuzzy(195,30) == color-bit
 platform(linux) == writing-modes.yaml writing-modes-ref.yaml
 platform(linux) == blurred-shadow-local-clip-rect.yaml blurred-shadow-local-clip-rect-ref.png
 fuzzy(1,1) platform(linux) == two-shadows.yaml two-shadows.png
 == shadow-clip.yaml shadow-clip-ref.yaml
 == shadow-fast-clip.yaml shadow-fast-clip-ref.yaml
 == shadow-partial-glyph.yaml shadow-partial-glyph-ref.yaml
 fuzzy(1,107) platform(linux) == shadow-transforms.yaml shadow-transforms.png
 fuzzy(1,113) platform(linux) == raster-space.yaml raster-space.png
-skip_on(mac,>=10.14) != allow-subpixel.yaml allow-subpixel-ref.yaml
+!= allow-subpixel.yaml allow-subpixel-ref.yaml
 == bg-color.yaml bg-color-ref.yaml
 != large-glyphs.yaml blank.yaml
 == snap-text-offset.yaml snap-text-offset-ref.yaml
 == shadow-border.yaml shadow-solid-ref.yaml
 == shadow-image.yaml shadow-solid-ref.yaml
 options(disable-aa) == snap-clip.yaml snap-clip-ref.yaml
 platform(linux) == perspective-clip.yaml perspective-clip.png
 options(disable-subpixel) == raster-space-snap.yaml raster-space-snap-ref.yaml
--- a/gfx/wr/wrench/src/parse_function.rs
+++ b/gfx/wr/wrench/src/parse_function.rs
@@ -1,26 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use std::str::CharIndices;
 
-// support arguments like '4', 'ab', '4.0', '>=10.14'
+// support arguments like '4', 'ab', '4.0'
 fn acceptable_arg_character(c: char) -> bool {
-    c.is_alphanumeric() || c == '.' || c == '-' || c == '<' || c == '>' || c == '='
+    c.is_alphanumeric() || c == '.' || c == '-'
 }
 
-// A crapy parser for parsing strings like "translate(1, 3) blahblah"
-// Returns a tuple with three components:
-// - First component is the function name (e.g. "translate")
-// - Second component is the list of arguments (e.g. vec!["1", "3"])
-// - Third component is the rest of the string "blahblah"
+// A crapy parser for parsing strings like "translate(1, 3)"
 pub fn parse_function(s: &str) -> (&str, Vec<&str>, &str) {
-    // XXX: This is not particularly easy to read. Sorry.
+    // XXX: This it not particular easy to read. Sorry.
     struct Parser<'a> {
         itr: CharIndices<'a>,
         start: usize,
         o: Option<(usize, char)>,
     }
     impl<'a> Parser<'a> {
         fn skip_whitespace(&mut self) {
             while let Some(k) = self.o {
--- a/gfx/wr/wrench/src/reftest.rs
+++ b/gfx/wr/wrench/src/reftest.rs
@@ -1,34 +1,47 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 use crate::{WindowWrapper, NotifierEvent};
 use base64;
-use semver;
 use image::load as load_piston_image;
 use image::png::PNGEncoder;
 use image::{ColorType, ImageFormat};
 use crate::parse_function::parse_function;
 use crate::png::save_flipped;
 use std::cmp;
 use std::fmt::{Display, Error, Formatter};
 use std::fs::File;
 use std::io::{BufRead, BufReader};
 use std::path::{Path, PathBuf};
-use std::process::Command;
 use std::sync::mpsc::Receiver;
 use webrender::RenderResults;
 use webrender::api::*;
 use webrender::api::units::*;
 use crate::wrench::{Wrench, WrenchThing};
 use crate::yaml_frame_reader::YamlFrameReader;
 
 
+#[cfg(target_os = "windows")]
+const PLATFORM: &str = "win";
+#[cfg(target_os = "linux")]
+const PLATFORM: &str = "linux";
+#[cfg(target_os = "macos")]
+const PLATFORM: &str = "mac";
+#[cfg(target_os = "android")]
+const PLATFORM: &str = "android";
+#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows", target_os = "android")))]
+const PLATFORM: &str = "other";
+#[cfg(debug)]
+const MODE: &str = "debug";
+#[cfg(not(debug))]
+const MODE: &str = "release";
+
 const OPTION_DISABLE_SUBPX: &str = "disable-subpixel";
 const OPTION_DISABLE_AA: &str = "disable-aa";
 const OPTION_DISABLE_DUAL_SOURCE_BLENDING: &str = "disable-dual-source-blending";
 const OPTION_ALLOW_MIPMAPS: &str = "allow-mipmaps";
 
 pub struct ReftestOptions {
     // These override values that are lower.
     pub allow_max_difference: usize,
@@ -184,17 +197,17 @@ impl ReftestImage {
         format!("data:image/png;base64,{}", png_base64)
     }
 }
 
 struct ReftestManifest {
     reftests: Vec<Reftest>,
 }
 impl ReftestManifest {
-    fn new(manifest: &Path, environment: &ReftestEnvironment, options: &ReftestOptions) -> ReftestManifest {
+    fn new(manifest: &Path, options: &ReftestOptions) -> ReftestManifest {
         let dir = manifest.parent().unwrap();
         let f =
             File::open(manifest).expect(&format!("couldn't open manifest: {}", manifest.display()));
         let file = BufReader::new(&f);
 
         let mut reftests = Vec::new();
 
         for line in file.lines() {
@@ -222,32 +235,32 @@ impl ReftestManifest {
             let mut paths = vec![];
             for (i, token) in tokens.iter().enumerate() {
                 match *token {
                     "include" => {
                         assert!(i == 0, "include must be by itself");
                         let include = dir.join(tokens[1]);
 
                         reftests.append(
-                            &mut ReftestManifest::new(include.as_path(), environment, options).reftests,
+                            &mut ReftestManifest::new(include.as_path(), options).reftests,
                         );
 
                         break;
                     }
                     platform if platform.starts_with("skip_on") => {
                         // e.g. skip_on(android,debug) will skip only when
                         // running on a debug android build.
                         let (_, args, _) = parse_function(platform);
-                        if args.iter().all(|arg| environment.has(arg)) {
+                        if args.iter().all(|arg| arg == &PLATFORM || arg == &MODE) {
                             break;
                         }
                     }
                     platform if platform.starts_with("platform") => {
                         let (_, args, _) = parse_function(platform);
-                        if !args.iter().any(|arg| arg == &environment.platform) {
+                        if !args.iter().any(|arg| arg == &PLATFORM) {
                             // Skip due to platform not matching
                             break;
                         }
                     }
                     function if function.starts_with("zoom") => {
                         let (_, args, _) = parse_function(function);
                         zoom_factor = args[0].parse().unwrap();
                     }
@@ -344,105 +357,28 @@ impl ReftestManifest {
     }
 }
 
 struct YamlRenderOutput {
     image: ReftestImage,
     results: RenderResults,
 }
 
-struct ReftestEnvironment {
-    pub platform: &'static str,
-    pub version: Option<semver::Version>,
-    pub mode: &'static str,
-}
-
-impl ReftestEnvironment {
-    fn new() -> Self {
-        Self {
-            platform: Self::platform(),
-            version: Self::version(),
-            mode: Self::mode(),
-        }
-    }
-
-    fn has(&self, condition: &str) -> bool {
-        if self.platform == condition || self.mode == condition {
-            return true;
-        }
-        match (&self.version, &semver::VersionReq::parse(condition)) {
-            (None, _) => false,
-            (_, Err(_)) => false,
-            (Some(v), Ok(r)) => r.matches(v),
-        }
-    }
-
-    fn platform() -> &'static str {
-        if cfg!(target_os = "windows") {
-            "win"
-        } else if cfg!(target_os = "linux") {
-            "linux"
-        } else if cfg!(target_os = "macos") {
-            "mac"
-        } else if cfg!(target_os = "android") {
-            "android"
-        } else {
-            "other"
-        }
-    }
-
-    fn version() -> Option<semver::Version> {
-        if cfg!(target_os = "macos") {
-            use std::str;
-            let version_bytes = Command::new("defaults")
-                .arg("read")
-                .arg("loginwindow")
-                .arg("SystemVersionStampAsString")
-                .output()
-                .expect("Failed to get macOS version")
-                .stdout;
-            let mut version_string = str::from_utf8(&version_bytes)
-                .expect("Failed to read macOS version")
-                .trim()
-                .to_string();
-            // On some machines this produces just the major.minor and on
-            // some machines this gives major.minor.patch. But semver requires
-            // the patch so we fake one if it's not there.
-            if version_string.chars().filter(|c| *c == '.').count() == 1 {
-                version_string.push_str(".0");
-            }
-            Some(semver::Version::parse(&version_string).expect(&format!("Failed to parse macOS version {}", version_string)))
-        } else {
-            None
-        }
-    }
-
-    fn mode() -> &'static str {
-        if cfg!(debug_assertions) {
-            "debug"
-        } else {
-            "release"
-        }
-    }
-}
-
 pub struct ReftestHarness<'a> {
     wrench: &'a mut Wrench,
     window: &'a mut WindowWrapper,
     rx: &'a Receiver<NotifierEvent>,
-    environment: ReftestEnvironment,
 }
 impl<'a> ReftestHarness<'a> {
     pub fn new(wrench: &'a mut Wrench, window: &'a mut WindowWrapper, rx: &'a Receiver<NotifierEvent>) -> Self {
-        let environment = ReftestEnvironment::new();
-        ReftestHarness { wrench, window, rx, environment }
+        ReftestHarness { wrench, window, rx }
     }
 
     pub fn run(mut self, base_manifest: &Path, reftests: Option<&Path>, options: &ReftestOptions) -> usize {
-        let manifest = ReftestManifest::new(base_manifest, &self.environment, options);
+        let manifest = ReftestManifest::new(base_manifest, options);
         let reftests = manifest.find(reftests.unwrap_or(&PathBuf::new()));
 
         let mut total_passing = 0;
         let mut failing = Vec::new();
 
         for t in reftests {
             if self.run_reftest(t) {
                 total_passing += 1;