Skip to content

Commit 00548e1

Browse files
committed
Bug 1882615 - Vendor Glean SDK to v58.0.0 r=perry.mcmanis,supply-chain-reviewers,mach-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D203187
1 parent 33fca61 commit 00548e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1276
-435
lines changed

Cargo.lock

Lines changed: 4 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ allprojects {
6060
topsrcdir = gradle.mozconfig.topsrcdir
6161
topobjdir = gradle.mozconfig.topobjdir
6262

63-
gleanVersion = "57.0.0"
63+
gleanVersion = "58.0.0"
6464
if (gleanVersion != getRustVersionFor("glean")) {
6565
throw new StopExecutionException("Mismatched Glean version, expected: ${gleanVersion}," +
6666
" found ${getRustVersionFor("glean")}")

gfx/wr/Cargo.lock

Lines changed: 4 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gfx/wr/webrender/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ svg_fmt = "0.4"
5252
tracy-rs = "0.1.2"
5353
derive_more = { version = "0.99", default-features = false, features = ["add_assign"] }
5454
etagere = "0.2.6"
55-
glean = "57.0.0"
55+
glean = "58.0.0"
5656
firefox-on-glean = { version = "0.1.0", optional = true }
5757
swgl = { path = "../swgl", optional = true }
5858
topological-sort = "0.1"

gfx/wr/wr_glyph_rasterizer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tracy-rs = "0.1.2"
2525
log = "0.4"
2626
lazy_static = "1"
2727
fxhash = "0.2.1"
28-
glean = { version = "57.0.0", optional = true }
28+
glean = { version = "58.0.0", optional = true }
2929
firefox-on-glean = { version = "0.1.0", optional = true }
3030
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
3131

python/sites/mach.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ vendored:third_party/python/wheel
9393
vendored:third_party/python/zipp
9494
# glean-sdk may not be installable if a wheel isn't available
9595
# and it has to be built from source.
96-
pypi-optional:glean-sdk==57.0.0:telemetry will not be collected
96+
pypi-optional:glean-sdk==58.0.0:telemetry will not be collected
9797
# Mach gracefully handles the case where `psutil` is unavailable.
9898
# We aren't (yet) able to pin packages in automation, so we have to
9999
# support down to the oldest locally-installed version (5.4.2).

supply-chain/audits.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ notes = "The Glean SDKs are maintained by the Glean Team at Mozilla."
232232
[[wildcard-audits.glean]]
233233
who = "Travis Long <tlong@mozilla.com>"
234234
criteria = "safe-to-deploy"
235-
user-id = 66068 # Travis Long (travis79)
235+
user-id = 66068
236236
start = "2024-02-12"
237237
end = "2025-02-13"
238238

@@ -247,7 +247,7 @@ notes = "The Glean SDKs are maintained by the Glean Team at Mozilla."
247247
[[wildcard-audits.glean-core]]
248248
who = "Travis Long <tlong@mozilla.com>"
249249
criteria = "safe-to-deploy"
250-
user-id = 66068 # Travis Long (travis79)
250+
user-id = 66068
251251
start = "2020-07-10"
252252
end = "2025-02-13"
253253

supply-chain/imports.lock

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -212,33 +212,19 @@ user-login = "jrmuizel"
212212
user-name = "Jeff Muizelaar"
213213

214214
[[publisher.glean]]
215-
version = "56.1.0"
216-
when = "2024-01-17"
215+
version = "58.0.0"
216+
when = "2024-02-29"
217217
user-id = 48
218218
user-login = "badboy"
219219
user-name = "Jan-Erik Rediger"
220220

221-
[[publisher.glean]]
222-
version = "57.0.0"
223-
when = "2024-02-12"
224-
user-id = 66068
225-
user-login = "travis79"
226-
user-name = "Travis Long"
227-
228221
[[publisher.glean-core]]
229-
version = "56.1.0"
230-
when = "2024-01-17"
222+
version = "58.0.0"
223+
when = "2024-02-29"
231224
user-id = 48
232225
user-login = "badboy"
233226
user-name = "Jan-Erik Rediger"
234227

235-
[[publisher.glean-core]]
236-
version = "57.0.0"
237-
when = "2024-02-12"
238-
user-id = 66068
239-
user-login = "travis79"
240-
user-name = "Travis Long"
241-
242228
[[publisher.glslopt]]
243229
version = "0.1.9"
244230
when = "2021-03-17"

third_party/rust/glean-core/.cargo-checksum.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

third_party/rust/glean-core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
edition = "2021"
1414
rust-version = "1.66"
1515
name = "glean-core"
16-
version = "57.0.0"
16+
version = "58.0.0"
1717
authors = [
1818
"Jan-Erik Rediger <jrediger@mozilla.com>",
1919
"The Glean Team <glean-team@mozilla.com>",
@@ -35,7 +35,7 @@ license = "MPL-2.0"
3535
repository = "https://github.com/mozilla/glean"
3636

3737
[package.metadata.glean]
38-
glean-parser = "11.0.1"
38+
glean-parser = "13.0.0"
3939

4040
[dependencies.bincode]
4141
version = "1.2.1"

third_party/rust/glean-core/src/core/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ where
122122
/// experimentation_id: None,
123123
/// };
124124
/// let mut glean = Glean::new(cfg).unwrap();
125-
/// let ping = PingType::new("sample", true, false, true, vec![]);
125+
/// let ping = PingType::new("sample", true, false, true, true, vec![]);
126126
/// glean.register_ping_type(&ping);
127127
///
128128
/// let call_counter: CounterMetric = CounterMetric::new(CommonMetricData {

third_party/rust/glean-core/src/glean.udl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ dictionary PingRequest {
201201
sequence<u8> body;
202202
// A map with all the headers to be sent with the request.
203203
record<DOMString, string> headers;
204+
// Whether the body has {client|ping}_info sections.
205+
boolean body_has_info_sections;
206+
// The ping's name. Likely also somewhere in `path`.
207+
string ping_name;
204208
};
205209

206210
// An enum representing the possible upload tasks to be performed by an uploader.
@@ -287,7 +291,7 @@ enum ErrorType {
287291
};
288292

289293
interface PingType {
290-
constructor(string name, boolean include_client_id, boolean send_if_empty, boolean precise_timestamps, sequence<string> reason_codes);
294+
constructor(string name, boolean include_client_id, boolean send_if_empty, boolean precise_timestamps, boolean include_info_sections, sequence<string> reason_codes);
291295
void submit(optional string? reason = null);
292296
};
293297

third_party/rust/glean-core/src/internal_pings.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ impl InternalPings {
2626
true,
2727
true,
2828
true,
29+
true,
2930
vec![
3031
"active".to_string(),
3132
"dirty_startup".to_string(),
@@ -37,6 +38,7 @@ impl InternalPings {
3738
true,
3839
false,
3940
true,
41+
true,
4042
vec![
4143
"overdue".to_string(),
4244
"reschedule".to_string(),
@@ -50,6 +52,7 @@ impl InternalPings {
5052
true,
5153
false,
5254
true,
55+
true,
5356
vec![
5457
"startup".to_string(),
5558
"inactive".to_string(),
@@ -61,6 +64,7 @@ impl InternalPings {
6164
true,
6265
true,
6366
true,
67+
true,
6468
vec!["at_init".to_string(), "set_upload_enabled".to_string()],
6569
),
6670
}

third_party/rust/glean-core/src/lib.rs

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ pub(crate) const DELETION_REQUEST_PINGS_DIRECTORY: &str = "deletion_request";
9191
static INITIALIZE_CALLED: AtomicBool = AtomicBool::new(false);
9292

9393
/// Keep track of the debug features before Glean is initialized.
94-
static PRE_INIT_DEBUG_VIEW_TAG: OnceCell<Mutex<String>> = OnceCell::new();
94+
static PRE_INIT_DEBUG_VIEW_TAG: Mutex<String> = Mutex::new(String::new());
9595
static PRE_INIT_LOG_PINGS: AtomicBool = AtomicBool::new(false);
96-
static PRE_INIT_SOURCE_TAGS: OnceCell<Mutex<Vec<String>>> = OnceCell::new();
96+
static PRE_INIT_SOURCE_TAGS: Mutex<Vec<String>> = Mutex::new(Vec::new());
9797

9898
/// Keep track of pings registered before Glean is initialized.
99-
static PRE_INIT_PING_REGISTRATION: OnceCell<Mutex<Vec<metrics::PingType>>> = OnceCell::new();
99+
static PRE_INIT_PING_REGISTRATION: Mutex<Vec<metrics::PingType>> = Mutex::new(Vec::new());
100100

101101
/// Global singleton of the handles of the glean.init threads.
102102
/// For joining. For tests.
@@ -396,11 +396,9 @@ fn initialize_inner(
396396
core::with_glean_mut(|glean| {
397397
// The debug view tag might have been set before initialize,
398398
// get the cached value and set it.
399-
if let Some(tag) = PRE_INIT_DEBUG_VIEW_TAG.get() {
400-
let lock = tag.try_lock();
401-
if let Ok(ref debug_tag) = lock {
402-
glean.set_debug_view_tag(debug_tag);
403-
}
399+
let debug_tag = PRE_INIT_DEBUG_VIEW_TAG.lock().unwrap();
400+
if debug_tag.len() > 0 {
401+
glean.set_debug_view_tag(&debug_tag);
404402
}
405403

406404
// The log pings debug option might have been set before initialize,
@@ -412,11 +410,9 @@ fn initialize_inner(
412410

413411
// The source tags might have been set before initialize,
414412
// get the cached value and set them.
415-
if let Some(tags) = PRE_INIT_SOURCE_TAGS.get() {
416-
let lock = tags.try_lock();
417-
if let Ok(ref source_tags) = lock {
418-
glean.set_source_tags(source_tags.to_vec());
419-
}
413+
let source_tags = PRE_INIT_SOURCE_TAGS.lock().unwrap();
414+
if source_tags.len() > 0 {
415+
glean.set_source_tags(source_tags.to_vec());
420416
}
421417

422418
// Get the current value of the dirty flag so we know whether to
@@ -428,13 +424,9 @@ fn initialize_inner(
428424

429425
// Perform registration of pings that were attempted to be
430426
// registered before init.
431-
if let Some(tags) = PRE_INIT_PING_REGISTRATION.get() {
432-
let lock = tags.try_lock();
433-
if let Ok(pings) = lock {
434-
for ping in &*pings {
435-
glean.register_ping_type(ping);
436-
}
437-
}
427+
let pings = PRE_INIT_PING_REGISTRATION.lock().unwrap();
428+
for ping in pings.iter() {
429+
glean.register_ping_type(ping);
438430
}
439431

440432
// If this is the first time ever the Glean SDK runs, make sure to set
@@ -861,7 +853,7 @@ pub(crate) fn register_ping_type(ping: &PingType) {
861853
// if ping registration is attempted before Glean initializes.
862854
// This state is kept across Glean resets, which should only ever happen in test mode.
863855
// It's a set and keeping them around forever should not have much of an impact.
864-
let m = PRE_INIT_PING_REGISTRATION.get_or_init(Default::default);
856+
let m = &PRE_INIT_PING_REGISTRATION;
865857
let mut lock = m.lock().unwrap();
866858
lock.push(ping.clone());
867859
}
@@ -956,7 +948,7 @@ pub fn glean_set_debug_view_tag(tag: String) -> bool {
956948
true
957949
} else {
958950
// Glean has not been initialized yet. Cache the provided tag value.
959-
let m = PRE_INIT_DEBUG_VIEW_TAG.get_or_init(Default::default);
951+
let m = &PRE_INIT_DEBUG_VIEW_TAG;
960952
let mut lock = m.lock().unwrap();
961953
*lock = tag;
962954
// When setting the debug view tag before initialization,
@@ -984,7 +976,7 @@ pub fn glean_set_source_tags(tags: Vec<String>) -> bool {
984976
true
985977
} else {
986978
// Glean has not been initialized yet. Cache the provided source tags.
987-
let m = PRE_INIT_SOURCE_TAGS.get_or_init(Default::default);
979+
let m = &PRE_INIT_SOURCE_TAGS;
988980
let mut lock = m.lock().unwrap();
989981
*lock = tags;
990982
// When setting the source tags before initialization,

third_party/rust/glean-core/src/lib_unit_tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ fn correct_order() {
423423
Jwe("eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.OKOawDo13gRp2ojaHV7LFpZcgV7T6DVZKTyKOMTYUmKoTCVJRgckCL9kiMT03JGeipsEdY3mx_etLbbWSrFr05kLzcSr4qKAq7YN7e9jwQRb23nfa6c9d-StnImGyFDbSv04uVuxIp5Zms1gNxKKK2Da14B8S4rzVRltdYwam_lDp5XnZAYpQdb76FdIKLaVmqgfwX7XWRxv2322i-vDxRfqNzo_tETKzpVLzfiwQyeyPGLBIO56YJ7eObdv0je81860ppamavo35UgoRdbYaBcoh9QcfylQr66oc6vFWXRcZ_ZT2LawVCWTIy3brGPi6UklfCpIMfIjf7iGdXKHzg.48V1_ALb6US04U3b.5eym8TW_c8SuK0ltJ3rpYIzOeDQz7TALvtu6UG9oMo4vpzs9tX_EFShS8iB7j6jiSdiwkIr3ajwQzaBtQD_A.XFBoMYUZodetZdvTiFvSkQ".into()),
424424
Rate(0, 0),
425425
Text(long_string),
426+
Object("{}".into()),
426427
];
427428

428429
for metric in all_metrics {
@@ -451,6 +452,7 @@ fn correct_order() {
451452
Rate(..) => assert_eq!(14, disc),
452453
Url(..) => assert_eq!(15, disc),
453454
Text(..) => assert_eq!(16, disc),
455+
Object(..) => assert_eq!(17, disc),
454456
}
455457
}
456458
}

third_party/rust/glean-core/src/metrics/boolean.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ impl BooleanMetric {
7474
///
7575
/// # Arguments
7676
///
77-
/// * `glean` - the Glean instance this metric belongs to.
7877
/// * `value` - the value to set.
7978
pub fn set(&self, value: bool) {
8079
let metric = self.clone();
@@ -106,6 +105,15 @@ impl BooleanMetric {
106105
/// Gets the currently stored value as an integer.
107106
///
108107
/// This doesn't clear the stored value.
108+
///
109+
/// # Arguments
110+
///
111+
/// * `ping_name` - the optional name of the ping to retrieve the metric
112+
/// for. Defaults to the first value in `send_in_pings`.
113+
///
114+
/// # Returns
115+
///
116+
/// The stored value or `None` if nothing stored.
109117
pub fn test_get_value(&self, ping_name: Option<String>) -> Option<bool> {
110118
crate::block_on_dispatcher();
111119
crate::core::with_glean(|glean| self.get_value(glean, ping_name.as_deref()))
@@ -118,8 +126,6 @@ impl BooleanMetric {
118126
/// # Arguments
119127
///
120128
/// * `error` - The type of error
121-
/// * `ping_name` - represents the optional name of the ping to retrieve the
122-
/// metric for. inner to the first value in `send_in_pings`.
123129
///
124130
/// # Returns
125131
///

0 commit comments

Comments
 (0)