Closed Bug 1084516 Opened 10 years ago Closed 10 years ago

CPU_ABI in Build has been deprecated

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(firefox34 fixed, firefox35 fixed, firefox36 fixed)

RESOLVED FIXED
Firefox 36
Tracking Status
firefox34 --- fixed
firefox35 --- fixed
firefox36 --- fixed

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

Attachments

(2 files, 1 obsolete file)

generated/org/mozilla/gecko/mozglue/GeckoLoader.java:285: warning: [deprecation] CPU_ABI in Build has been deprecated
         final String abi = android.os.Build.CPU_ABI;
This patch:

* Extends Versions to know about Lollipop.
* Switches to using the Lollipop CPU_ABI alternative:

  public static final String[] SUPPORTED_ABIS
  Added in API level 21

  An ordered list of ABIs supported by this device. The most preferred ABI is the first element in the list. See SUPPORTED_32_BIT_ABIS and SUPPORTED_64_BIT_ABIS.
Attachment #8507204 - Flags: review?(snorp)
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Comment on attachment 8507204 [details] [diff] [review]
Don't blindly use Build.CPU_ABI. v1

Review of attachment 8507204 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/mozglue/GeckoLoader.java.in
@@ +274,5 @@
> +    }
> +
> +    @TargetApi(21)
> +    private static final String getFirstSupportedABI() {
> +        return android.os.Build.SUPPORTED_ABIS[0];

I don't know about this. I think what we currently have is wrong, and this doesn't improve things.

We should put whatever ABI we are actually building against into AppConstants, and then make sure that value appears in this list (or matches CPU_ABI/CPU_ABI2 in older versions). That is the only way things will work, after all.
Attachment #8507204 - Flags: review?(snorp) → review-
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #2)
> … and this doesn't improve things.

Well, it does, in that it avoids the deprecation warning, and thus allows the build to complete with current tools! But I see your point.

Would you rather:

* Apply the deprecation warning directly to each location that uses CPU_ABI, masking the error and not changing behavior, filing a follow-up;

* Extract a helper method (that still only uses CPU_ABI) and annotate that (which is what Chromium did: <https://chromium.googlesource.com/chromium/src/+/3a65f0bdd05251c15adc454a74bce0c0b83d24aa%5E!/#F0>), again filing a follow-up, or

* Steal this and implement your preferred fix Right Sharpish® on Monday morning?
Flags: needinfo?(snorp)
Depends on: 1085514
(In reply to Richard Newman [:rnewman] from comment #3)
> (In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #2)
> > … and this doesn't improve things.
> 
> Well, it does, in that it avoids the deprecation warning, and thus allows
> the build to complete with current tools! But I see your point.
> 
> Would you rather:
> 
> * Apply the deprecation warning directly to each location that uses CPU_ABI,
> masking the error and not changing behavior, filing a follow-up;
> 
> * Extract a helper method (that still only uses CPU_ABI) and annotate that
> (which is what Chromium did:
> <https://chromium.googlesource.com/chromium/src/+/
> 3a65f0bdd05251c15adc454a74bce0c0b83d24aa%5E!/#F0>), again filing a
> follow-up, or

I guess this one is ok for now.

> 
> * Steal this and implement your preferred fix Right Sharpish® on Monday
> morning?
Flags: needinfo?(snorp)
As you wish, my lord.
Attachment #8508182 - Flags: review?(snorp)
Attachment #8507204 - Attachment is obsolete: true
Attachment #8508182 - Flags: review?(snorp) → review+
https://hg.mozilla.org/mozilla-central/rev/d1ec40c7156e
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 36
This patch applies cleanly to (at least) the beta branch (firefox-34) and fixes the same issue that occurs when building against that branch as well.  I haven't tested if the patch applies cleanly to aurora (firefox-35), but I would assume that it does.
Comment on attachment 8508182 [details] [diff] [review]
Wrap Build.CPU_ABI access in deprecation annotation. v2

Approval Request Comment
[Feature/regressing bug #]:
  Android tool change.

[User impact if declined]:
  Developers can't build Aurora or Beta with current Android tools.

[Describe test coverage new/current, TBPL]:
  N/A

[Risks and why]: 
  No risk. Just adds a deprecation annotation.
[String/UUID change made/needed]:
Attachment #8508182 - Flags: approval-mozilla-beta?
Attachment #8508182 - Flags: approval-mozilla-aurora?
Comment on attachment 8508182 [details] [diff] [review]
Wrap Build.CPU_ABI access in deprecation annotation. v2

Beta+
Aurora+
Attachment #8508182 - Flags: approval-mozilla-beta?
Attachment #8508182 - Flags: approval-mozilla-beta+
Attachment #8508182 - Flags: approval-mozilla-aurora?
Attachment #8508182 - Flags: approval-mozilla-aurora+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: