Open Bug 1044247 Opened 10 years ago Updated 2 years ago

Packaging the Fennec app takes too much time

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

All
Android
defect

Tracking

(Not tracked)

People

(Reporter: Margaret, Unassigned)

References

Details

I feel like |mach package| takes a lot longer to complete than it used to. This is the type of thing that gets incrementally worse and worse over time, and I want to know if there's anything we can do to fix it, at least for development builds.

For my local build, I really don't care about optimizing things, I just want to get the build onto my phone as quickly as possible.

rnewman or ckitching, do you have any ideas how we can do this?
Flags: needinfo?(rnewman)
Flags: needinfo?(chriskitching)
Part of the cost is in building GeckoView and JUnit3 APKs.

We also build the GeckoView example. That takes 32 seconds on my machine.

I don't remember if ProGuard runs during package or during build; if it's the former, you can crank down the number of iterations with MOZ_DISABLE_PROGUARD or PROGUARD_PASSES.
Flags: needinfo?(rnewman)
(In reply to Richard Newman [:rnewman] from comment #1)
> Part of the cost is in building GeckoView and JUnit3 APKs.

Personally I'm not clear about much of what happens during the packaging step, though I have a horrible feeling it's not as incremental as I'd hope it was.

I suspect nalexander's your guy. Isn't most of the stuff in there his doing?

> We also build the GeckoView example. That takes 32 seconds on my machine.

Why?

Surely the GeckoView example should be its own build target? We don't actually use it for anything in Fennec, right? It's just for educational purposes for people who want to use GeckoView?

... Should that even be in m-c?

> I don't remember if ProGuard runs during package or during build; if it's
> the former, you can crank down the number of iterations with
> MOZ_DISABLE_PROGUARD or PROGUARD_PASSES.

Proguard runs during build. On a W530 this costs about 4 seconds per pass. You can disable it for your development builds, but this carries a very small risk: If you've added a new entry point to Java and forgotten to annotate it properly you won't notice the failure until you get to try.

Admittedly that's something that people almost never do, so it's probably good general advice for developers to either set Proguard to one pass (which doesn't completely eliminate the above risk, as stuff can be deleted in later passes, but makes it much less likely) or turn it off entirely.

I'll have a gander at what goes on in package and see if I can make a more intelligent comment later. I've been curious about what it does for a while...
Depends on: 1044287
Depends on: 1044291
Filed Bug 1044287 and Bug 1044291 for two faily simple steps that ought to cut down package time by a little over half.
Flags: needinfo?(chriskitching)
(In reply to Chris Kitching [:ckitching] from comment #2)
> > I don't remember if ProGuard runs during package or during build; if it's
> > the former, you can crank down the number of iterations with
> > MOZ_DISABLE_PROGUARD or PROGUARD_PASSES.

Assuming you don't compile with `MOZILLA_OFFICIAL`, this was already disabled for developer builds [1]. It seems you reviewed it in bug 1009732. ;)

[1]: https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/Makefile.in?rev=5853d370248d#132
(In reply to Michael Comella (:mcomella) from comment #4)
> (In reply to Chris Kitching [:ckitching] from comment #2)
> > > I don't remember if ProGuard runs during package or during build; if it's
> > > the former, you can crank down the number of iterations with
> > > MOZ_DISABLE_PROGUARD or PROGUARD_PASSES.
> 
> Assuming you don't compile with `MOZILLA_OFFICIAL`, this was already
> disabled for developer builds [1]. It seems you reviewed it in bug 1009732.
> ;)
> 
> [1]:
> https://mxr.mozilla.org/mozilla-central/source/mobile/android/base/Makefile.
> in?rev=5853d370248d#132

Ah. Interesting!

I forgot that I'd intentionally turned mine back on again while debugging Proguard problems!
Product: Firefox for Android → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.