Backed out changeset b4dba80235dc (bug 1765921) for causing WR bustages.

This commit is contained in:
Marian-Vasile Laza 2023-01-19 22:17:14 +02:00
parent 76c4c1615c
commit ea060cc229
20 changed files with 415 additions and 604 deletions

48
Cargo.lock generated
View File

@ -1693,25 +1693,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "firefox-on-glean"
version = "0.1.0"
dependencies = [
"bincode",
"chrono",
"glean",
"inherent",
"log",
"mozbuild",
"nsstring",
"once_cell",
"serde",
"tempfile",
"thin-vec",
"uuid",
"xpcom",
]
[[package]]
name = "flagset"
version = "0.4.3"
@ -1848,11 +1829,30 @@ version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "fog"
version = "0.1.0"
dependencies = [
"bincode",
"chrono",
"glean",
"inherent",
"log",
"mozbuild",
"nsstring",
"once_cell",
"serde",
"tempfile",
"thin-vec",
"uuid",
"xpcom",
]
[[package]]
name = "fog-gtest"
version = "0.1.0"
dependencies = [
"firefox-on-glean",
"fog",
"jog",
"nsstring",
]
@ -1862,7 +1862,7 @@ name = "fog_control"
version = "0.1.0"
dependencies = [
"cstr",
"firefox-on-glean",
"fog",
"glean",
"log",
"nserror",
@ -2789,7 +2789,7 @@ dependencies = [
name = "jog"
version = "0.1.0"
dependencies = [
"firefox-on-glean",
"fog",
"log",
"mozbuild",
"nsstring",
@ -6239,7 +6239,7 @@ dependencies = [
"derive_more",
"etagere",
"euclid",
"firefox-on-glean",
"fog",
"fxhash",
"gleam",
"glean",
@ -6510,7 +6510,7 @@ dependencies = [
"core-text",
"dwrote",
"euclid",
"firefox-on-glean",
"fog",
"freetype",
"fxhash",
"glean",

View File

@ -153,7 +153,7 @@ async-task = { git = "https://github.com/smol-rs/async-task", rev="f6488e35beccb
chardetng = { git = "https://github.com/hsivonen/chardetng", rev="3484d3e3ebdc8931493aa5df4d7ee9360a90e76b" }
chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev="fc68464b5445caf111e41f643a2e69ccce0b4f83" }
firefox-on-glean = { path = "toolkit/components/glean/api" }
fog = { path = "toolkit/components/glean/api" }
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev="412f9a0aa556611de021bde89dee8fefe6e0fbbd" }
midir = { git = "https://github.com/mozilla/midir.git", rev = "519e651241e867af3391db08f9ae6400bc023e18" }

900
gfx/wr/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,6 @@ opt-level = 2
opt-level = 2
[patch.crates-io]
firefox-on-glean = { path = "fog" }
fog = { path = "fog" }
# use a patched version of glutin that works on android
glutin = { version = "0.28", git = "https://github.com/jamienicol/glutin", branch="wr" }

View File

@ -1,5 +1,5 @@
[package]
name = "firefox-on-glean"
name = "fog"
version = "0.1.0"
edition = "2018"
license = "MPL-2.0"

View File

@ -18,7 +18,7 @@ serialize_program = ["serde", "webrender_build/serialize_program"]
dynamic_freetype = ["glyph_rasterizer/dynamic_freetype"]
static_freetype = ["glyph_rasterizer/static_freetype"]
leak_checks = []
gecko = ["firefox-on-glean", "glyph_rasterizer/gecko"]
gecko = ["fog", "glyph_rasterizer/gecko"]
sw_compositor = ["swgl"]
[build-dependencies]
@ -53,7 +53,7 @@ tracy-rs = "0.1.2"
derive_more = { version = "0.99", default-features = false, features = ["add_assign"] }
etagere = "0.2.6"
glean = "52.0.0"
firefox-on-glean = { version = "0.1.0", optional = true }
fog = { version = "0.1.0", optional = true }
swgl = { path = "../swgl", optional = true }
topological-sort = "0.1"

View File

@ -4,7 +4,7 @@
use glean::TimerId;
#[cfg(feature = "gecko")]
use firefox_on_glean::metrics::wr;
use fog::metrics::wr;
use std::time::Duration;
pub struct Telemetry;

View File

@ -12,7 +12,7 @@ dynamic_freetype = []
static_freetype = ["freetype/freetype-sys"]
capture = ["api/serialize", "serde", "smallvec/serde"]
replay = ["api/deserialize", "serde", "smallvec/serde"]
gecko = ["firefox-on-glean", "glean"]
gecko = ["fog", "glean"]
[dependencies]
api = { version = "0.62.0", path = "../webrender_api", package = "webrender_api" }
@ -26,7 +26,7 @@ log = "0.4"
lazy_static = "1"
fxhash = "0.2.1"
glean = { version = "52.0.0", optional = true }
firefox-on-glean = { version = "0.1.0", optional = true }
fog = { version = "0.1.0", optional = true }
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
[dev-dependencies]

View File

@ -5,7 +5,7 @@
#[cfg(feature = "gecko")]
use glean::TimerId;
#[cfg(feature = "gecko")]
use firefox_on_glean::metrics::wr;
use fog::metrics::wr;
#[cfg(not(feature = "gecko"))]
pub struct TimerId;

View File

@ -35,10 +35,6 @@ notes = "This is a crate Henri wrote which is also published. We should probably
audit-as-crates-io = true
notes = "This is a pinned version of the upstream code, presumably to get a fix that hadn't been released yet. We should consider switching to the latest official release."
[policy.firefox-on-glean]
audit-as-crates-io = false
notes = "The crates.io version of this is just a placeholder to allow public crates to depend on firefox-on-glean."
[policy.geckodriver]
audit-as-crates-io = false
criteria = "safe-to-run"

View File

@ -13,7 +13,7 @@ nsstring = { path = "../../../xpcom/rust/nsstring" }
static_prefs = { path = "../../../modules/libpref/init/static_prefs" }
xpcom = { path = "../../../xpcom/rust/xpcom" }
once_cell = "1.2.0"
firefox-on-glean = { path = "./api" }
fog = { path = "./api" }
cstr = "0.2"
viaduct = "0.1"
url = "2.1"
@ -23,6 +23,6 @@ thin-vec = { version = "0.2.1", features = ["gecko-ffi"] }
# Leave data collection enabled, but disable upload.
disable_upload = []
# Letting us know we're compiling with Gecko symbols.
with_gecko = ["firefox-on-glean/with_gecko"]
with_gecko = ["fog/with_gecko"]
# Opt into a larger preinit queue
million_queue = ["glean/preinit_million_queue"]

View File

@ -1,5 +1,5 @@
[package]
name = "firefox-on-glean"
name = "fog"
version = "0.1.0"
authors = ["Glean SDK team <glean-team@mozilla.com>"]
edition = "2018"

View File

@ -7,7 +7,7 @@ publish = false
license = "MPL-2.0"
[dependencies]
firefox-on-glean = { path = "../../api" }
fog = { path = "../../api" }
log = "0.4"
mozbuild = "0.1"
nsstring = { path = "../../../../../xpcom/rust/nsstring", optional = true }

View File

@ -2,9 +2,9 @@
* 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 firefox_on_glean::factory;
use firefox_on_glean::private::traits::HistogramType;
use firefox_on_glean::private::{CommonMetricData, Lifetime, MemoryUnit, TimeUnit};
use fog::factory;
use fog::private::traits::HistogramType;
use fog::private::{CommonMetricData, Lifetime, MemoryUnit, TimeUnit};
#[cfg(feature = "with_gecko")]
use nsstring::{nsACString, nsAString, nsCString};
use serde::Deserialize;

View File

@ -21,5 +21,5 @@ includes = ["nsTArray.h", "nsString.h"]
[parse]
parse_deps = true
include = ["firefox-on-glean"]
extra_bindings = ["firefox-on-glean"]
include = ["fog"]
extra_bindings = ["fog"]

View File

@ -7,7 +7,6 @@ use std::ffi::CString;
use std::ops::DerefMut;
use std::path::PathBuf;
use firefox_on_glean::{metrics, pings};
#[cfg(target_os = "android")]
use nserror::NS_ERROR_NOT_IMPLEMENTED;
use nserror::{nsresult, NS_ERROR_FAILURE};
@ -87,7 +86,7 @@ fn fog_init_internal(
upload_enabled: bool,
uploader: Option<Box<dyn glean::net::PingUploader>>,
) -> Result<(), nsresult> {
metrics::fog::initialization.start();
fog::metrics::fog::initialization.start();
log::debug!("Initializing FOG.");
@ -111,11 +110,11 @@ fn fog_init_internal(
log::debug!("Configuration: {:#?}", conf);
// Register all custom pings before we initialize.
pings::register_pings(Some(&conf.application_id));
fog::pings::register_pings(Some(&conf.application_id));
glean::initialize(conf, client_info);
metrics::fog::initialization.stop();
fog::metrics::fog::initialization.stop();
Ok(())
}

View File

@ -17,7 +17,10 @@
//! [privacy-policy]: https://www.mozilla.org/privacy/
//! [docs]: https://firefox-source-docs.mozilla.org/toolkit/components/glean/
use firefox_on_glean::{ipc, metrics, pings};
// No one is currently using the Glean SDK, so let's export it, so we know it gets
// compiled.
pub extern crate fog;
use nserror::{nsresult, NS_ERROR_FAILURE, NS_OK};
use nsstring::{nsACString, nsCString};
use thin_vec::ThinVec;
@ -38,7 +41,7 @@ pub extern "C" fn fog_shutdown() {
#[no_mangle]
pub extern "C" fn fog_register_pings() {
pings::register_pings(None);
fog::pings::register_pings(None);
}
static mut PENDING_BUF: Vec<u8> = Vec::new();
@ -50,7 +53,7 @@ static mut PENDING_BUF: Vec<u8> = Vec::new();
/// fog_give_ipc_buf on).
#[no_mangle]
pub unsafe extern "C" fn fog_serialize_ipc_buf() -> usize {
if let Some(buf) = ipc::take_buf() {
if let Some(buf) = fog::ipc::take_buf() {
PENDING_BUF = buf;
PENDING_BUF.len()
} else {
@ -79,10 +82,10 @@ pub unsafe extern "C" fn fog_give_ipc_buf(buf: *mut u8, buf_len: usize) -> usize
#[no_mangle]
pub unsafe extern "C" fn fog_use_ipc_buf(buf: *const u8, buf_len: usize) {
let slice = std::slice::from_raw_parts(buf, buf_len);
let res = ipc::replay_from_buf(slice);
let res = fog::ipc::replay_from_buf(slice);
if res.is_err() {
log::warn!("Unable to replay ipc buffer. This will result in data loss.");
metrics::fog_ipc::replay_failures.add(1);
fog::metrics::fog_ipc::replay_failures.add(1);
}
}

View File

@ -6,7 +6,7 @@ license = "MPL-2.0"
description = "Tests for the FOG crate"
[dependencies]
firefox-on-glean = { path = "../../api" }
fog = { path = "../../api" }
jog = { path = "../../bindings/jog" }
nsstring = { path = "../../../../../xpcom/rust/nsstring" }

View File

@ -1,9 +1,6 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
extern crate firefox_on_glean;
use firefox_on_glean::metrics;
extern crate nsstring;
use nsstring::nsString;
@ -40,8 +37,8 @@ pub extern "C" fn Rust_TestRustInGTest() {
// b) Require Gecko
// This demonstration doesn't actually require Gecko. But we pretend it
// does so we remember how to do this rust-in-gtest pattern.
metrics::test_only::bad_code.add(12);
expect!(metrics::test_only::bad_code.test_get_value(None) == Some(12));
fog::metrics::test_only::bad_code.add(12);
expect!(fog::metrics::test_only::bad_code.test_get_value(None) == Some(12));
}
#[no_mangle]

View File

@ -21,7 +21,7 @@ for feature in gkrust_features:
# Target directory doesn't matter a lot here, since we can't share panic=abort
# compilation artifacts with gkrust.
RUST_TESTS = [
"firefox-on-glean",
"fog",
"l10nregistry",
"selectors",
"servo_arc",