183
var getJibProfiles = function (input) {
192
data.format_version = "1.3";
195
data.organization = "";
196
data.product = "jdk";
197
data.version = getVersion();
201
data.output_basedir = "build";
203
data.configuration_configure_arg = "--with-conf-name=";
205
data.configuration_make_arg = "CONF_NAME=";
208
data.src_bundle_excludes = [
209
"build", "{,**/}webrev*", "{,**/}.hg", "{,**/}JTwork*", "{,**/}JTreport*",
214
data.conf_bundle_includes = [
215
"make/conf/version-numbers.conf",
219
var common = getJibProfilesCommon(input, data);
221
data.profiles = getJibProfilesProfiles(input, common, data);
223
data.dependencies = getJibProfilesDependencies(input, common, data);
234
var getJibProfilesCommon = function (input, data) {
237
common.organization = "jpg.infra.builddeps";
238
common.build_id = getBuildId(input);
239
common.build_number = input.build_number != null ? input.build_number : "0";
242
common.main_profile_names = [
243
"linux-x64", "linux-x86", "macosx-x64", "macosx-aarch64",
244
"windows-x64", "windows-x86", "windows-aarch64",
245
"linux-aarch64", "linux-arm32", "linux-ppc64le", "linux-s390x",
250
common.main_profile_base = {
251
dependencies: ["boot_jdk", "gnumake", "jtreg", "jib", "autoconf", "jmh", "jcov"],
252
default_make_targets: ["product-bundles", "test-bundles", "static-libs-bundles"],
253
configure_args: concat(
254
"--with-exclude-translations=es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
255
"--disable-manpages",
256
"--disable-jvm-feature-shenandoahgc",
257
versionArgs(input, common))
261
common.debug_suffix = "-debug";
262
common.debug_profile_base = {
263
configure_args: ["--enable-debug"],
267
common.slowdebug_suffix = "-slowdebug";
268
common.slowdebug_profile_base = {
269
configure_args: ["--with-debug-level=slowdebug"],
273
common.optimized_suffix = "-optimized";
274
common.optimized_profile_base = {
275
configure_args: ["--with-debug-level=optimized"],
279
common.open_suffix = "-open";
280
common.open_profile_base = {
281
configure_args: ["--enable-openjdk-only"],
285
common.configure_args_64bit = ["--with-target-bits=64"];
286
common.configure_args_32bit = ["--with-target-bits=32"];
292
common.main_profile_artifacts = function (o) {
293
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
294
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
299
local: "bundles/\\(jdk.*bin." + jdk_suffix + "\\)",
301
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin." + jdk_suffix,
302
"bundles/" + pf + "/\\1"
305
exploded: "images/jdk"
308
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
310
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests.tar.gz",
311
"bundles/" + pf + "/\\1"
313
exploded: "images/test"
316
local: "bundles/\\(jdk.*bin-tests-demos.tar.gz\\)",
318
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests-demos.tar.gz",
319
"bundles/" + pf + "/\\1"
321
exploded: "images/test"
324
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
326
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-symbols.tar.gz",
327
"bundles/" + pf + "/\\1"
330
exploded: "images/jdk"
333
local: "bundles/\\(jdk.*bin-static-libs.tar.gz\\)",
335
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-static-libs.tar.gz",
336
"bundles/" + pf + "/\\1"
349
common.debug_profile_artifacts = function (o) {
350
var jdk_subdir = "jdk-" + data.version + "/fastdebug";
351
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
356
local: "bundles/\\(jdk.*bin-debug." + jdk_suffix + "\\)",
358
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug." + jdk_suffix,
359
"bundles/" + pf + "/\\1"
362
exploded: "images/jdk"
365
local: "bundles/\\(jdk.*bin-tests-debug.tar.gz\\)",
367
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-tests-debug.tar.gz",
368
"bundles/" + pf + "/\\1"
370
exploded: "images/test"
373
local: "bundles/\\(jdk.*bin-debug-symbols.tar.gz\\)",
375
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-debug-symbols.tar.gz",
376
"bundles/" + pf + "/\\1"
379
exploded: "images/jdk"
382
local: "bundles/\\(jdk.*bin-static-libs-debug.tar.gz\\)",
384
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-static-libs-debug.tar.gz",
385
"bundles/" + pf + "/\\1"
393
common.boot_jdk_version = "22";
394
common.boot_jdk_build_number = "36";
395
common.boot_jdk_home = input.get("boot_jdk", "install_path") + "/jdk-"
396
+ common.boot_jdk_version
397
+ (input.build_os == "macosx" ? ".jdk/Contents/Home" : "");
409
var getJibProfilesProfiles = function (input, common, data) {
410
var cross_compiling = input.build_platform != input.target_platform;
418
dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc"],
419
configure_args: concat(
420
(input.build_cpu == "x64" ? common.configure_args_64bit
421
: "--openjdk-target=x86_64-linux-gnu"),
422
"--with-zlib=system", "--disable-dtrace",
423
(isWsl(input) ? [ "--host=x86_64-unknown-linux-gnu",
424
"--build=x86_64-unknown-linux-gnu" ] : [])),
431
dependencies: ["devkit", "gtest", "libffi"],
432
configure_args: concat(common.configure_args_32bit, [
433
"--with-jvm-variants=minimal,server",
434
"--with-zlib=system",
435
"--with-libffi=" + input.get("libffi", "home_path"),
436
"--enable-libffi-bundling",
437
"--enable-fallback-linker"
444
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
445
configure_args: concat(common.configure_args_64bit, "--with-zlib=system",
446
"--with-macosx-version-max=11.00.00",
447
"--enable-compatible-cds-alignment",
450
"SETFILE=/usr/bin/SetFile"),
455
target_cpu: "aarch64",
456
dependencies: ["devkit", "gtest", "graphviz", "pandoc"],
457
configure_args: concat(common.configure_args_64bit,
458
"--with-macosx-version-max=11.00.00"),
462
target_os: "windows",
464
dependencies: ["devkit", "gtest", "pandoc"],
465
configure_args: concat(common.configure_args_64bit),
469
target_os: "windows",
472
dependencies: ["devkit", "gtest"],
473
configure_args: concat(common.configure_args_32bit,
474
"--enable-deprecated-ports"),
478
target_os: "windows",
479
target_cpu: "aarch64",
480
dependencies: ["devkit", "gtest", "build_devkit"],
482
"--openjdk-target=aarch64-unknown-cygwin",
488
target_cpu: "aarch64",
489
dependencies: ["devkit", "gtest", "build_devkit", "graphviz", "pandoc"],
491
"--with-zlib=system",
493
"--enable-compatible-cds-alignment",
494
].concat(cross_compiling ? ["--openjdk-target=aarch64-linux-gnu"] : []),
501
dependencies: ["devkit", "gtest", "build_devkit"],
503
"--openjdk-target=arm-linux-gnueabihf", "--with-freetype=bundled",
504
"--with-abi-profile=arm-vfp-hflt", "--disable-warnings-as-errors"
510
target_cpu: "ppc64le",
512
dependencies: ["devkit", "gtest", "build_devkit"],
514
"--openjdk-target=ppc64le-linux-gnu", "--with-freetype=bundled",
515
"--disable-warnings-as-errors"
523
dependencies: ["devkit", "gtest", "build_devkit"],
525
"--openjdk-target=s390x-linux-gnu", "--with-freetype=bundled",
526
"--disable-warnings-as-errors"
532
target_cpu: "riscv64",
534
dependencies: ["devkit", "gtest", "build_devkit"],
536
"--openjdk-target=riscv64-linux-gnu", "--with-freetype=bundled",
537
"--disable-warnings-as-errors"
543
common.main_profile_names.forEach(function (name) {
544
profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
548
common.main_profile_names.forEach(function (name) {
549
var debugName = name + common.debug_suffix;
550
profiles[debugName] = concatObjects(profiles[name],
551
common.debug_profile_base);
554
common.main_profile_names.forEach(function (name) {
555
var debugName = name + common.slowdebug_suffix;
556
profiles[debugName] = concatObjects(profiles[name],
557
common.slowdebug_profile_base);
560
common.main_profile_names.forEach(function (name) {
561
var optName = name + common.optimized_suffix;
562
profiles[optName] = concatObjects(profiles[name],
563
common.optimized_profile_base);
564
profiles[optName].default_make_targets = [ "hotspot" ];
570
dependencies: [ "ant" ],
572
"ANT_HOME": input.get("ant", "home_path")
575
[ "linux-x64", "macosx-aarch64", "macosx-x64", "windows-x64", "linux-aarch64"]
576
.forEach(function (name) {
577
var maketestName = name + "-testmake";
578
profiles[maketestName] = concatObjects(profiles[name], testmakeBase);
579
profiles[maketestName].default_make_targets = [ "test-make" ];
583
[ "linux-aarch64", "linux-x64", "macosx-x64", "macosx-aarch64" ].forEach(function (name) {
584
var gcovName = name + "-gcov";
585
profiles[gcovName] = clone(profiles[name]);
586
profiles[gcovName].default_make_targets = ["product-bundles", "test-bundles"];
587
profiles[gcovName].configure_args = concat(profiles[gcovName].configure_args,
588
["--enable-native-coverage", "--disable-warnings-as-errors"]);
596
dependencies: ["devkit", "gtest", "libffi"],
597
configure_args: concat(common.configure_args_64bit, [
598
"--with-zlib=system",
599
"--with-jvm-variants=zero",
600
"--with-libffi=" + input.get("libffi", "home_path"),
601
"--enable-libffi-bundling",
605
"linux-aarch64-zero": {
607
target_cpu: "aarch64",
608
dependencies: ["devkit", "gtest", "libffi"],
609
configure_args: concat(common.configure_args_64bit, [
610
"--with-zlib=system",
611
"--with-jvm-variants=zero",
612
"--with-libffi=" + input.get("libffi", "home_path"),
613
"--enable-libffi-bundling"
621
dependencies: ["devkit", "gtest", "libffi"],
622
configure_args: concat(common.configure_args_32bit, [
623
"--with-zlib=system",
624
"--with-jvm-variants=zero",
625
"--with-libffi=" + input.get("libffi", "home_path"),
626
"--enable-libffi-bundling"
630
profiles = concatObjects(profiles, zeroProfiles);
633
Object.keys(zeroProfiles).forEach(function (name) {
634
var debugName = name + common.debug_suffix;
635
profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
636
profiles[debugName] = concatObjects(profiles[name], common.debug_profile_base);
641
var noPchProfiles = {
642
"linux-x64-debug-nopch": {
645
dependencies: ["devkit", "gtest"],
646
configure_args: concat(common.configure_args_64bit,
647
"--with-zlib=system", "--disable-precompiled-headers"),
650
profiles = concatObjects(profiles, noPchProfiles);
652
Object.keys(noPchProfiles).forEach(function (name) {
653
profiles[name] = concatObjects(common.main_profile_base, profiles[name]);
654
profiles[name] = concatObjects(common.debug_profile_base, profiles[name]);
657
profiles[name].default_make_targets = ["hotspot"];
663
[ "linux-x64", "macosx-x64", "windows-x64", "linux-aarch64" ]
664
.forEach(function (name) {
665
var bootcycleName = name + "-bootcycle";
666
var bootcyclePrebuiltName = name + "-bootcycle-prebuilt";
669
profiles[bootcycleName] = clone(profiles[name]);
670
profiles[bootcycleName].default_make_targets = [ "bootcycle-images" ];
672
var bootcyclePrebuiltBase = {
673
dependencies: [ name + ".jdk" ],
675
"--with-boot-jdk=" + input.get(name + ".jdk", "home_path"),
678
profiles[bootcyclePrebuiltName] = concatObjects(profiles[name],
679
bootcyclePrebuiltBase);
680
var bootJdkIndex = profiles[bootcyclePrebuiltName].dependencies.indexOf("boot_jdk");
681
delete profiles[bootcyclePrebuiltName].dependencies[bootJdkIndex];
682
profiles[bootcyclePrebuiltName].default_make_targets = [ "product-images" ];
686
[ "linux-aarch64", "linux-x64", "macosx-x64", "macosx-aarch64", "windows-x64" ]
687
.forEach(function (name) {
688
var jcovName = name + "-jcov";
689
profiles[jcovName] = clone(common.main_profile_base);
690
profiles[jcovName].target_os = profiles[name].target_os
691
profiles[jcovName].target_cpu = profiles[name].target_cpu
692
profiles[jcovName].default_make_targets = [ "jcov-bundles" ];
693
profiles[jcovName].dependencies = concat(profiles[jcovName].dependencies,
694
[ name + ".jdk", "devkit" ]);
695
profiles[jcovName].configure_args = concat(profiles[jcovName].configure_args,
696
["--with-jcov-input-jdk=" + input.get(name + ".jdk", "home_path")]);
702
platform: "linux-x64",
705
platform: "linux-x86",
708
platform: "macos-x64",
709
jdk_subdir: "jdk-" + data.version + ".jdk/Contents/Home",
712
platform: "macos-aarch64",
713
jdk_subdir: "jdk-" + data.version + ".jdk/Contents/Home",
716
platform: "windows-x64",
720
platform: "windows-x86",
724
platform: "windows-aarch64",
728
platform: "linux-aarch64",
731
platform: "linux-arm32",
734
platform: "linux-ppc64le",
737
platform: "linux-s390x",
740
platform: "linux-riscv64",
744
Object.keys(artifactData).forEach(function (name) {
745
profiles[name] = concatObjects(profiles[name],
746
common.main_profile_artifacts(artifactData[name]));
750
Object.keys(artifactData).forEach(function (name) {
751
var debugName = name + common.debug_suffix;
752
profiles[debugName] = concatObjects(profiles[debugName],
753
common.debug_profile_artifacts(artifactData[name]));
757
["linux-x64"].forEach(function (name) {
758
var o = artifactData[name]
760
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
761
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
762
var zeroName = name + "-zero";
763
profiles[zeroName].artifacts = {
765
local: "bundles/\\(jdk.*bin." + jdk_suffix + "\\)",
767
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-zero." + jdk_suffix,
770
exploded: "images/jdk",
773
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
775
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-zero-tests.tar.gz",
777
exploded: "images/test"
780
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
782
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-zero-symbols.tar.gz",
785
exploded: "images/jdk"
790
buildJdkDep = input.build_os + "-" + input.build_cpu + ".jdk";
793
target_os: input.build_os,
794
target_cpu: input.build_cpu,
796
"boot_jdk", "devkit", "graphviz", "pandoc", buildJdkDep,
798
configure_args: concat(
799
"--enable-full-docs",
800
versionArgs(input, common),
801
"--with-build-jdk=" + input.get(buildJdkDep, "home_path"),
805
"--with-docs-reference-jdk=" + input.get(buildJdkDep, "home_path")
807
default_make_targets: ["all-docs-bundles"],
810
local: "bundles/\\(jdk-" + data.version + ".*doc-api-spec.tar.gz\\)",
812
"bundles/common/jdk-" + data.version + "_doc-api-spec.tar.gz",
816
javase_doc_api_spec: {
817
local: "bundles/\\(javase-" + data.version + ".*doc-api-spec.tar.gz\\)",
819
"bundles/common/javase-" + data.version + "_doc-api-spec.tar.gz",
823
reference_doc_api_spec: {
824
local: "bundles/\\(jdk-reference-" + data.version + ".*doc-api-spec.tar.gz\\)",
826
"bundles/common/jdk-reference-" + data.version + "_doc-api-spec.tar.gz",
833
profiles = concatObjects(profiles, docsProfiles);
837
common.main_profile_names.forEach(function (name) {
838
var openName = name + common.open_suffix;
839
profiles[openName] = concatObjects(profiles[name],
840
common.open_profile_base);
841
for (artifactName in profiles[openName].artifacts) {
842
var artifact = profiles[openName].artifacts[artifactName];
843
artifact.remote = replaceAll(
844
"bundles\/", "bundles/openjdk/GPL/",
845
(artifact.remote != null ? artifact.remote : artifact.local));
847
var debugName = name + common.debug_suffix;
848
var openDebugName = name + common.open_suffix + common.debug_suffix;
849
profiles[openDebugName] = concatObjects(profiles[debugName],
850
common.open_profile_base);
851
for (artifactName in profiles[openDebugName].artifacts) {
852
var artifact = profiles[openDebugName].artifacts[artifactName];
853
artifact.remote = replaceAll(
854
"bundles\/", "bundles/openjdk/GPL/",
855
(artifact.remote != null ? artifact.remote : artifact.local));
861
common.main_profile_names.forEach(function (name) {
862
var openName = name + common.open_suffix;
863
profiles[openName].artifacts["jdk"].remote = replaceAll(
864
"\/jdk-", "/openjdk-",
865
replaceAll("\/\\1", "/open\\1",
866
profiles[openName].artifacts["jdk"].remote));
872
common.main_profile_names.forEach(function (name) {
873
[ "", common.open_suffix ].forEach(function (suffix) {
874
var cmpBaselineName = name + suffix + "-cmp-baseline";
875
profiles[cmpBaselineName] = clone(profiles[name + suffix]);
878
profiles[cmpBaselineName].default_make_targets = [ "images", "test-image" ];
879
if (name == "linux-x64") {
880
profiles[cmpBaselineName].default_make_targets
881
= concat(profiles[cmpBaselineName].default_make_targets, "docs");
883
profiles[cmpBaselineName].make_args = [ "COMPARE_BUILD=CONF=" ];
884
profiles[cmpBaselineName].configure_args = concat(
885
profiles[cmpBaselineName].configure_args,
886
"--with-hotspot-build-time=n/a",
887
"--disable-precompiled-headers");
889
delete profiles[cmpBaselineName].artifacts;
894
[ "linux-aarch64", "linux-x64", "macosx-x64", "macosx-aarch64", "windows-x64" ]
895
.forEach(function (name) {
896
var o = artifactData[name]
897
var jdk_subdir = "jdk-" + data.version;
898
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
900
var jcovName = name + "-jcov";
901
profiles[jcovName].artifacts = {
903
local: "bundles/\\(jdk-jcov.*bin." + jdk_suffix + "\\)",
905
"bundles/" + pf + "/jdk-jcov-" + data.version + "_" + pf + "_bin." + jdk_suffix
908
exploded: "images/jdk-jcov"
914
[ "linux-aarch64", "linux-x64", "macosx-x64", "macosx-aarch64" ].forEach(function (name) {
915
var o = artifactData[name]
917
var jdk_subdir = (o.jdk_subdir != null ? o.jdk_subdir : "jdk-" + data.version);
918
var jdk_suffix = (o.jdk_suffix != null ? o.jdk_suffix : "tar.gz");
919
var gcovName = name + "-gcov";
920
profiles[gcovName].artifacts = {
922
local: "bundles/\\(jdk.*bin." + jdk_suffix + "\\)",
924
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov." + jdk_suffix,
927
exploded: "images/jdk",
930
local: "bundles/\\(jdk.*bin-tests.tar.gz\\)",
932
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov-tests.tar.gz",
934
exploded: "images/test"
937
local: "bundles/\\(jdk.*bin-symbols.tar.gz\\)",
939
"bundles/" + pf + "/jdk-" + data.version + "_" + pf + "_bin-gcov-symbols.tar.gz",
942
exploded: "images/jdk"
948
var testOnlyProfiles = {
950
target_os: input.build_os,
951
target_cpu: input.build_cpu,
952
dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ],
956
profiles = concatObjects(profiles, testOnlyProfiles);
959
var testedProfile = input.testedProfile;
960
if (testedProfile == null) {
961
testedProfile = input.build_os + "-" + input.build_cpu;
963
var testedProfileJdk = testedProfile + ".jdk";
965
var testImageProfile;
966
if (input.testImageProfile != null) {
967
testImageProfile = input.testImageProfile;
968
} else if (testedProfile.endsWith("-jcov")) {
969
testImageProfile = testedProfile.substring(0, testedProfile.length - "-jcov".length);
971
testImageProfile = testedProfile;
973
var testedProfileTest = testImageProfile + ".test"
974
var testOnlyMake = [ "test-prebuilt", "LOG_CMDLINES=true", "JTREG_VERBOSE=fail,error,time" ];
975
if (testedProfile.endsWith("-gcov")) {
976
testOnlyMake = concat(testOnlyMake, "GCOV_ENABLED=true")
978
var testOnlyProfilesPrebuilt = {
979
"run-test-prebuilt": {
980
target_os: input.build_os,
981
target_cpu: input.build_cpu,
983
"jtreg", "gnumake", "boot_jdk", "devkit", "jib", "jcov", testedProfileJdk,
987
make_args: testOnlyMake,
989
"BOOT_JDK": common.boot_jdk_home,
990
"JT_HOME": input.get("jtreg", "home_path"),
991
"JDK_IMAGE_DIR": input.get(testedProfileJdk, "home_path"),
992
"TEST_IMAGE_DIR": input.get(testedProfileTest, "home_path"),
993
"SYMBOLS_IMAGE_DIR": input.get(testedProfile + ".jdk_symbols", "home_path")
998
if (!testedProfile.endsWith("-jcov")) {
999
testOnlyProfilesPrebuilt["run-test-prebuilt"]["dependencies"].push(testedProfile + ".jdk_symbols");
1005
if (input.profile == "run-test-prebuilt") {
1006
if (profiles[testedProfile] == null && profiles[testImageProfile] == null) {
1007
error("testedProfile is not defined: " + testedProfile + " " + testImageProfile);
1010
if (profiles[testedProfile] != null) {
1011
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
1012
= profiles[testedProfile]["target_os"];
1013
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
1014
= profiles[testedProfile]["target_cpu"];
1015
} else if (profiles[testImageProfile] != null) {
1016
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_os"]
1017
= profiles[testImageProfile]["target_os"];
1018
testOnlyProfilesPrebuilt["run-test-prebuilt"]["target_cpu"]
1019
= profiles[testImageProfile]["target_cpu"];
1021
profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
1025
if (input.build_os == "macosx") {
1026
macosxRunTestExtra = {
1027
dependencies: [ "lldb" ],
1029
input.get("gnumake", "install_path") + "/bin",
1030
input.get("lldb", "install_path") + "/Xcode/Contents/Developer/usr/bin",
1033
profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
1034
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
1035
} else if (input.build_os == "windows") {
1038
var archDir = "x64";
1039
if (input.build_arch == "aarch64") {
1042
windowsRunTestExtra = {
1044
input.get("devkit", "install_path") + "/10/Debuggers/" + archDir
1047
profiles["run-test"] = concatObjects(profiles["run-test"], windowsRunTestExtra);
1048
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], windowsRunTestExtra);
1063
if (!new java.io.File(__DIR__, "../../README.md").exists()) {
1064
var runTestPrebuiltSrcFullExtra = {
1065
dependencies: "src.full",
1066
work_dir: input.get("src.full", "install_path"),
1068
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"],
1069
runTestPrebuiltSrcFullExtra);
1073
profiles = generatePlatformAttributes(profiles);
1074
profiles = generateDefaultMakeTargetsConfigureArg(common, profiles);
1085
var getJibProfilesDependencies = function (input, common) {
1087
var devkit_platform_revisions = {
1088
linux_x64: "gcc13.2.0-OL6.4+1.0",
1089
macosx: "Xcode14.3.1+1.0",
1090
windows_x64: "VS2022-17.6.5+1.0",
1091
linux_aarch64: "gcc13.2.0-OL7.6+1.0",
1092
linux_arm: "gcc8.2.0-Fedora27+1.0",
1093
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
1094
linux_s390x: "gcc8.2.0-Fedora27+1.0",
1095
linux_riscv64: "gcc11.3.0-Fedora_rawhide_68692+1.1"
1098
var devkit_platform = (input.target_cpu == "x86"
1099
? input.target_os + "_x64"
1100
: input.target_platform);
1101
if (input.target_platform == "windows_aarch64") {
1102
devkit_platform = "windows_x64";
1103
} else if (input.target_os == "macosx") {
1104
devkit_platform = "macosx";
1106
var devkit_cross_prefix = "";
1107
if (!(input.target_os == "windows")) {
1108
if (input.build_platform != input.target_platform
1109
&& input.build_platform != devkit_platform) {
1110
devkit_cross_prefix = input.build_platform + "-to-";
1113
var boot_jdk_os = input.build_os;
1114
if (input.build_os == "macosx") {
1115
boot_jdk_os = "macos";
1117
var boot_jdk_platform = boot_jdk_os + "-" + input.build_cpu;
1118
var boot_jdk_ext = (input.build_os == "windows" ? ".zip" : ".tar.gz")
1121
if (isWsl(input) && input.target_os == "windows") {
1122
boot_jdk_platform = "windows-" + input.build_cpu;
1123
boot_jdk_ext = ".zip";
1128
version: common.boot_jdk_version,
1129
build_number: common.boot_jdk_build_number,
1130
file: "bundles/" + boot_jdk_platform + "/jdk-" + common.boot_jdk_version + "_"
1131
+ boot_jdk_platform + "_bin" + boot_jdk_ext,
1132
configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
1133
environment_path: common.boot_jdk_home + "/bin"
1136
var makeRevision = "4.0+1.0";
1137
var makeBinSubDir = "/bin";
1138
var makeModule = "gnumake-" + input.build_platform;
1139
if (input.build_os == "windows") {
1140
makeModule = "gnumake-" + input.build_osenv_platform;
1141
if (input.build_osenv == "cygwin") {
1142
var versionArray = input.build_osenv_version.split(/\./);
1143
var majorVer = parseInt(versionArray[0]);
1144
var minorVer = parseInt(versionArray[1]);
1145
if (majorVer > 3 || (majorVer == 3 && minorVer >= 3)) {
1146
makeRevision = "4.3+1.0";
1148
makeBinSubDir = "/cygwin/bin";
1152
var makeBinDir = input.get("gnumake", "install_path") + makeBinSubDir;
1154
var dependencies = {
1158
organization: common.organization,
1160
module: "devkit-" + devkit_cross_prefix + devkit_platform,
1161
revision: devkit_platform_revisions[devkit_platform],
1163
"DEVKIT_HOME": input.get("devkit", "home_path"),
1168
organization: common.organization,
1170
module: "devkit-" + input.build_platform,
1171
revision: devkit_platform_revisions[input.build_platform],
1173
configure_args: (input.build_cpu == input.target_cpu ? false
1174
: "--with-build-devkit=" + input.get("build_devkit", "home_path"))
1178
organization: common.organization,
1180
module: "devkit-macosx" + (input.build_cpu == "x64" ? "_x64" : ""),
1181
revision: (input.build_cpu == "x64" ? "Xcode11.3.1-MacOSX10.15+1.2" : devkit_platform_revisions[devkit_platform])
1189
file: "bundles/jtreg-7.4+1.zip",
1190
environment_name: "JT_HOME",
1191
environment_path: input.get("jtreg", "home_path") + "/bin",
1192
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
1196
organization: common.organization,
1198
revision: "1.37+1.0"
1202
organization: common.organization,
1203
revision: "3.0-17-jdk-asm+1.0",
1205
environment_name: "JCOV_HOME",
1209
organization: common.organization,
1211
revision: makeRevision,
1213
configure_args: "MAKE=" + makeBinDir + "/make",
1215
"MAKE": makeBinDir + "/make"
1217
environment_path: makeBinDir
1221
organization: common.organization,
1223
revision: "2.69+1.0.1",
1224
module: (input.build_os == "windows"
1225
? "autoconf-" + input.build_osenv_platform
1226
: "autoconf-" + input.build_platform),
1228
environment_path: input.get("autoconf", "install_path")
1232
organization: common.organization,
1234
revision: "9.0.0+1.0",
1235
module: "graphviz-" + input.target_platform,
1236
configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot",
1237
environment_path: input.get("graphviz", "install_path")
1241
organization: common.organization,
1243
revision: "2.19.2+1.0",
1244
module: "pandoc-" + input.build_platform,
1245
configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc",
1246
environment_path: input.get("pandoc", "install_path") + "/pandoc"
1251
organization: "com.oracle.java.jib",
1253
classifier: "distribution",
1254
revision: "3.0-SNAPSHOT",
1255
environment_name: "JIB_HOME",
1256
environment_value: input.get("jib", "home_path")
1260
organization: common.organization,
1262
revision: "1.7.1+1.0",
1267
organization: common.organization,
1269
revision: "1.14.0+1.0"
1273
organization: common.organization,
1274
module: "libffi-" + input.target_platform,
1276
revision: "3.4.2+1.0"
1280
return dependencies;
1289
var generatePlatformAttributes = function (profiles) {
1290
var ret = concatObjects(profiles, {});
1291
for (var profile in profiles) {
1292
if (ret[profile].build_os == null) {
1293
ret[profile].build_os = ret[profile].target_os;
1295
if (ret[profile].build_cpu == null) {
1296
ret[profile].build_cpu = ret[profile].target_cpu;
1298
ret[profile].target_platform = ret[profile].target_os + "_" + ret[profile].target_cpu;
1299
ret[profile].build_platform = ret[profile].build_os + "_" + ret[profile].build_cpu;
1313
var generateDefaultMakeTargetsConfigureArg = function (common, profiles) {
1314
var ret = concatObjects(profiles, {});
1315
for (var profile in ret) {
1316
if (ret[profile]["default_make_targets"] != null) {
1317
var targetsString = concat(ret[profile].default_make_targets).join(" ");
1321
for (var i in ret[profile].configure_args) {
1322
var arg = ret[profile].configure_args[i];
1323
if (arg != null && arg.startsWith("--with-default-make-target=")) {
1325
ret[profile].configure_args[i]
1326
= "--with-default-make-target=" + targetsString;
1330
ret[profile].configure_args = concat(
1331
ret[profile].configure_args,
1332
"--with-default-make-target=" + targetsString);
1339
var getBuildId = function (input) {
1340
if (input.build_id != null) {
1341
return input.build_id;
1343
var topdir = new java.io.File(__DIR__, "../..").getCanonicalFile().getName();
1344
var userName = java.lang.System.getProperty("user.name");
1345
return userName + "." + topdir;
1355
var clone = function (o) {
1356
return JSON.parse(JSON.stringify(o));
1364
var concat = function () {
1365
return Array.prototype.concat.apply([], arguments);
1377
var replaceAll = function (pattern, replacement, a) {
1379
if (Array === a.constructor) {
1382
newA.push(a[i].replace(pattern, replacement));
1386
return a.replace(pattern, replacement);
1399
var concatObjects = function (o1, o2) {
1408
if (o2[a] == null) {
1409
ret[a] = clone(o1[a]);
1413
if (o1[a] == null) {
1414
ret[a] = clone(o2[a]);
1416
if (typeof o1[a] == 'string') {
1417
ret[a] = clone([o1[a]].concat(o2[a]));
1418
} else if (Array.isArray(o1[a])) {
1419
ret[a] = clone(o1[a].concat(o2[a]));
1420
} else if (typeof o1[a] == 'object') {
1421
ret[a] = concatObjects(o1[a], o2[a]);
1438
var getVersion = function (feature, interim, update, patch, extra1, extra2, extra3) {
1439
var version_numbers = getVersionNumbers();
1440
var version = (feature != null ? feature : version_numbers.get("DEFAULT_VERSION_FEATURE"))
1441
+ "." + (interim != null ? interim : version_numbers.get("DEFAULT_VERSION_INTERIM"))
1442
+ "." + (update != null ? update : version_numbers.get("DEFAULT_VERSION_UPDATE"))
1443
+ "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH"))
1444
+ "." + (extra1 != null ? extra1 : version_numbers.get("DEFAULT_VERSION_EXTRA1"))
1445
+ "." + (extra2 != null ? extra2 : version_numbers.get("DEFAULT_VERSION_EXTRA2"))
1446
+ "." + (extra3 != null ? extra3 : version_numbers.get("DEFAULT_VERSION_EXTRA3"));
1447
while (version.match(".*\\.0$")) {
1448
version = version.substring(0, version.length - 2);
1457
var versionArgs = function(input, common) {
1459
if (common.build_number != 0) {
1460
args = concat(args, "--with-version-build=" + common.build_number);
1462
if (input.build_type == "promoted") {
1464
"--with-version-pre=" + version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE"),
1465
"--without-version-opt");
1466
} else if (input.build_type == "ci") {
1467
var ciBuildNumber = input.build_id_data.ciBuildNumber;
1468
var preString = input.build_id_data.projectName;
1469
if (preString == "jdk") {
1470
preString = version_numbers.get("DEFAULT_PROMOTED_VERSION_PRE");
1472
args = concat(args, "--with-version-pre=" + preString,
1473
"--with-version-opt=" + ciBuildNumber);
1474
if (input.target_os == "macosx") {
1475
args = concat(args, "--with-macosx-bundle-build-version="
1476
+ common.build_number + "." + ciBuildNumber);
1479
args = concat(args, "--with-version-opt=" + common.build_id);
1482
if (input.build_id_data && input.build_id_data.creationTime) {
1483
sourceDate = Math.floor(Date.parse(input.build_id_data.creationTime)/1000);
1485
sourceDate = "current";
1487
args = concat(args, "--with-source-date=" + sourceDate);
1501
var getVersionNumbers = function () {
1503
if (version_numbers == null) {
1504
version_numbers = new java.util.Properties();
1505
var stream = new java.io.FileInputStream(__DIR__ + "/version-numbers.conf");
1506
version_numbers.load(stream);
1509
return version_numbers;
1516
var isWsl = function (input) {
1517
return ( input.build_osenv == "wsl"
1518
|| (input.build_os == "linux"
1519
&& java.lang.System.getProperty("os.version").toLowerCase().contains("microsoft")));
1522
var error = function (s) {
1523
java.lang.System.err.println("[ERROR] " + s);