Skip to content

Commit f0c58c9

Browse files
committed
JBR-2074 Windows 10 AArch64 support: add build and pack scripts.
1 parent 9930255 commit f0c58c9

File tree

2 files changed

+182
-0
lines changed

2 files changed

+182
-0
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
#!/bin/bash -x
2+
3+
# The following parameters must be specified:
4+
# build_number - specifies the number of JetBrainsRuntime build
5+
# bundle_type - specifies bundle to be built;possible values:
6+
# <empty> or nomod - the release bundles without any additional modules (jcef)
7+
# jcef - the release bundles with jcef
8+
# fd - the fastdebug bundles which also include the jcef module
9+
#
10+
# This script makes test-image along with JDK images when bundle_type is set to "jcef".
11+
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
12+
#
13+
# Environment variables:
14+
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
15+
# to configure
16+
# By default JDK_BUILD_NUMBER is set zero
17+
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
18+
# By default JCEF binaries should be located in ./jcef_win_aarch64
19+
20+
source jb/project/tools/common/scripts/common.sh
21+
22+
WORK_DIR=$(pwd)
23+
JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_aarch64}
24+
25+
function do_configure {
26+
sh ./configure \
27+
--openjdk-target=aarch64-unknown-cygwin \
28+
$WITH_DEBUG_LEVEL \
29+
--with-vendor-name="$VENDOR_NAME" \
30+
--with-vendor-version-string="$VENDOR_VERSION_STRING" \
31+
--with-jvm-features=shenandoahgc \
32+
--with-version-pre= \
33+
--with-version-build=$JDK_BUILD_NUMBER \
34+
--with-version-opt=b${build_number} \
35+
--with-toolchain-version=$TOOLCHAIN_VERSION \
36+
--with-boot-jdk=$BOOT_JDK \
37+
--with-build-jdk=$BOOT_JDK \
38+
--disable-ccache \
39+
$STATIC_CONF_ARGS \
40+
--enable-cds=yes || do_exit $?
41+
}
42+
43+
function create_image_bundle {
44+
__bundle_name=$1
45+
__arch_name=$2
46+
__modules_path=$3
47+
__modules=$4
48+
49+
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
50+
51+
echo Running jlink ...
52+
${BOOT_JDK}/bin/jlink \
53+
--module-path $__modules_path --no-man-pages --compress=2 \
54+
--add-modules $__modules --output $__arch_name || do_exit $?
55+
56+
grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__arch_name/release
57+
if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
58+
sed 's/JBR/JBRSDK/g' $__arch_name/release > release
59+
mv release $__arch_name/release
60+
cp $IMAGES_DIR/jdk/lib/src.zip $__arch_name/lib
61+
copy_jmods "$__modules" "$__modules_path" "$__arch_name"/jmods
62+
fi
63+
}
64+
65+
WITH_DEBUG_LEVEL="--with-debug-level=release"
66+
RELEASE_NAME=windows-aarch64-server-release
67+
68+
case "$bundle_type" in
69+
"jcef")
70+
do_reset_changes=0
71+
do_maketest=1
72+
;;
73+
"dcevm")
74+
HEAD_REVISION=$(git rev-parse HEAD)
75+
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
76+
do_reset_dcevm=0
77+
do_reset_changes=0
78+
;;
79+
"nomod" | "")
80+
bundle_type=""
81+
;;
82+
"fd")
83+
do_reset_changes=0
84+
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
85+
RELEASE_NAME=windows-aarch64-server-fastdebug
86+
;;
87+
esac
88+
89+
if [ -z "$INC_BUILD" ]; then
90+
do_configure || do_exit $?
91+
if [ $do_maketest -eq 1 ]; then
92+
make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $?
93+
else
94+
make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
95+
fi
96+
else
97+
if [ $do_maketest -eq 1 ]; then
98+
make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $?
99+
else
100+
make LOG=info CONF=$RELEASE_NAME images || do_exit $?
101+
fi
102+
fi
103+
104+
IMAGES_DIR=build/$RELEASE_NAME/images
105+
JSDK=$IMAGES_DIR/jdk
106+
JSDK_MODS_DIR=$IMAGES_DIR/jmods
107+
JBRSDK_BUNDLE=jbrsdk
108+
109+
where cygpath
110+
if [ $? -eq 0 ]; then
111+
JCEF_PATH="$(cygpath -w $JCEF_PATH | sed 's/\\/\//g')"
112+
fi
113+
114+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
115+
git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
116+
update_jsdk_mods "$BOOT_JDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
117+
cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not unchanged
118+
119+
jbr_name_postfix="_${bundle_type}"
120+
fi
121+
122+
# create runtime image bundle
123+
modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
124+
modules+=",jdk.crypto.mscapi"
125+
create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
126+
127+
# create sdk image bundle
128+
modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g) || do_exit $?
129+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
130+
modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
131+
fi
132+
create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
133+
134+
do_exit 0
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash -x
2+
3+
# The following parameters must be specified:
4+
# build_number - specifies the number of JetBrainsRuntime build
5+
# bundle_type - specifies bundle to be built;possible values:
6+
# <empty> or nomod - the release bundles without any additional modules (jcef)
7+
# jcef - the release bundles with jcef
8+
# fd - the fastdebug bundles which also include the jcef module
9+
#
10+
# This script packs test-image along with JDK images when bundle_type is set to "jcef".
11+
# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
12+
#
13+
14+
source jb/project/tools/common/scripts/common.sh
15+
16+
[ "$bundle_type" == "jcef" ] && do_maketest=1
17+
18+
function pack_jbr {
19+
__bundle_name=$1
20+
__arch_name=$2
21+
22+
[ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
23+
JBR=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
24+
25+
echo Creating $JBR.tar.gz ...
26+
27+
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__arch_name || do_exit $?
28+
}
29+
30+
[ "$bundle_type" == "nomod" ] && bundle_type=""
31+
32+
JBRSDK_BUNDLE=jbrsdk
33+
RELEASE_NAME=windows-aarch64-server-release
34+
IMAGES_DIR=build/$RELEASE_NAME/images
35+
BASE_DIR=.
36+
37+
if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
38+
jbr_name_postfix="_${bundle_type}"
39+
fi
40+
41+
pack_jbr jbr${jbr_name_postfix} jbr
42+
pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
43+
44+
if [ $do_maketest -eq 1 ]; then
45+
JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
46+
echo Creating $JBRSDK_TEST.tar.gz ...
47+
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
48+
fi

0 commit comments

Comments
 (0)