Closed Bug 1550146 Opened 5 years ago Closed 5 years ago

Make 'mach package' part of 'mach build' for mobile/android


(GeckoView :: General, enhancement, P3)



(firefox68 wontfix, firefox69 wontfix, firefox70 fixed)

Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- fixed


(Reporter: snorp, Assigned: nalexander)


(Blocks 5 open bugs)



(2 files)

I don't think I have ever run 'mach build' w/o 'mach package'. We should just put it all in the same command.

Nick, is this reasonable?

Flags: needinfo?(nalexander)

(In reply to James Willcox (:snorp) ( (he/him) from comment #1)

Nick, is this reasonable?

We could definitely make mach build also do mach package for certain apps, namely mobile/android. But (part of) the reason this all sucks so much is that no other app regularly packages as part of development at all; local builds of Desktop use a flat format, not an omnijar, and hence don't need to package. (Or to produce an APK.)

Technically this is still very hard; that's why we still have packaging at all.

We already fold packaging into the Gradle commands -- under the hood, we're running mach build faster and mach stage-package -- it just isn't all there for non-artifact builds. We could improve that.

But making mach build also do mach package, at least for local builds -- yeah, that's not too hard.

Flags: needinfo?(nalexander)

Or include mach package into mach run?

Type: defect → enhancement
Priority: -- → P3

(In reply to Chris Peterson [:cpeterson] from comment #3)

Or include mach package into mach run?

This is the prize winning idea so far. I recall another conversation where gbrown (I think) was saying that we should make mach run install GVE (more generally, the target), and I didn't want to do that across the board; but this convinces me that I am wrong.

The principle concern that I voice in is that changing mach build could have unintended consequences. But nobody really uses mach run on Android (and my work on Bug 1521996 has stalled) so we can radically change what mach run means without fear of consequences.

I will take this as a call to revisit Bug 1521996 and make ./mach run be "get this built object directory onto the device and invoke the target". Thanks, Chris!

Summary: Make 'mach package' part of 'mach build' → Make 'mach package' part of 'mach run'
See Also: → 1547769
Blocks: 1570400

Android artifacts (GeckoView AARs, GeckoViewExample (and Fennec) APKs)
require native libraries ( and an omnijar (omni.ja).
These are produced by mach package. Engineers essentially never
want a build without a package for mobile/android. This adds
mobile/android-only tiers that run mach package and then mach android assemble-app. The latter consumes and omni.ja
to produce all the things relevant to GeckoView engineers.

Depends on D41449

Attachment #9084432 - Attachment description: Bug 1550146 - Part 2: Make mach "build" run "package && android assemble-app" for mobile/android. r?#build → Bug 1550146 - Part 2: Make mach "build" run "stage-package && android assemble-app" for mobile/android. r?#build

(In reply to Nick Alexander :nalexander [he/him] from comment #7)

Fresh try is percolating at

This is looking good. The Ngv orange is Bug 1573751.

Pushed by
Part 1: Do less (no in local `mach package`. r=chmanchester
Part 2: Make mach "build" run "stage-package && android assemble-app" for mobile/android. r=glandium

So, after all the discussion, we ended up doing what was originally asked for, which is to package (really, stage-package, for technical reasons) during mach build. That allows us to run mach android assemble-app during mach build (and after stage-package), which makes mach build produce All The Things for GeckoView and unlocks deeper simplifications in the future.

Summary: Make 'mach package' part of 'mach run' → Make 'mach package' part of 'mach build' for mobile/android
Assignee: nobody → nalexander
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Blocks: 1576001
Blocks: 1580995
Blocks: 1586948
Regressions: 1616704
You need to log in before you can comment on or make changes to this bug.