# Firefox compile-cache benchmark scenario for sccache.
name     = "bench-firefox-sccache"
tags     = ["suite:bench", "project:firefox", "backend:sccache", "lang:cc", "lang:cpp", "lang:rust"]

setup        = ["./mach bootstrap --application-choice browser"]
setup_marker = "~/.mozbuild"

build = "./mach build"

[source]
kind   = "clone"
repo   = "https://github.com/mozilla-firefox/firefox.git"
ref    = "FIREFOX_151_0_RELEASE"
objdir = "obj-sccache-bench"

[[file]]
path    = "mozconfig"
content = """
# Generated by kache-scenario - sccache compile-cache benchmark.
# Optimized, non-debug, no LTO/PGO: representative of a dev build
# and comparable with the kache Firefox benchmark.
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --disable-tests

# Use Firefox's native sccache integration for C/C++ and rustc.
ac_add_options --with-ccache={cache}
mk_add_options "export RUSTC_WRAPPER={cache}"

# Keep the same noise-reduction knobs as the kache Firefox benchmark.
mk_add_options "export CARGO_INCREMENTAL=0"
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/{objdir}

# Pin the Firefox build ID so buildid.cpp / application.ini.h are
# byte-identical across clones.
mk_add_options "export MOZ_BUILD_DATE=20260101000000"
"""

# sccache-owned copies of the Firefox source patches. Keep these separate from
# bench-firefox/patches so kache-vs-sccache patch requirements can diverge and
# remain auditable.
[[file]]
path         = "build/rust/mozbuild/generate_buildconfig.py"
mode         = "patch"
content_file = "patches/firefox-mozbuild-path-clean.patch"

[[file]]
path         = "gfx/wr/webrender/build.rs"
mode         = "patch"
content_file = "patches/firefox-generated-source-relative.patch"

[checks.measure.warm]
min_hit_rate_pct = 50.0
min_speedup = 1.5
