Closed Bug 1430226 Opened 3 years ago Closed 3 years ago

./mach bootstrap fail to set android build environment on mac.

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1427790

People

(Reporter: jya, Unassigned)

Details

Using macOS 10.13.2

./mach bootstrap fail to work due to brew's missing java8 package.

$ ./mach bootstrap
[...]
Please choose the version of Firefox you want to build:
1. Firefox for Desktop Artifact Mode
2. Firefox for Desktop
3. Firefox for Android Artifact Mode
4. Firefox for Android
Your choice: 4

Looks like you have Homebrew installed. We will install all required packages via Homebrew.


We are now installing all required packages via Homebrew. You will see a lot of
output as packages are built.

Error: Cask 'java8' is unavailable: No Cask with this name exists. 
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:

CalledProcessError: Command '[u'/usr/local/bin/brew', u'cask', u'install', u'java8']' returned non-zero exit status 1

  File "/Users/jyavenard/Work/Mozilla/mozilla-central/python/mozboot/mozboot/mach_commands.py", line 32, in bootstrap
    bootstrapper.bootstrap()
  File "/Users/jyavenard/Work/Mozilla/mozilla-central/python/mozboot/mozboot/bootstrap.py", line 297, in bootstrap
    getattr(self.instance, 'install_%s_packages' % application)()
  File "/Users/jyavenard/Work/Mozilla/mozilla-central/python/mozboot/mozboot/osx.py", line 202, in install_mobile_android_packages
    getattr(self, 'ensure_%s_mobile_android_packages' % self.package_manager)()
  File "/Users/jyavenard/Work/Mozilla/mozilla-central/python/mozboot/mozboot/osx.py", line 357, in ensure_homebrew_mobile_android_packages
    installed = self._ensure_homebrew_casks(casks)
  File "/Users/jyavenard/Work/Mozilla/mozilla-central/python/mozboot/mozboot/osx.py", line 315, in _ensure_homebrew_casks
    return self._ensure_homebrew_packages(casks, extra_brew_args=['cask'])
  File "/Users/jyavenard/Work/Mozilla/mozilla-central/python/mozboot/mozboot/osx.py", line 309, in _ensure_homebrew_packages
    subprocess.check_call(cmd + ['install', package])
  File "/usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)


I had to run the following command for brew cask install java8 to succeed:

$ brew tap caskroom/versions
This just happened to me, too (using macOS 10.12 here).

Running

  $ brew tap caskroom/versions

seems to have resolved it for me, but it gave me some frustrating minutes until I found this report. (Thanks, Jean-Yves!)

FWIW, I then also got a failure from the android sdkmanager:

  ...
  We are now installing the following Android packages:
  platform-tools
  build-tools;26.0.2
  platforms;android-23
  extras;android;m2repository
  extras;google;m2repository
  emulator

  You may be prompted to agree to the Android license. You may see some of
  output as packages are downloaded and installed.

  Warning: Unknown argument --package_file=/Users/jkew/mozdev/mozilla-central/python/mozboot/mozboot/android-packages.txt
  Usage: 
    sdkmanager [--uninstall] [<common args>] [--package_file=<file>] [<packages>...]
    sdkmanager --update [<common args>]
    sdkmanager --list [<common args>]
    sdkmanager --licenses [<common args>]
    sdkmanager --version
  ...

Note how it claims --package_file is an unknown argument, despite listing --package_file right there in the usage message!

I got around this by manually calling sdkmanager --install '<package>' for each of the entries from the android-packages.txt file, as it looks like the tool I have is somewhat broken.
nalexander: could you please triage?
Flags: needinfo?(nalexander)
And when doing bug triage I came across bug 1427790. This smells like a duplicate.
Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(nalexander)
Resolution: --- → DUPLICATE
Duplicate of bug: 1427790
(In reply to Jonathan Kew (:jfkthame) from comment #1)
> This just happened to me, too (using macOS 10.12 here).
> 
> Running
> 
>   $ brew tap caskroom/versions
> 
> seems to have resolved it for me, but it gave me some frustrating minutes
> until I found this report. (Thanks, Jean-Yves!)
> 
> FWIW, I then also got a failure from the android sdkmanager:
> 
>   ...
>   We are now installing the following Android packages:
>   platform-tools
>   build-tools;26.0.2
>   platforms;android-23
>   extras;android;m2repository
>   extras;google;m2repository
>   emulator
> 
>   You may be prompted to agree to the Android license. You may see some of
>   output as packages are downloaded and installed.
> 
>   Warning: Unknown argument
> --package_file=/Users/jkew/mozdev/mozilla-central/python/mozboot/mozboot/
> android-packages.txt
>   Usage: 
>     sdkmanager [--uninstall] [<common args>] [--package_file=<file>]
> [<packages>...]
>     sdkmanager --update [<common args>]
>     sdkmanager --list [<common args>]
>     sdkmanager --licenses [<common args>]
>     sdkmanager --version
>   ...
> 
> Note how it claims --package_file is an unknown argument, despite listing
> --package_file right there in the usage message!
> 
> I got around this by manually calling sdkmanager --install '<package>' for
> each of the entries from the android-packages.txt file, as it looks like the
> tool I have is somewhat broken.

Google done goofed.  They released some version of the SDK with a broken sdkmanager, which we then try to use, and it fails.  We could detect the error and try to reinstall the sdkmanager, but I don't think it's worth the effort.  Broken tools are broken, and eventually they won't be found in the wild any more.

Sorry for the inconvenience.
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.