Closed Bug 1545161 Opened 1 year ago Closed 1 year ago

Bootstrap for android cannot install java8 on macos anymore

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

defect
Not set

Tracking

(firefox68 fixed)

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: jbuck, Assigned: past)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

$ python bootstrap.py 

Note on Artifact Mode:

Artifact builds download prebuilt C++ components rather than building
them locally. Artifact builds are faster!

Artifact builds are recommended for people working on Firefox or
Firefox for Android frontends, or the GeckoView Java API. They are unsuitable
for those working on C++ code. For more information see:
https://developer.mozilla.org/en-US/docs/Artifact_builds.

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

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

Updating Homebrew...

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

==> Caveats
Installing java8 means you have AGREED to the license at:
  https://www.oracle.com/technetwork/java/javase/terms/license/javase-license.html

==> Satisfying dependencies
==> Downloading https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg
==> Downloading from https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg?AuthParam=1555520947_840bda27c11cc8482ce4edbfbd708775

curl: (22) The requested URL returned error: 404 Not Found
Error: Download failed on Cask 'java8' with message: Download failed: https://download.oracle.com/otn-pub/java/jdk/8u202-b08/1961070e4c9b4e26a04e7f5a083f551e/jdk-8u202-macosx-x64.dmg
Traceback (most recent call last):
  File "bootstrap.py", line 181, in <module>
    sys.exit(main(sys.argv))
  File "bootstrap.py", line 172, in main
    dasboot.bootstrap()
  File "/var/folders/kk/6ds8tcz13vb62cj73z05fdsc0000gn/T/tmpOAjjz0/mozboot/bootstrap.py", line 429, in bootstrap
    
  File "/var/folders/kk/6ds8tcz13vb62cj73z05fdsc0000gn/T/tmpOAjjz0/mozboot/osx.py", line 206, in install_mobile_android_artifact_mode_packages
  File "/var/folders/kk/6ds8tcz13vb62cj73z05fdsc0000gn/T/tmpOAjjz0/mozboot/osx.py", line 370, in ensure_homebrew_mobile_android_packages
  File "/var/folders/kk/6ds8tcz13vb62cj73z05fdsc0000gn/T/tmpOAjjz0/mozboot/osx.py", line 327, in _ensure_homebrew_casks
  File "/var/folders/kk/6ds8tcz13vb62cj73z05fdsc0000gn/T/tmpOAjjz0/mozboot/osx.py", line 315, in _ensure_homebrew_packages
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '[u'/usr/local/bin/brew', u'cask', u'install', u'java8']' returned non-zero exit status 1

On April 16 2019 (yesterday), Oracle changed the license for the JDK to require creating an account to download the JDK. This means that it's not possible to install java8 via homebrew.

It's possible to install openjdk via brew tap AdoptOpenJDK/openjdk && brew cask install adoptopenjdk8 but I don't know if openjdk8 is compatible enough with Oracle JDK 8, and in any case the bootstrap doesn't detect openjdk8 being installed so it'll always fail.

The failure is now:
Error: Cask 'java8' is unavailable: No Cask with this name exists.

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

This seems to be discussed at https://github.com/Homebrew/homebrew-cask-versions/issues/7253

Is there any way to download a java artifact without creating an account? Doesn't need to be the latest and greatest. Would be very handy to have bootstrap able to download the exact right version and stick it in ~/.mozbuild.

As a side note, the '--with-java-bin-path' suggested by bootstrap causes problems for me, but removing it makes the build work fine (I meant to file a bug about this but I forgot). We should address that when we fix this.

[1] https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/python/mozboot/mozboot/android.py#307

Assignee: nobody → past
Status: NEW → ASSIGNED

How much does OpenJDK differ from Oracle's? We want the automation and local configurations to match each other as closely as possible.

Oops, forgot about the --with-java-bin-path bit. I'll update the patch.

From reading everything that I could find starting from Florian's link above, I think that there is no discernible difference for our purposes. Here is a longer description of where things stand with jdk8:

https://adoptopenjdk.net/MigratingtoAdoptOpenJDKfromOracleJava.pdf

Neat! I'll Nick weigh in, but if we're switching what developers use, we should also switch what we use in automation. We can probably make that a separate bug though.

Yes! From what I've read so far I believe that we should migrate our automation configurations to openjdk or purchase a commercial license from Oracle (or stick with the pre-April version, which sounds terrible).

Pushed by pastithas@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2e7aeeb20cbc
Switch bootstrap for android to AdoptOpenJDK8. r=nalexander
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

(In reply to Panos Astithas (he/him) [:past] (please ni?) from comment #7)

Yes! From what I've read so far I believe that we should migrate our automation configurations to openjdk or purchase a commercial license from Oracle (or stick with the pre-April version, which sounds terrible).

Can you file a bug for switching the automation config?

Flags: needinfo?(past)

Done.

Flags: needinfo?(past)
You need to log in before you can comment on or make changes to this bug.