Closed Bug 1883086 Opened 9 months ago Closed 2 months ago

Consider adding a Mach Install Command for different Android Apps

Categories

(Fenix :: Tooling, enhancement)

All
Android
enhancement

Tracking

(firefox132 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
firefox132 --- fixed

People

(Reporter: olivia, Assigned: adhingra, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [avocado sprint])

Attachments

(1 file, 1 obsolete file)

It is possible to install GeckoView Example on a device using ./mach install (when configured for Android).

It would be a nice feature to do the same for all of the other builds we offer.

For example:

  • mach install geckoview-example
  • mach install reference-browser
  • mach install fenix
  • mach install focus

When building Firefox for desktop, the expectation is that mach build and mach run will build and start the application. Currently when building mobile/android, mach build and mach run build and start GeckoView.
I think building and running Fenix by default might be more useful.

The typical way to select which application is built is to add an ac_add_options --enable-project= line in the mozconfig file. This is documented at https://searchfox.org/mozilla-central/source/docs/setup/configuring_build_options.rst#151
I think adding for example ac_add_options --enable-project=mobile/android/focus to the mozconfig file should make it so that mach build and mach run (re)build and start Focus.

Duplicate of this bug: 1826801

Discussed with :Sylvestre, :glandium, and :florian. If mach build generates Fenix from the ground up, we would be able to get a performance profile for free. This means, we would be able to understand where the time is spent and then optimize it. This would benefit local development workflow as well as CI jobs. Given the fact the CI turn around time was a concern a few weeks before the migration, I think this would be worth considering in the foreseeable future. How does that sound to you, :jmahon?

Flags: needinfo?(jmahon)

Speaking of build performance, bug 1887646 highlighted a recent regression when mach building Geckoview example.

See Also: → 1887646

That seems practical. :gl, can you help figure out where this fits into our priorities, and if possible, find someone to assign it to?

Flags: needinfo?(jmahon) → needinfo?(gl)
See Also: → 1891539

Something like ./mach run --app=fenix should also be considered. (Likely connected to the same command as ./mach install, just to be parallel with Desktop.)

To clarify comment 1: the build system doesn't have the notion of building multiple applications. So the solution, from a build system perspective, as noted in that comment, would be to build only one application, and allow selecting which one specifically you want to build in the first place, rather than gradle somehow allowing to build them all, creating a situation that the build system can't handle.

Duplicate of this bug: 1899506
Assignee: nobody → adhingra

A few notes from call with :nalexander:

  • Start with adding parameters in mach build, mach run, mach install commands
  • Consider a “default sub-project” setting that is in moz.configure. Default it to geckoview, but accept fenix, focus.
  • Try to work on gradle layer rather than using ac_add_options --enable-project= in mozconfig
Whiteboard: [avocado sprint]
Pushed by ohall@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f03343ca4306 Adding a Mach Install Command for different Android Apps. r=firefox-build-system-reviewers,nalexander
Attachment #9417319 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

Aaditya, was there a reason why for eg. Fenix we have to use --app=fenix? When you want to install the TestRunner or GeckoView example the full package name is needed. So it feels a bit strange that this is not needed for Fenix and causes failures running the command. Thanks.

Flags: needinfo?(adhingra)

Hey, it was more for simplicity, you could still run --app=org.mozilla.fenix.debug and it will give the same result! --app=fenix is just an alias of sort. Can you please share what failures are you getting ?

Flags: needinfo?(adhingra)

(In reply to Aaditya Dhingra [:adhingra] from comment #15)

Hey, it was more for simplicity, you could still run --app=org.mozilla.fenix.debug and it will give the same result! --app=fenix is just an alias of sort. Can you please share what failures are you getting ?

So I've several questions. Based on that I'm on an artifact opt build the following happens:

  1. I expected that when using --app=org.mozilla.fenix it installs the build from the current obj dir but it fails
  2. Using --app=org.mozilla.fenix_release works but installs the debug build (fenix-fenix-arm64-v8a-debug.apk)?
  3. Using --app=fenix installs the debug build as well.
  4. Should we create shortcuts for the other types as well?
  5. Can we have a documentation update that instructs how to install the different package types?

I'm happy to file one or more new bugs depending on the above questions.

I expected that when using --app=org.mozilla.fenix it installs the build from the current obj dir but it fails

I apologize, I don't understand what you mean here. From your other questions, I am assuming you are able to install a debug build, is that right ? If yes what/when is it failing ? Do you have any stacktrace you can share or a command that I can try running ?

Currently, we only added debug build option for fenix and focus in this patch. We are also working to add release build for fenix (and poosiby focus) in 1891159. The plan was to add documentation/make an announcement once release build patch also lands.

The new commands added in this patch are:

./mach install --app=fenix
./mach install --app=focus
./mach run --app=fenix
./mach run --app=focus

1891159 will add commands like:

./mach install --app=org.mozilla.fenix.release
./mach run --app=org.mozilla.fenix.release

From my understanding, the default/fallback option would always be the debug build, meaning if app name is not specified exactly as org.mozilla.fenix.release but contains fenix it will install default build

Please feel free to create more bugs and cc me, in case we are missing anything!

Flags: needinfo?(hskupin)

(In reply to Aaditya Dhingra [:adhingra] from comment #17)

Please feel free to create more bugs and cc me, in case we are missing anything!

Sorry for the delay here. I just filed bug 1927837 and I think that the issues above are actually covered by this.

Flags: needinfo?(hskupin)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: