Closed Bug 1171232 Opened 9 years ago Closed 9 years ago

`./mach bootstrap` fails while installing android tools

Categories

(Firefox Build System :: General, defect)

All
macOS
defect
Not set
normal

Tracking

(firefox44 fixed)

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: mcomella, Assigned: nalexander)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file Failure output
The error is:

  Skipping 'Android SDK Tools, revision 24.3'; it depends on 'Android SDK Platform-tools, revision 23 rc1' which was not installed.
i.e. we're not installing platform tools.

The issue here is that we search for `"%s" % package in line` [1] (i.e. "platform-tools", including the quotes) when the latest Android SDK has only "platform-tools-preview" available from the output of `android list sdk --no-ui --extended`.

[1]: http://mxr.mozilla.org/mozilla-central/source/python/mozboot/mozboot/android.py#112
Solution is likely to take tools out because the SDK comes with it.

See discussion via IRC:

 <mcomella> nalexander: It's currently divided by component (e.g. tools, platform-tools, build-tools, etc.) with most recent to least so that's good
16:53 <nalexander> mcomella: mmm.  A comment about ordering or something like that, and then taking the first, could work.
16:53 <nalexander> mcomella: doesn't have to be amazingly robust.
17:21 <mcomella> nalexander: Okay, there are weird dependencies here and I can't get this to work - the latest SDK tools depend on the preview build tools, and I think android gives up if it can't install a listed package
17:21 <mcomella> nalexander: And because we're now installing the first item in the list, it tries to install the latest SDK tools
17:21 <mcomella> nalexander: I could version them, I suppose
17:22 <mcomella> Actually, nvm, it doesn't let me version them
17:23 <mcomella> nalexander: I think the current version tools came pre-installed
17:23 <mcomella> nalexander: So we don't actually need tools?
(In reply to Michael Comella (:mcomella) from comment #2)
> Solution is likely to take tools out because the SDK comes with it.

Got some errors when I did this - I'm just going to install manually.
Google keeps changing the paradigm on us here - why don't we just have mach bootstrap spit out, "Use `android` to install these tools with roughly these versions - try not to install any previews."
Is this a dupe of bug 1162000?
(In reply to Mike Hommey [:glandium] from comment #6)
> Is this a dupe of bug 1162000?

No, but bug 1162000 will be fixed by bug 1165422.
(In reply to Michael Comella (:mcomella) from comment #5)
> Google keeps changing the paradigm on us here - why don't we just have mach
> bootstrap spit out, "Use `android` to install these tools with roughly these
> versions - try not to install any previews."

Or we can prompt the user, "We can install everything (take up space but no bugs), install some things (take less space but potentially fail, e.g. this bug), or you can install manually (same less space, but it's on you)."

Though maybe this is too complex considering how simple `mach bootstrap` is intended to be?
I see a different problem -- installation went fine, but I don't actually have the new package.  I think this is because brew installed the SDK into a new location, and some of my configuration is out of date.

nalexander@chocho ~/M/gecko> ./mach gradle clean app:packageDebug
From /Users/nalexander/Mozilla/gecko/objdir-droid/mobile/android/gradle: Kept 49 existing; Added/updated 0; Removed 0 files and 0 directories.
Parallel execution is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > failed to find Build Tools revision 22.0.1
   > Task with name 'spoonDebugAndroidTest' not found in project ':app'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1.621 secs
Hit this bug with a slightly different error message:

Installing Archives:
  Preparing to install archives
  Downloading SDK Platform Android 5.1.1, API 22, revision 2
  Installing SDK Platform Android 5.1.1, API 22, revision 2
    Installed SDK Platform Android 5.1.1, API 22, revision 296%)
  Downloading Android Support Repository, revision 16
  Installing Android Support Repository, revision 16
    Installed Android Support Repository, revision 1699%)
  Downloading Android Support Library, revision 22.2.1
  Installing Android Support Library, revision 22.2.1
    Installed Android Support Library, revision 22.2.193%)
  Downloading Google Play services, revision 25
  Installing Google Play services, revision 25
    Installed Google Play services, revision 2597%)
  Downloading Google Repository, revision 19
  Installing Google Repository, revision 19
    Installed Google Repository, revision 1999%)
  Skipping 'Android SDK Tools, revision 24.3.3'; it depends on 'Android SDK Platform-tools, revision 23 rc4' which was not installed.
  Done. 5 packages installed.
Error running mach:

    ['bootstrap']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

Exception: 
We tried to install the following Android packages:
tools, android-22, extra-android-m2repository, extra-android-support, extra-google-google_play_services, extra-google-m2repository
But it looks like we couldn't install:
tools
Install these Android packages manually and run this bootstrapper again.


  File "/home/froydnj/src/gecko-dev.git/python/mozboot/mozboot/mach_commands.py", line 23, in bootstrap
    bootstrapper.bootstrap()
  File "/home/froydnj/src/gecko-dev.git/python/mozboot/mozboot/bootstrap.py", line 134, in bootstrap
    getattr(self.instance, 'install_%s_packages' % application)()
  File "/home/froydnj/src/gecko-dev.git/python/mozboot/mozboot/debian.py", line 122, in install_mobile_android_packages
    android.ensure_android_packages(android_tool=android_tool)
  File "/home/froydnj/src/gecko-dev.git/python/mozboot/mozboot/android.py", line 212, in ensure_android_packages
    raise Exception(MISSING_ANDROID_PACKAGES % (', '.join(missing), ', '.join(failing)))
Similar issue except with Android SDK Platform-tools, revision 23 rc5. According to Android SDK Manager I already have this installed.

OS: Xubuntu 15.04


Installing Archives:
  Preparing to install archives
  Skipping 'Android SDK Tools, revision 24.3.3'; it depends on 'Android SDK Platform-tools, revision 23 rc5' which was not installed.
  Done. Nothing was installed.
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Error running mach:

    ['bootstrap']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

Exception: 
We tried to install the following Android packages:
tools
But it looks like we couldn't install:
tools
Install these Android packages manually and run this bootstrapper again.


  File "/home/aaronraimist/mozilla-central/python/mozboot/mozboot/mach_commands.py", line 23, in bootstrap
    bootstrapper.bootstrap()
  File "/home/aaronraimist/mozilla-central/python/mozboot/mozboot/bootstrap.py", line 134, in bootstrap
    getattr(self.instance, 'install_%s_packages' % application)()
  File "/home/aaronraimist/mozilla-central/python/mozboot/mozboot/debian.py", line 123, in install_mobile_android_packages
    android.ensure_android_packages(android_tool=android_tool)
  File "/home/aaronraimist/mozilla-central/python/mozboot/mozboot/android.py", line 212, in ensure_android_packages
    raise Exception(MISSING_ANDROID_PACKAGES % (', '.join(missing), ', '.join(failing)))
Today boostrap worked well:
Information:
Used by: 
 - Android SDK Tools, revision 24.3.3
  - SDK Platform Android 5.1.1, API 22, revision 2
  - Android Support Repository, revision 16
  - Android Support Library, revision 22.2.1
  - Google Play services, revision 25
  - Google Repository, revision 19
Bug 1171232 - Part 1: Don't check for missing and failing Android packages. r=mcomella

The behaviour of the |android| tool has changed; recent versions don't
appear to reveal what packages are installed.  That means we can't
skip already installed packages; and we can't really tell if our
installation attempts succeeded.  But we have faith!
Attachment #8648191 - Flags: review?(michael.l.comella)
Bug 1165460 - Upgrade mozboot to Android NDK r10e.  WIP!
Comment on attachment 8648191 [details]
MozReview Request: Bug 1171232 - Depend on platform-tools-preview; don't check for missing and failing Android packages. r?mcomella

Bug 1171232 - Part 1: Don't check for missing and failing Android packages. r=mcomella

The behaviour of the |android| tool has changed; recent versions don't
appear to reveal what packages are installed.  That means we can't
skip already installed packages; and we can't really tell if our
installation attempts succeeded.  But we have faith!
Attachment #8648191 - Flags: review?(michael.l.comella)
Comment on attachment 8648191 [details]
MozReview Request: Bug 1171232 - Depend on platform-tools-preview; don't check for missing and failing Android packages. r?mcomella

Bug 1171232 - Depend on platform-tools-preview; don't check for missing and failing Android packages. r?mcomella

The 'tools' package depends on 'platform-tools-preview' now.  Roll
with it until Google breaks us back again.

The behaviour of the |android| tool has changed; recent versions don't
reveal what packages are installed.  That means we can't skip already
installed packages; and we can't really tell if our installation
attempts succeeded.  But we have faith!
Attachment #8648191 - Attachment description: MozReview Request: Bug 1171232 - Part 1: Don't check for missing and failing Android packages. r=mcomella → MozReview Request: Bug 1171232 - Depend on platform-tools-preview; don't check for missing and failing Android packages. r?mcomella
Attachment #8648191 - Flags: review?(michael.l.comella)
Attachment #8648192 - Attachment is obsolete: true
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
This implementation builds on the patches in bug 1204260 and bug 1108782.
Depends on: 1204260, 1108782
Comment on attachment 8648191 [details]
MozReview Request: Bug 1171232 - Depend on platform-tools-preview; don't check for missing and failing Android packages. r?mcomella

https://reviewboard.mozilla.org/r/16141/#review17997

Seems reasonable.
Attachment #8648191 - Flags: review?(michael.l.comella) → review+
https://hg.mozilla.org/mozilla-central/rev/9cc48934efe8
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: