8164301: jib should provide a JDK for running jtreg with

Reviewed-by: tbell
This commit is contained in:
Erik Joelsson 2016-09-27 15:33:34 +02:00
parent 12fae4c79f
commit 439cb413d5
2 changed files with 31 additions and 20 deletions

View File

@ -224,6 +224,23 @@ var getJibProfilesCommon = function (input) {
common.configure_args_slowdebug = ["--with-debug-level=slowdebug"], common.configure_args_slowdebug = ["--with-debug-level=slowdebug"],
common.organization = "jpg.infra.builddeps" common.organization = "jpg.infra.builddeps"
var boot_jdk_revision = "8";
var boot_jdk_subdirpart = "1.8.0";
// JDK 8 does not work on sparc M7 cpus, need a newer update when building
// on such hardware.
if (input.build_cpu == "sparcv9") {
var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
if (cpu_brand.trim() == 'SPARC-M7') {
boot_jdk_revision = "8u20";
boot_jdk_subdirpart = "1.8.0_20";
}
}
common.boot_jdk_revision = boot_jdk_revision;
common.boot_jdk_subdirpart = boot_jdk_subdirpart;
common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk"
+ common.boot_jdk_subdirpart
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
return common; return common;
}; };
@ -333,8 +350,11 @@ var getJibProfilesProfiles = function (input, common) {
"run-test": { "run-test": {
target_os: input.build_os, target_os: input.build_os,
target_cpu: input.build_cpu, target_cpu: input.build_cpu,
dependencies: [ "jtreg", "gnumake" ], dependencies: [ "jtreg", "gnumake", "boot_jdk" ],
labels: "test" labels: "test",
environment: {
"JT_JAVA": common.boot_jdk_home
}
} }
}; };
profiles = concatObjects(profiles, testOnlyProfiles); profiles = concatObjects(profiles, testOnlyProfiles);
@ -357,18 +377,6 @@ var getJibProfilesDependencies = function (input, common) {
var boot_jdk_platform = input.build_os + "-" var boot_jdk_platform = input.build_os + "-"
+ (input.build_cpu == "x86" ? "i586" : input.build_cpu); + (input.build_cpu == "x86" ? "i586" : input.build_cpu);
var boot_jdk_revision = "8";
var boot_jdk_subdirpart = "1.8.0";
// JDK 8 does not work on sparc M7 cpus, need a newer update when building
// on such hardware.
if (input.build_cpu == "sparcv9") {
var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\"");
if (cpu_brand.trim() == 'SPARC-M7') {
boot_jdk_revision = "8u20";
boot_jdk_subdirpart = "1.8.0_20";
}
}
var devkit_platform_revisions = { var devkit_platform_revisions = {
linux_x64: "gcc4.9.2-OEL6.4+1.0", linux_x64: "gcc4.9.2-OEL6.4+1.0",
macosx_x64: "Xcode6.3-MacOSX10.9+1.0", macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
@ -386,12 +394,12 @@ var getJibProfilesDependencies = function (input, common) {
boot_jdk: { boot_jdk: {
server: "javare", server: "javare",
module: "jdk", module: "jdk",
revision: boot_jdk_revision, revision: common.boot_jdk_revision,
checksum_file: boot_jdk_platform + "/MD5_VALUES", checksum_file: boot_jdk_platform + "/MD5_VALUES",
file: boot_jdk_platform + "/jdk-" + boot_jdk_revision + "-" + boot_jdk_platform + ".tar.gz", file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
configure_args: (input.build_os == "macosx" + "-" + boot_jdk_platform + ".tar.gz",
? "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart + ".jdk/Contents/Home" configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
: "--with-boot-jdk=" + input.get("boot_jdk", "install_path") + "/jdk" + boot_jdk_subdirpart) environment_path: common.boot_jdk_home
}, },
devkit: { devkit: {
@ -420,7 +428,8 @@ var getJibProfilesDependencies = function (input, common) {
build_number: "b03", build_number: "b03",
checksum_file: "MD5_VALUES", checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.2.zip", file: "jtreg_bin-4.2.zip",
environment_name: "JT_HOME" environment_name: "JT_HOME",
environment_path: input.get("jtreg", "install_path") + "/jtreg/bin"
}, },
gnumake: { gnumake: {

View File

@ -31,11 +31,13 @@ ifndef _MAINSUPPORT_GMK
_MAINSUPPORT_GMK := 1 _MAINSUPPORT_GMK := 1
# Run the tests specified by $1, with PRODUCT_HOME specified by $2 # Run the tests specified by $1, with PRODUCT_HOME specified by $2
# JT_JAVA is picked up by the jtreg launcher and used to run Jtreg itself.
define RunTests define RunTests
($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \ ($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
JT_HOME=$(JT_HOME) PRODUCT_HOME=$(strip $2) \ JT_HOME=$(JT_HOME) PRODUCT_HOME=$(strip $2) \
TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \ TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \
ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \ ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \
JT_JAVA=$(BOOT_JDK) \
JOBS=$(JOBS) $1) || true JOBS=$(JOBS) $1) || true
endef endef