Commit ca01c25b authored by Peter Wen's avatar Peter Wen Committed by Commit Bot

Android: Add rt.jar to cipd and use it

Rather than depending on system provided rt.jar, check one into cipd and
use that one instead for hermetic builds. The one used is from
openjdk-8-jdk.

Add myself to OWNERS under //third_party/jdk and update README.chromium
with instructions for updating the extras subdirectory.

Bug: 693079
Change-Id: I65361bd11aa0edd60dceb102b45082848dac6244
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1884367
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Auto-Submit: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710144}
parent 89532d5d
......@@ -1115,6 +1115,10 @@ deps = {
'package': 'chromium/third_party/jdk',
'version': 'PfRSnxe8Od6WU4zBXomq-zsgcJgWmm3z4gMQNB-r2QcC',
},
{
'package': 'chromium/third_party/jdk/extras',
'version': 'fkhuOQ3r-zKtWEdKplpo6k0vKkjl-LY_rJTmtzFCQN4C',
},
],
'condition': 'host_os == "linux" and checkout_android',
'dep_type': 'cipd',
......
......@@ -477,10 +477,7 @@ def _ParseOptions(argv):
# Get the path of the jdk folder by searching for the 'jar' executable. We
# cannot search for the 'javac' executable because goma provides a custom
# version of 'javac'.
jar_path = os.path.realpath(distutils.spawn.find_executable('jar'))
jdk_dir = os.path.dirname(os.path.dirname(jar_path))
rt_jar = os.path.join(jdk_dir, 'jre', 'lib', 'rt.jar')
options.bootclasspath.append(rt_jar)
options.bootclasspath.append(build_utils.RT_JAR_PATH)
additional_jar_files = []
for arg in options.additional_jar_files or []:
......
......@@ -35,6 +35,8 @@ DIR_SOURCE_ROOT = os.environ.get('CHECKOUT_SOURCE_ROOT',
os.pardir, os.pardir, os.pardir, os.pardir)))
JAVA_PATH = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'jdk', 'current',
'bin', 'java')
RT_JAR_PATH = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'jdk', 'extras',
'java_8', 'jre', 'lib', 'rt.jar')
try:
string_types = basestring
......
......@@ -118,6 +118,7 @@
/jacoco/lib/
/javalang/src/
/jdk/current
/jdk/extras
/jsr-305/src
/junit/src
/khronos_glcts
......
agrieve@chromium.org
wnwen@chromium.org
yliuyliu@google.com
......@@ -11,6 +11,7 @@ The Java Development Kit (JDK) is a software development environment used for
developing Java applications and applets. (linux-x64)
How to update:
For the `current` subdirectory:
1. Find the specific version you want to update from
https://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Click DOWNLOAD for specific version
......@@ -20,5 +21,12 @@ How to update:
6. Run "cipd create --pkg-def cipd.yaml" to create cipd package and get instance ID
7. Update instance ID in //DEPS
For the `extras` subdirectory:
1. Find the rt.jar file that you want to update to, the current one is from
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/rt.jar, for java 1.8.0.
2. Replace the rt.jar file under `extras`.
3. Run `cipd create --pkg-def cipd_extras.yaml` to get instance ID.
4. Update instance ID in //DEPS.
Local Modifications:
None
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# To create CIPD package run the following command.
# cipd create --pkg-def cipd_extras.yaml
package: chromium/third_party/jdk/extras
description: Java Development Kit Extras
root: ./
# TODO(https://crbug.com/977242): Remove this and go back to symlinks once
# # swarming isolation works properly with symlinks.
install_mode: copy
data:
- dir: extras
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment