Closed Bug 1563844 Opened 5 months ago Closed 5 months ago

Add Proguard rule to prevent stripping of org.mozilla.gecko.util.DebugConfig

Categories

(GeckoView :: General, enhancement, P1)

68 Branch
enhancement

Tracking

(firefox68 wontfix, firefox69 wontfix, firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: csadilek, Assigned: Agi)

References

Details

Attachments

(1 file)

We had to add a Proguard rule to Fenix to prevent stripping of DebugConfig's fields. It would be ideal if applications could just inherit this rule from GeckoView.

We ran into this when testing Fenix with the latest Raptor, which writes a *-config.yml file to specify Gecko runtime settings such as the profile dir. DebugConfig isn't a standard POJO and its fields are not accessible from the outside. While it would be possible to refactor DebugConfig so its fields don't get optimized way, the current solution seems better and adding an exlusion rule is preferable.

See: https://github.com/mozilla-mobile/fenix/pull/3911

Anything in org.mozilla.gecko.* is private to GeckoView, will be hidden soon and should not be relied upon, so please don't use it.

Why is it a problem that the DebugConfig class is optimized away?

Flags: needinfo?(csadilek)

:agi Fenix and Android Components are not referencing or relying on this type, but Raptor now writes a *-config.yml file to specify Gecko runtime arguments for performance testing. The .yaml is deserialized into a DebugConfig instance which fails if the type (or its fields) are pruned.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1533385 and https://bugzilla.mozilla.org/show_bug.cgi?id=1552519 for the background on this.

Flags: needinfo?(csadilek)

ooh I see. So it's yaml using reflection or something similar to create the object and ProGuard is not smart enough to know about that. Sounds important.

Priority: -- → P1

Assigning to Agi because he posted a fix.

69=affected because we'll presumably want to uplift this fix to GV 69 Beta for Fenix testing.

Assignee: nobody → agi

Actually I don't think we need to uplift this one as Fenix has a solid workaround (they added the rule to their proguard file).

Attachment #9077465 - Attachment description: Bug 1563844 - Include Proguard rule for DebugConfig. → Bug 1563844 - Add @ReflectionTarget to DebugConfig.
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/224e533c8f87
Add @ReflectionTarget to DebugConfig. r=csadilek,nalexander
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.