Repository navigation
Restrict more patches to the platforms they can affect in build_platforms - #7758
Merged
Merged
Conversation
marco-c
force-pushed
the
build-platforms-android-files
branch
4 times, most recently
from
December 2, 2026 09:24
9b82eab to
c0cdccd
Compare
As for bugbug's other requests, so that they're retried on transient errors (429 and 5xx responses).
…uild_platforms No Searchfox build lists them, so they were considered built on every platform. They are only used by the Android apps and libraries (Fenix, Focus, android-components, GeckoView), except the HTML parser's Java code, which is translated to the C++ code built on every platform. Of the last 3,500 pushes of the group history, 276 are now considered Android-only, against 21.
…s only on Android No Android build lists a file of browser/, and no desktop build a file of mobile/, but their files of types no build lists (e.g. .jsx, .ftl, test manifests) were considered built on every platform. YAML files are still considered shared, as some are code generation inputs used by every product (e.g. browser/base/content/metrics.yaml is in Glean's gecko_metrics). As the other rules, it only applies to the files no build lists, as the builds' lists are accurate. Of the last 3,500 pushes of the group history, 971 are now restricted to some platforms, against 784.
The Android Gradle builds also use files out of mobile/, which the Android build's index doesn't list: e.g. Android Components packages the webcompat extension of browser/, which the previous commit considered desktop-only. The paths they refer to from the source directory are found in the repository when retrieving the built files, and stored with them. If they can't be found, the previous ones are kept, and if they were never found, the browser/ files keep their platforms (as some might be used on Android). Paths the Gradle builds don't refer to anymore are reported (e.g. if a Gradle file refers to one in a way that isn't recognized anymore).
…the products The other YAML files of browser/ and mobile/ (e.g. the desktop Glean metrics, Fenix's Nimbus feature manifests, the vendoring manifests) are only used by their product. The shared ones are taken from mozilla-central's Glean index when retrieving the built files, and stored with them. If they can't be retrieved (or none are found, e.g. if the index can't be parsed anymore), the previous ones are kept, and if they were never retrieved, every YAML file is still considered shared. Of the last 3,500 pushes of the group history, 87 more are now restricted to some platforms.
Wherever they are, the browser-chrome tests (browser_* files of test directories), their manifests (browser*.toml) and the harness files only they use (browser-test.js, browser-harness.xhtml) only run on desktop, except in the web-platform tests. Their support files (e.g. head.js) and the helpers they import (e.g. BrowserTestUtils, also used by chrome mochitests) can be used by other suites, so they're not restricted.
… patch's platforms Developer tools (agent skills, linters and the type stubs they use, Fluent migrations) and docs don't affect the tests' results on any platform, so they don't count when a patch also modifies other files. A patch only modifying them keeps their platforms. Of the last 3,500 pushes of the group history, 30 more are now restricted to some platforms.
…ng the directory A directory's moz.build and jar manifests are only read by the builds building the directory (e.g. widget/gtk/moz.build on Linux), so they get the platforms of the files of their directory, as files of types the builds list. Test manifests don't, as their tests can run on platforms which don't build the files of their directory. Of the 23,986 pushes of the group history, 51 more are now restricted to some platforms.
marco-c
force-pushed
the
build-platforms-android-files
branch
from
December 2, 2026 09:33
c0cdccd to
fec2705
Compare
marco-c
marked this pull request as ready for review
December 2, 2026 09:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build_platformsgives the configuration selection the OS families a patch can break (configs of other families aren't candidates). Files no Searchfox build lists were considered built on every platform, so many Android-only and desktop-only patches weren't restricted. This adds rules for them, one per commit (after a first commit making the module's requests go throughutils.get_session). The rules only apply to files no build lists, as the builds' lists are accurate.Restricted pushes, of the 23,986 pushes of the group history (last 3,500 in parentheses):
gradle/) are only built on Android, except the HTML parser's Java code (translated to C++)browser/files are only built on desktop,mobile/ones only on Android, whatever their type (no Android build lists abrowser/file, no desktop build amobile/one), except YAML filesmobile/are also used on Android, although the Android build's index doesn't list them (e.g. Android Components packagesbrowser/extensions/webcompat). They're the paths the Gradle files refer to from the source directory, found in the repository at boot and on refresh, and stored with the built filesgecko_*lists are shared between the products (the other ones, e.g. desktop metrics, Fenix's Nimbus manifests, are only used by their product). They're fetched from mozilla-central's Glean index with the built filesbrowser_*files of test directories), their manifests (browser*.toml) and the harness files only they use (browser-test.js,browser-harness.xhtml) only run on desktop, except in the web-platform tests. Their support files and helpers (e.g.head.js,BrowserTestUtils) can be used by other suites, so they aren't restrictedmoz.build, jar manifests) get the platforms of their directory, like files of types the builds list (e.g.widget/gtk/moz.build→ Linux). Test manifests don't, as their tests can run on platforms which don't build their directory's filesIn total, 35.2% of the pushes of the group history are restricted to some platforms (5,348 desktop-only, 2,474 Android-only), against 16.4%.
Failures fall back to the previous, more conservative behavior, and are reported (logged as warnings or errors, so sent to Sentry):
browser/rule doesn't apply (7,404 restricted pushes instead of 8,447).The benefit is mostly cost: offline evaluations showed no measurable catch gain from
build_platforms, and desktop failures after Android-only pushes are almost always misattributed. The rules encode build facts (which builds include which files, where suites run), so they're hard rules rather than model features.Not covered:
dom/base/test/mochitest.tomlwould be desktop-only (its directory's built files are), although its tests also run on Android.toolkit/(e.g.ipprotection,ml,formautofill): the Android build packages them, so they can't be restricted from the build lists.