commit 1c68c48f6d838d901f45c2af43db5fbadaa8e7be
parent a80c99ed577d91c78909f004a347563898338a53
Author: Tom Ritter <tom@mozilla.com>
Date: Mon, 29 Dec 2025 20:28:59 +0000
Bug 2005866: Collect the architecture of the FF build r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D276714
Diffstat:
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs b/toolkit/components/resistfingerprinting/UserCharacteristicsPageService.sys.mjs
@@ -843,6 +843,20 @@ export class UserCharacteristicsPageService {
await Services.sysinfo.processInfo.then(r => r.name)
);
Glean.characteristics.cpuArch.set(Services.sysinfo.get("arch"));
+
+ // Collect Firefox binary architecture (can differ from CPU arch)
+ // e.g., x86-64 Firefox via Rosetta 2 on ARM64 Mac
+ let binaryArch = "unknown";
+ try {
+ const xpcomAbi = Services.appinfo.XPCOMABI || "unknown";
+ const is64Bit = Services.appinfo.is64Bit ? "true" : "false";
+ // Concatenate both values for robustness
+ binaryArch = `xpcomabi:${xpcomAbi}|is64bit:${is64Bit}`;
+ } catch (e) {
+ lazy.console.error("Failed to get Firefox binary architecture:", e);
+ binaryArch = "error";
+ }
+ Glean.characteristics.firefoxBinaryArch.set(binaryArch);
}
async populateWebGlInfo(window, document, version, forceSoftwareRendering) {
diff --git a/toolkit/components/resistfingerprinting/metrics.yaml b/toolkit/components/resistfingerprinting/metrics.yaml
@@ -3987,6 +3987,28 @@ characteristics:
data_sensitivity:
- technical
+ firefox_binary_arch:
+ type: string
+ description: >
+ Architecture of the Firefox binary itself (not the CPU). This can differ
+ from cpu_arch when running under emulation (e.g., x86-64 Firefox via
+ Rosetta 2 on ARM64 Mac) or when running 32-bit Firefox on 64-bit CPU.
+ Format: "xpcomabi:<abi>|is64bit:<bool>" where abi is from XPCOMABI
+ (e.g., "Darwin_x86_64-gcc3") and is64bit indicates 64-bit build.
+ lifetime: application
+ send_in_pings:
+ - user-characteristics
+ notification_emails:
+ - tom@mozilla.com
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1879151
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=2005866
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=2005866
+ expires: never
+ data_sensitivity:
+ - technical
+
mathml1:
type: string
description: >