Update Searchfox indexing to include AC/Fenix/Focus
Categories
(Firefox Build System :: Android Studio and Gradle Integration, enhancement, P2)
Tracking
(firefox132 fixed)
Tracking | Status | |
---|---|---|
firefox132 | --- | fixed |
People
(Reporter: RyanVM, Assigned: nicolas.guichard)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
I was looking at updating the semanticdb-javac dependency to the latest version and was discussing with asuth how to verify that things work correctly afterwards. During the course of that conversation, it came to light that the Android semanticdb files generated by the indexing job only include GV and related projects but nothing for AC/Fenix/Focus. That seems like something we'd ideally like to improve as a benefit of everything living in one repo?
Comment 1•10 months ago
|
||
(For clarity, I think all of the changes would happen in m-c as changes to the gradle semanticdb stuff or the packaging logic. Searchfox just unzips the file and runs scip-java on the semanticdb files to build a monolithic java.scip file that will subsequently be processed via scip-indexer into searchfox analysis files.)
Comment 3•10 months ago
|
||
This would be an important enhancement for Android engineers, since we previously were able to take advantage of this kind of functionality in Github.
![]() |
||
Comment 4•10 months ago
|
||
I think the issue here is that we rely on "mach android compile-all":
https://searchfox.org/mozilla-central/rev/6121b33709dd80979a6806ff59096a561e348ae8/toolkit/mozapps/installer/packager.mk#98
which only runs geckoview tasks:
https://searchfox.org/mozilla-central/rev/55b8c839700564409af5295286a1fd389410e19b/mobile/android/gradle.configure#515-530
Comment 5•8 months ago
|
||
We have a contractor starting now who can help with this in the short term; is this something you're still interested in pursuing, or is it okay if the contractor takes the bug over?
Comment 6•8 months ago
•
|
||
No problem at all if this person takes this bug over
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Comment 7•8 months ago
|
||
This extends the mach android compile-all
command introduced in
https://phabricator.services.mozilla.com/D192925 to ensure that the
other android targets are built and indexed by Searchfox.
The code is refactored a bit to reduce duplication. It now assumes that
build_config.geckoview == build_config.geckoview_example and that the
same variant is used for Fenix/Focus/Klar.
The searchfox-android task is switched to the online gradle environment
for pip install glean_parser
to work as it does not seem to be
available otherwise.
Assignee | ||
Comment 8•8 months ago
|
||
This ensures that Android builds that use the offline gradle profile
can install glean_parser.
Updated•8 months ago
|
Comment 9•8 months ago
|
||
Comment on attachment 9411279 [details]
Bug 1893181 - Force the Glean Gradle Plugin to use our vendored glean_parser in offline mode. r=nalexander!
Revision D215795 was moved to bug 1906365. Setting attachment 9411279 [details] to obsolete.
Comment 10•7 months ago
|
||
Comment 11•7 months ago
|
||
Backed out 2 changesets (bug 1906365, bug 1893181) for causing mass android-all build bustages.
[task 2024-08-15T16:15:31.933Z] To suppress this warning, add/update
[task 2024-08-15T16:15:31.933Z] android.suppressUnsupportedCompileSdk=35
[task 2024-08-15T16:15:31.933Z] to this project's gradle.properties.
[task 2024-08-15T16:15:32.233Z]
[task 2024-08-15T16:15:32.233Z] FAILURE: Build failed with an exception.
[task 2024-08-15T16:15:32.233Z]
[task 2024-08-15T16:15:32.233Z] * What went wrong:
[task 2024-08-15T16:15:32.233Z] Could not determine the dependencies of task ':support-test:extractDebugAnnotations'.
[task 2024-08-15T16:15:32.233Z] > Failed to find Build Tools revision 34.0.0
[task 2024-08-15T16:15:32.233Z]
[task 2024-08-15T16:15:32.233Z] * Try:
[task 2024-08-15T16:15:32.233Z] > Run with --stacktrace option to get the stack trace.
[task 2024-08-15T16:15:32.233Z] > Run with --info or --debug option to get more log output.
[task 2024-08-15T16:15:32.234Z] > Run with --scan to get full insights.
[task 2024-08-15T16:15:32.234Z] > Get more help at https://help.gradle.org.
[task 2024-08-15T16:15:32.234Z]
[task 2024-08-15T16:15:32.234Z] Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
[task 2024-08-15T16:15:32.234Z]
[task 2024-08-15T16:15:32.234Z] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[task 2024-08-15T16:15:32.234Z]
[task 2024-08-15T16:15:32.234Z] For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
[task 2024-08-15T16:15:32.234Z]
[task 2024-08-15T16:15:32.234Z] BUILD FAILED in 1m 27s
[task 2024-08-15T16:15:32.234Z] 10 actionable tasks: 10 executed
[taskcluster 2024-08-15 16:15:33.105Z] === Task Finished ===
Comment 13•6 months ago
|
||
Comment 14•6 months ago
|
||
bugherder |
Reporter | ||
Comment 15•6 months ago
|
||
Can we verify that the indexing is now working as expected? I did a quick sampling of a couple different Fenix .kt files but don't see a change in presentation from before this landed.
Reporter | ||
Comment 16•6 months ago
|
||
Ugh, from today's run:
[task 2024-09-11T11:08:42.670Z] 11:08:42 INFO - package> FAILURE: Build failed with an exception.
[task 2024-09-11T11:08:42.670Z] 11:08:42 INFO - package>
[task 2024-09-11T11:08:42.670Z] 11:08:42 INFO - package> * What went wrong:
[task 2024-09-11T11:08:42.671Z] 11:08:42 INFO - package> Could not determine the dependencies of task ':browser-domains:compileDebugJavaWithJavac'.
[task 2024-09-11T11:08:42.671Z] 11:08:42 INFO - package> > Failed to find Build Tools revision 34.0.0
https://firefoxci.taskcluster-artifacts.net/H527cpE2T8227-hQ4aPnBg/0/public/logs/live_backing.log
Reporter | ||
Updated•6 months ago
|
Assignee | ||
Comment 17•6 months ago
|
||
It seems the changes I made to enforce buildToolsVersion for AC/Fenix/Focus didn't cover the case of building from the toplevel Gradle project, and I didn't notice because mach android compile-all
didn't fail when the Gradle build failed.
I'll send patches for review if that Try run passes.
Comment hidden (obsolete) |
Assignee | ||
Comment 19•6 months ago
|
||
Yes the second commit in that Try run should cover that for mach android compile-all
.
I see there are however a couple of other commands in android/mach_commands.py
like build-geckoview_example
that unconditionally return 0
.
Assignee | ||
Comment 20•6 months ago
|
||
The resolution of bug 1906365 was incomplete, the buildToolsVersion was
not enforced when building AC, Fenix or Focus from the toplevel Gradle
project.
Assignee | ||
Comment 21•6 months ago
|
||
The issue fixed by parent commit was not caught by the CI because
mach android compile-all
didn't fail when the Gradle build failed.
Comment 22•6 months ago
|
||
Comment 23•6 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d731e2204fc6
https://hg.mozilla.org/mozilla-central/rev/2f81634f5419
Comment 24•6 months ago
•
|
||
This seems like it's working great, wooo!
I think I need to add ontology mappings to teach searchfox about Java runnables and the Android ListenableWorker thing. Like the diagram calls-to:'org::mozilla::fenix::utils::NotificationBaseKt::createBaseNotification' depth:4 is neat, but it hits a wall because of this newfangled async programming, it seems like.
I'll also see if there's an easy way to provide some glue for the GeckoThread. Because of the recent ContentChild weird crash bug 1915788 I wanted to see if calls-to:NS_InitXPCOM could get into fenix, but because there's a static INSTANCE we lose the trail. A search on re:private static final .+ INSTANCE finds no false positives for a singleton idiom, so maybe a rule on fields named INSTANCE with a type_pretty prefix of private static final
could work[1].
1: GeckoThread's structured JSON is:
{"loc":"00135:35-43","structured":1,"pretty":"org::mozilla::gecko::GeckoThread::INSTANCE","sym":"S_jvm_org/mozilla/gecko/GeckoThread#INSTANCE.","type_pretty":"private static final GeckoThread INSTANCE","kind":"field","subsystem":null,"parentsym":"S_jvm_org/mozilla/gecko/GeckoThread#","implKind":"impl","sizeBytes":null,"ownVFPtrBytes":null,"bindingSlots":[],"ontologySlots":[],"supers":[],"methods":[],"fields":[],"overrides":[],"props":[],"variants":[]}
which doesn't provide a ton of extra metadata to key on versus what we get from our clang indexer (which makes sense).
Description
•