Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetect boot JDK location based on playbook defaults #2167

Merged
merged 6 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions build-farm/platform-specific-configurations/aix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,20 @@ fi
echo LDR_CNTRL=$LDR_CNTRL

# Any version above 8 (11 for now due to openjdk-build#1409
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="${bootDir}"
if [ ! -d "${bootDir}/bin" ]; then
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="${bootDir}"
if [ ! -x "$bootDir/bin/javac" ]; then
# Set to a default location as linked in the ansible playbooks
if [ -x /usr/java${BOOT_JDK_VERSION}_64/bin/javac ]; then
echo Could not use ${BOOT_JDK_VARIABLE} - using /usr/java${BOOT_JDK_VERSION}_64
export ${BOOT_JDK_VARIABLE}="/usr/java${BOOT_JDK_VERSION}_64"
else
mkdir -p "${bootDir}"
echo "Downloading GA release of boot JDK version ${BOOT_JDK_VERSION}..."
releaseType="ga"
Expand All @@ -80,13 +85,14 @@ if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
fi
fi
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi

Expand Down
41 changes: 23 additions & 18 deletions build-farm/platform-specific-configurations/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,20 @@ then
fi

# Any version above 8 (11 for now due to openjdk-build#1409
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="$bootDir"
if [ ! -d "$bootDir/bin" ]; then
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="$bootDir"
if [ ! -x "$bootDir/bin/javac" ]; then
# Set to a default location as linked in the ansible playbooks
if [ -x /usr/lib/jvm/jdk-${BOOT_JDK_VERSION}/bin/javac ]; then
echo Could not use ${BOOT_JDK_VARIABLE} - using /usr/lib/jvm/jdk-${BOOT_JDK_VERSION}
export ${BOOT_JDK_VARIABLE}="/usr/lib/jvm/jdk-${BOOT_JDK_VERSION}"
else
mkdir -p "$bootDir"
echo "Downloading GA release of boot JDK version ${BOOT_JDK_VERSION}..."
releaseType="ga"
Expand All @@ -124,17 +129,17 @@ if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
fi
fi
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi


if [ "${VARIANT}" == "${BUILD_VARIANT_DRAGONWELL}" ] && [ "$JAVA_FEATURE_VERSION" -eq 11 ] && [ -r /usr/local/gcc9/ ]; then
export PATH=/usr/local/gcc9/bin:$PATH
export CC=/usr/local/gcc9/bin/gcc-9.3
Expand Down
39 changes: 22 additions & 17 deletions build-farm/platform-specific-configurations/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ fi
sudo xcode-select --switch "${XCODE_SWITCH_PATH}"

# Any version above 8 (11 for now due to openjdk-build#1409
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="$bootDir/Contents/Home"
if [ ! -d "$bootDir/Contents/Home/bin" ]; then
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="$bootDir/Contents/Home"
if [ ! -x "$bootDir/Contents/Home/bin/javac" ]; then
if [ -x /Library/Java/JavaVirtualMachines/adoptopenjdk-${BOOT_JDK_VERSION}/Contents/Home/bin/javac ]; then
echo Could not use ${BOOT_JDK_VARIABLE} - using /Library/Java/JavaVirtualMachines/adoptopenjdk-${BOOT_JDK_VERSION}/Contents/Home
export ${BOOT_JDK_VARIABLE}="/Library/Java/JavaVirtualMachines/adoptopenjdk-${BOOT_JDK_VERSION}/Contents/Home"
else
mkdir -p "$bootDir"
echo "Downloading GA release of boot JDK version ${BOOT_JDK_VERSION}..."
releaseType="ga"
Expand All @@ -100,14 +104,15 @@ if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
fi
fi
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi

if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then
Expand Down
53 changes: 30 additions & 23 deletions build-farm/platform-specific-configurations/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,29 @@ TOOLCHAIN_VERSION=""

# Any version above 8 (11 for now due to openjdk-build#1409
if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
if [ "$ARCHITECTURE" == "aarch64" ]; then
# Windows aarch64 cross compiles requires same version boot jdk
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION))"
else
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
fi
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="$bootDir"
if [ ! -d "$bootDir/bin" ]; then
if [ "$ARCHITECTURE" == "aarch64" ]; then
# Windows aarch64 cross compiles requires same version boot jdk
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION))"
else
BOOT_JDK_VERSION="$((JAVA_FEATURE_VERSION-1))"
fi
BOOT_JDK_VARIABLE="JDK$(echo $BOOT_JDK_VERSION)_BOOT_DIR"
if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then
bootDir="$PWD/jdk-$BOOT_JDK_VERSION"
# Note we export $BOOT_JDK_VARIABLE (i.e. JDKXX_BOOT_DIR) here
# instead of BOOT_JDK_VARIABLE (no '$').
export ${BOOT_JDK_VARIABLE}="$bootDir"
if [ ! -x "$bootDir/bin/javac.exe" ]; then
# Set to a default location as linked in the ansible playbooks
if [ -x /cygdrive/c/openjdk/jdk-${BOOT_JDK_VERSION}/bin/javac ]; then
echo Could not use ${BOOT_JDK_VARIABLE} - using /cygdrive/c/openjdk/jdk-${BOOT_JDK_VERSION}
export ${BOOT_JDK_VARIABLE}="/usr/lib/jvm/jdk-${BOOT_JDK_VERSION}"
else
# This is needed to convert x86-32 to x32 which is what the API uses
case "$ARCHITECTURE" in
"x86-32") downloadArch="x32";;
"x86-32") downloadArch="x32";;
"aarch64") downloadArch="x64";;
*) downloadArch="$ARCHITECTURE";;
*) downloadArch="$ARCHITECTURE";;
esac
echo "Downloading GA release of boot JDK version ${BOOT_JDK_VERSION}..."
releaseType="ga"
Expand All @@ -73,14 +78,15 @@ if [ "$JAVA_FEATURE_VERSION" -gt 11 ]; then
mv $(ls -d jdk-${BOOT_JDK_VERSION}*) "$bootDir"
fi
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi
export JDK_BOOT_DIR="$(eval echo "\$$BOOT_JDK_VARIABLE")"
"$JDK_BOOT_DIR/bin/java" -version
executedJavaVersion=$?
if [ $executedJavaVersion -ne 0 ]; then
echo "Failed to obtain or find a valid boot jdk"
exit 1
fi
"$JDK_BOOT_DIR/bin/java" -version 2>&1 | sed 's/^/BOOT JDK: /'
fi

if [ "${ARCHITECTURE}" == "x86-32" ]
Expand Down Expand Up @@ -220,6 +226,7 @@ if [ "${ARCHITECTURE}" == "aarch64" ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --disable-ccache --openjdk-target=aarch64-unknown-cygwin --with-build-jdk=$JDK_BOOT_DIR"
fi


if [ ! -z "${TOOLCHAIN_VERSION}" ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-toolchain-version=${TOOLCHAIN_VERSION}"
fi