Install Maven repositories during |mach bootstrap| for mobile/android

RESOLVED FIXED in Firefox 39

Status

()

Core
Build Config
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: nalexander, Assigned: Vidit23, Mentored)

Tracking

unspecified
mozilla39
Points:
---

Firefox Tracking Flags

(firefox39 fixed)

Details

(Whiteboard: [lang=python][good first bug])

Attachments

(1 attachment, 1 obsolete attachment)

847 bytes, patch
nalexander
: review+
Details | Diff | Splinter Review
(Reporter)

Description

3 years ago
Most front-end engineers build Fennec with Gradle.  To do so requires two "Maven repository" Android packages, noted in one of the early steps of [1].

This ticket tracks adding those two packages to the list at [2].  To determine the names of the packages, look in the XML files that the |android| tool fetches (they're cached somewhere, maybe in ~/.android).

[1] https://wiki.mozilla.org/Mobile/Fennec/Android/IDEs#Quick_start

[2] https://dxr.mozilla.org/mozilla-central/source/python/mozboot/mozboot/android.py#26
(Assignee)

Comment 1

3 years ago
Hello Nick
This is the first bug I'm trying to solve.
Could you help me out to get started.
Thank You.
(Reporter)

Comment 2

3 years ago
(In reply to Vidit23 from comment #1)
> Hello Nick
> This is the first bug I'm trying to solve.
> Could you help me out to get started.

Sure.  First, do you have a Mac or Linux (Debian/Ubuntu) based system?  This ticket is about |mach bootstrap| for mobile/android, which only works on those two systems (so far).  If so, have you followed the instructions for getting a Fennec build going from [1]?  If you have done so, then we can work on following the steps from https://bugzilla.mozilla.org/show_bug.cgi?id=1121317#c0.

I've given the location of the list (android.py line 26) in that comment.  If you dig in the ~/.android/cache directory, you'll find paths to .xml files that you can download to find the names of the extra Maven repository package names.  Add them to the list and you can start testing to see if the changes install the right packages.

[1] https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec
(Assignee)

Comment 3

3 years ago
I downloaded all the prerequisites but currently can't clone the repo because of unstable internet connection. I can do it on Monday.
I am using Ubuntu.
(Assignee)

Comment 4

3 years ago
(In reply to Nick Alexander :nalexander from comment #2)
> (In reply to Vidit23 from comment #1)
> > Hello Nick
> > This is the first bug I'm trying to solve.
> > Could you help me out to get started.
> 
> Sure.  First, do you have a Mac or Linux (Debian/Ubuntu) based system?  This
> ticket is about |mach bootstrap| for mobile/android, which only works on
> those two systems (so far).  If so, have you followed the instructions for
> getting a Fennec build going from [1]?  If you have done so, then we can
> work on following the steps from
> https://bugzilla.mozilla.org/show_bug.cgi?id=1121317#c0.
> 
> I've given the location of the list (android.py line 26) in that comment. 
> If you dig in the ~/.android/cache directory, you'll find paths to .xml
> files that you can download to find the names of the extra Maven repository
> package names.  Add them to the list and you can start testing to see if the
> changes install the right packages.
> 
> [1] https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec

I followed all the steps listed but I am getting the following error when I try to build.
"configure: error: not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain."
(Reporter)

Comment 5

3 years ago
(In reply to Vidit23 from comment #4)
> (In reply to Nick Alexander :nalexander from comment #2)
> > (In reply to Vidit23 from comment #1)
> > > Hello Nick
> > > This is the first bug I'm trying to solve.
> > > Could you help me out to get started.
> > 
> > Sure.  First, do you have a Mac or Linux (Debian/Ubuntu) based system?  This
> > ticket is about |mach bootstrap| for mobile/android, which only works on
> > those two systems (so far).  If so, have you followed the instructions for
> > getting a Fennec build going from [1]?  If you have done so, then we can
> > work on following the steps from
> > https://bugzilla.mozilla.org/show_bug.cgi?id=1121317#c0.
> > 
> > I've given the location of the list (android.py line 26) in that comment. 
> > If you dig in the ~/.android/cache directory, you'll find paths to .xml
> > files that you can download to find the names of the extra Maven repository
> > package names.  Add them to the list and you can start testing to see if the
> > changes install the right packages.
> > 
> > [1] https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec
> 
> I followed all the steps listed but I am getting the following error when I
> try to build.
> "configure: error: not found. You have to specify
> --with-android-toolchain=/path/to/ndk/toolchain."

Looks like your mozconfig file is not correct.  See https://wiki.mozilla.org/Mobile/Fennec/Android#Preparing_a_Fennec_mozconfig -- you'll have to edit it if you used |mach bootstrap|, but |mach bootstrap| tells you exactly what to put in that file.
(Assignee)

Comment 6

3 years ago
(In reply to Nick Alexander :nalexander from comment #5)
> (In reply to Vidit23 from comment #4)
> > (In reply to Nick Alexander :nalexander from comment #2)
> > > (In reply to Vidit23 from comment #1)
> > > > Hello Nick
> > > > This is the first bug I'm trying to solve.
> > > > Could you help me out to get started.
> > > 
> > > Sure.  First, do you have a Mac or Linux (Debian/Ubuntu) based system?  This
> > > ticket is about |mach bootstrap| for mobile/android, which only works on
> > > those two systems (so far).  If so, have you followed the instructions for
> > > getting a Fennec build going from [1]?  If you have done so, then we can
> > > work on following the steps from
> > > https://bugzilla.mozilla.org/show_bug.cgi?id=1121317#c0.
> > > 
> > > I've given the location of the list (android.py line 26) in that comment. 
> > > If you dig in the ~/.android/cache directory, you'll find paths to .xml
> > > files that you can download to find the names of the extra Maven repository
> > > package names.  Add them to the list and you can start testing to see if the
> > > changes install the right packages.
> > > 
> > > [1] https://wiki.mozilla.org/Mobile/Fennec/Android#Building_Fennec
> > 
> > I followed all the steps listed but I am getting the following error when I
> > try to build.
> > "configure: error: not found. You have to specify
> > --with-android-toolchain=/path/to/ndk/toolchain."
> 
> Looks like your mozconfig file is not correct.  See
> https://wiki.mozilla.org/Mobile/Fennec/Android#Preparing_a_Fennec_mozconfig
> -- you'll have to edit it if you used |mach bootstrap|, but |mach bootstrap|
> tells you exactly what to put in that file.

I was able to build Fennec, there was a mistake in the .mozconfig. I located the the .xml file with the two repositories.
android_m2repository_r11.zip
google_m2repository_r15.zip

After adding the download links of these files to the list, how do i test it?
(Reporter)

Comment 7

3 years ago
Hey, this is actually a little different than I thought.  Run |android list sdk --no-ui --extended --all| to get the list of package names.  Grepping for "repository", I see:

id: 111 or "extra-android-m2repository"
           Local Maven repository for Support Libraries
           Install path: extras/android/m2repository
id: 118 or "extra-google-m2repository"
           Local Maven repository for Google Libraries
           Install path: extras/google/m2repository

So it looks like we need to add "extra-google-m2repository", "extra-android-m2repository" to the list.
(Reporter)

Updated

3 years ago
Flags: needinfo?(viditvineet)

Comment 8

3 years ago
We'd like to work on this bug.
(Reporter)

Comment 9

3 years ago
(In reply to Boyue Hu from comment #8)
> We'd like to work on this bug.

Please do.  You'll need to be able to run the bootstrapper in order to test, so you'll need a Mac or Linux machine.

https://bugzilla.mozilla.org/show_bug.cgi?id=1121317#c0 shows where the new libraries need to go.  https://bugzilla.mozilla.org/show_bug.cgi?id=1121317#c7 shows what the new libraries are called.
(Assignee)

Comment 10

3 years ago
Created attachment 8571152 [details] [diff] [review]
android.py

I apologize for the delay.
How do I test if this works?
Flags: needinfo?(nalexander)
(Reporter)

Comment 11

3 years ago
(In reply to Vidit23 from comment #10)
> Created attachment 8571152 [details] [diff] [review]
> android.py
> 
> I apologize for the delay.
> How do I test if this works?

It's not easy; since it's a small patch, I can more or less tell.  There are a few problems here:

1) you've attached the file, rather than a patch diff.  Look at https://developer.mozilla.org/en/docs/Mercurial_FAQ for help creating a patch.

2) There's an underscore _ where there should be a hyphen -:

chocho:gecko nalexander$ android list sdk --no-ui --extended --all | grep m2
id: 111 or "extra-android-m2repository"
           Install path: extras/android/m2repository
id: 118 or "extra-google-m2repository"
           Install path: extras/google/m2repository

Thanks for working on this.  Looking forward to the next patch!
Flags: needinfo?(nalexander)
(Assignee)

Comment 12

3 years ago
Created attachment 8572797 [details] [diff] [review]
name.patch

I added the repository needed to the list. What else should I do?
Attachment #8571152 - Attachment is obsolete: true
Flags: needinfo?(viditvineet)
(Reporter)

Comment 13

3 years ago
Comment on attachment 8572797 [details] [diff] [review]
name.patch

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

This looks good!
Attachment #8572797 - Flags: review+
(Reporter)

Updated

3 years ago
Assignee: nobody → viditvineet
Status: NEW → ASSIGNED
(Assignee)

Comment 15

3 years ago
Could you point me towards what I should do now?

Thanks for everything
https://hg.mozilla.org/mozilla-central/rev/cf82e9e3737f
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox39: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.