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

allowing build from diectory/src snapshot #3724

Closed
wants to merge 4 commits into from
Closed
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
15 changes: 15 additions & 0 deletions makejdk-any-platform.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ that you are building for further details.
This will start a Docker container and build you the latest Java 8 Temurin
binary from the source at https://github.com/adoptium/openjdk-jdk8u

"./makejdk-any-platform.sh --jdk-dir-altid jdk17u ~/repos/myJdk"

This will start a build of yours myJdk directory treating it as jdk17

"./makejdk-any-platform.sh jdk21u.tar.gz"

This will start a build of yours source tarball of jdk17.
But it is always safer with --jdk-dir-altid

Please visit https://www.adoptium.net for further support

.SH VERSIONS
Expand Down Expand Up @@ -119,6 +128,12 @@ For reference, OpenJDK needs the previous version of a JDK in order to build
itself. You should select the path to a JDK install that is N-1 versions below
the one you are trying to build.
.TP
.BR " \-\-jdk-dir-altid " " \fI<string_word>\fR
specify the name of original forest if the name of the dir is not self-describing.
This build script is deducting several parts from repository name. If your dir
do not fit by naming conventions and you do not set individual parts, use this.
Used only if built jdk is local directory, and not remote repositroy.
.TP
.BR \-k ", " \-\-keep
if using docker, keep the container after the build.
.TP
Expand Down
27 changes: 17 additions & 10 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ configureMacOSCodesignParameter() {
# Get the OpenJDK update version and build version
getOpenJDKUpdateAndBuildVersion() {
cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"

if [ -d "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" ]; then
if [ "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "true" ]; then
echo "Version: local dir; OPENJDK_BUILD_NUMBER set as ${BUILD_CONFIG[OPENJDK_BUILD_NUMBER]}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OPENJDK_BUILD_NUMBER is in fact just the openjdk build number, so for example jdk-21.0.2+13, the build number is just "13"
I think you probably want to use "TAG" in this echo statement, and when you build from your own forest source you would pass arguments:

--openjdk-source <path_to_tarball>
--tag jdk-17.0.12+4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Surprisingly in this whole enhancement I was not calculating with the tag. It is jsut tarball/dir - I do pretend I do not care baout whatever version it is/was. However jdk major "the number" is absolutely necessary, is deducted few times, by various ways, and there is no way around.

I will keep this as it is, unless the tags will come more to play.

elif [ -d "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" ]; then

# It does exist and it's a repo other than the Temurin one
cd "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" || return
Expand Down Expand Up @@ -1802,15 +1803,20 @@ getFirstTagFromOpenJDKGitRepo() {
TAG_SEARCH="aarch64-shenandoah-jdk8u*-b*"
fi

# If openj9 and the closed/openjdk-tag.gmk file exists which specifies what level the openj9 jdk code is based upon,
# read OPENJDK_TAG value from that file.
local openj9_openjdk_tag_file="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/closed/openjdk-tag.gmk"
if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]] && [[ -f "${openj9_openjdk_tag_file}" ]]; then
firstMatchingNameFromRepo=$(grep OPENJDK_TAG ${openj9_openjdk_tag_file} | awk 'BEGIN {FS = "[ :=]+"} {print $2}')
if [ "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "true" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't modify the getFirstTagFromOpenJDKGitRepo() method at all, it should only be called for a "git repo",
instead you need to modify the getOpenJdkVersion() to correctly return the jdk tag version of the forest openjdk source, I suspect as specified via the build arg --tag <jdk tag version>.
So I am thinking if --openjdk-source <path to tarball> is specified then --tag <jdk tag version> is mandatory in order to specify what the version within the source tarball is being built...
The tag version string is used by the build scripts for things like the image archive filenames...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't modify the getFirstTagFromOpenJDKGitRepo() method at all, it should only be called for a "git repo", instead you need to modify the getOpenJdkVersion() to correctly return the jdk tag version of the forest openjdk

Thanx, will do!

source, I suspect as specified via the build arg --tag . So I am thinking if --openjdk-source is specified then --tag is mandatory in order to specify what the version within the source tarball is being built... The tag version string is used by the build scripts for things like the image archive filenames...

I think it defaults to some unknonw or head, but I will double check. If it do not default, then I would rather default it to some "local" rather then make it mandatory. Of course, it it is set, then it will be used

echo "Skipping tag reading from local dir. You shoud have set up at least OPENJDK_FEATURE_NUMBER" 1>&2
firstMatchingNameFromRepo=""
else
git fetch --tags "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"
firstMatchingNameFromRepo=$(git tag --list "$TAG_SEARCH" | "$get_tag_cmd")
fi
# If openj9 and the closed/openjdk-tag.gmk file exists which specifies what level the openj9 jdk code is based upon,
# read OPENJDK_TAG value from that file.
local openj9_openjdk_tag_file="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/closed/openjdk-tag.gmk"
if [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]] && [[ -f "${openj9_openjdk_tag_file}" ]]; then
firstMatchingNameFromRepo=$(grep OPENJDK_TAG ${openj9_openjdk_tag_file} | awk 'BEGIN {FS = "[ :=]+"} {print $2}')
else
git fetch --tags "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"
firstMatchingNameFromRepo=$(git tag --list "$TAG_SEARCH" | "$get_tag_cmd")
fi
fi

if [ -z "$firstMatchingNameFromRepo" ]; then
echo "WARNING: Failed to identify latest tag in the repository" 1>&2
Expand Down Expand Up @@ -2241,6 +2247,7 @@ echo "build.sh : $(date +%T) : Configuring workspace inc. clone and cacerts gene
configureWorkspace

echo "build.sh : $(date +%T) : Initiating build ..."
set -x
getOpenJDKUpdateAndBuildVersion
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]]; then
patchFreetypeWindows
Expand Down
13 changes: 13 additions & 0 deletions sbin/common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
# shellcheck disable=SC2153
function setOpenJdkVersion() {
local forest_name=$1
set -x
if [ -e "${forest_name}" ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right place for this logic.

  1. Existing build arg --version <forest_name> can be used instead of OPENJDK_FOREST_ALTID
  2. I think specify the openjdk srcDirectory/Tarball via a build arg of say : --openjdk-source <full path to srcDirectory/Tarball> and that sets the variable OPENJDK_FOREST_SOURCE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two things mixed togehter.

Yyou are absolutly correct and --version is exactly what OPENJDK_FOREST_ALTID was substituing. I will remove --jdk-dir-altid in favour of --version It will need some more changes, nut better then additional single purposed switch. Sorry for missing --version.

I woudl very like to avoid the --openjdk-source. it would kill the script logic. Teh script expects repository_name or dir/tarball. The usage of make_any_jdk.sh dir is much more strigthforward and much usable then the verbose one. In additoon, the script will be pulluted by nasty (imo) if:

"expects exactly one argument, unless --openjdk-source si used, then it expects no argument"

Unless you are expecting the usage as make_any_jdk.sh --openjdk-source some_terrible_name/path/zip id`
Where id is still mandatory, and is providing the necessary "original repo" information.
I like "my" approach a bti more, because it have less mandatory arguments

  • make_any_jdk.sh some_terrible_name/path/zip +optional version id - because the name/path/zip maybe akready proper version.

In comaprison to

  • make_any_jdk.sh --openjdk-source some_terrible_name/path/zip with mandatory --openjdk-source and otional short id.

wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe, the syntax of makejdk-any-platform.sh, is:

makejdk-any-platform.sh <jdk_version>

Where jdk_version is what has historically been named as the "forest version"
From jdk_version you must be able to set:

BUILD_CONFIG[OPENJDK_CORE_VERSION]       eg. jdk21
BUILD_CONFIG[OPENJDK_FOREST_NAME]        eg. jdk21u
BUILD_CONFIG[OPENJDK_FEATURE_NUMBER] eg. 21

These are needed throughtout the sbin/build.sh build logic.. So you will need to set these from some_terrible_name/path/zip ??

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually prefer:

makejdk-any-platform.sh jdk21u --openjdk-source some_terrible_name/path/zip

because the existing logic very clearly set:

BUILD_CONFIG[OPENJDK_CORE_VERSION]       eg. jdk21
BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]   eg. 21

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe, the syntax of makejdk-any-platform.sh, is:

makejdk-any-platform.sh <jdk_version>

Where jdk_version is what has historically been named as the "forest version" From jdk_version you must be able to set:

BUILD_CONFIG[OPENJDK_CORE_VERSION]       eg. jdk21
BUILD_CONFIG[OPENJDK_FOREST_NAME]        eg. jdk21u
BUILD_CONFIG[OPENJDK_FEATURE_NUMBER] eg. 21

These are needed throughtout the sbin/build.sh build logic.. So you will need to set these from some_terrible_name/path/zip ??

Exactly, And thats what that dir/zip i susually named. See #3727
For cases Where the the dir/tarball is nonsense from this pint of vie, I introduced that altid, which will be substituted by version. And used that to set featureversion, if used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would actually prefer:

makejdk-any-platform.sh jdk21u --openjdk-source some_terrible_name/path/zip

because the existing logic very clearly set:

BUILD_CONFIG[OPENJDK_CORE_VERSION]       eg. jdk21
BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]   eg. 21

Probably my main reason is to save typing --openjdk-source every time I wish to build some properly named directory:( I was resuing the logic which set

BUILD_CONFIG[OPENJDK_CORE_VERSION]       eg. jdk21
BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]   eg. 21

properly. Do you really insists?

BUILD_CONFIG[OPENJDK_FOREST_DIR]="true"
BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]=$(readlink -f "${forest_name}")
BUILD_CONFIG[DISABLE_ADOPT_BRANCH_SAFETY]="true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User should specify build arg: --disable-adopt-branch-safety

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was breaking in the branching block. I can remove this, but conisder:

  • the branch safety is usels above tarball/dir without .git
  • I will need to add if into the block using BUILD_CONFIG[DISABLE_ADOPT_BRANCH_SAFETY]

I will obey as you need, but the setup of it sounds to me more clean and less harmfull.

if [ ! -z "${BUILD_CONFIG[OPENJDK_FOREST_ALTID]}" ] ; then
forest_name="${BUILD_CONFIG[OPENJDK_FOREST_ALTID]}"
else
# we want to use "." and similar
forest_name=$(basename "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}")
fi
BUILD_CONFIG[OPENJDK_SOURCE_DIR]="${forest_name}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't set OPENJDK_SOURCE_DIR, as that is set to the folder under the WORK_DIR, default "src", and is where the git clone of openjdk clones the source.
The unzipping/copying of the forest source, should unzip/copy to the OPENJDK_SOURCE_DIR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, I agree, I think I set it because I was unsure how to proeprly set the name to be read by. Will elaborate and fix

fi

# Derive the openjdk_core_version from the forest name.
local openjdk_core_version=${forest_name}
Expand Down
15 changes: 15 additions & 0 deletions sbin/common/config_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ NUM_PROCESSORS
OPENJDK_BUILD_NUMBER
OPENJDK_CORE_VERSION
OPENJDK_FEATURE_NUMBER
OPENJDK_FOREST_ALTID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think all you need is a OPENJDK_FOREST_SOURCE build arg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean --version ? Thats what I will use instead of OPENJDK_FOREST_ALTID. The directory/tarball should remain the only mandatory argument, which was name of the repo untill now.

OPENJDK_FOREST_NAME
OPENJDK_FOREST_DIR
OPENJDK_FOREST_DIR_ABSPATH
OPENJDK_SOURCE_DIR
OPENJDK_UPDATE_VERSION
OS_KERNEL_NAME
Expand Down Expand Up @@ -306,6 +309,9 @@ function parseConfigurationArguments() {
"--jdk-boot-dir" | "-J" )
BUILD_CONFIG[JDK_BOOT_DIR]="$1";shift;;

"--jdk-dir-altid")
BUILD_CONFIG[OPENJDK_FOREST_ALTID]="$1";shift;;

"--cross-compile" )
BUILD_CONFIG[CROSSCOMPILE]=true;;

Expand Down Expand Up @@ -457,6 +463,15 @@ function configDefaults() {
# The full forest name, e.g. jdk8, jdk8u, jdk9, jdk9u, etc.
BUILD_CONFIG[OPENJDK_FOREST_NAME]=""

# whether the forest is local directory or not
BUILD_CONFIG[OPENJDK_FOREST_DIR]="false"

# whether the forest is local directory or not
BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]=""

# whether user provided original repo if the directory is useless
BUILD_CONFIG[OPENJDK_FOREST_ALTID]=""

# The abridged openjdk core version name, e.g. jdk8, jdk9, etc.
BUILD_CONFIG[OPENJDK_CORE_VERSION]=""

Expand Down
60 changes: 56 additions & 4 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
################################################################################

set -eu

set -x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debug..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing. before merge, all -x will be removed. I think there is still quite some iterations ahead. of us. Thanx a lot fo reding it through!

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# shellcheck source=sbin/common/constants.sh
Expand All @@ -37,14 +37,52 @@ ALSA_LIB_CHECKSUM=${ALSA_LIB_CHECKSUM:-5f2cd274b272cae0d0d111e8a9e363f0878332915
ALSA_LIB_GPGKEYID=${ALSA_LIB_GPGKEYID:-A6E59C91}
FREETYPE_FONT_SHARED_OBJECT_FILENAME="libfreetype.so*"


copyFromDir() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyFromDir() and unpackFromArchive() need to "copy"/"unpack" the forest openjdk source to where the build scripts intends to build the source within the defined WORKING_DIR,
ie. both these methods need to end up copying the source to be built to the location:

"${BUILD_CONFIG[WORKSPACE_DIR]:?}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original clonnign script is using the "." too, if that is what you are reffereing. I was wondering too that there is no ful apth, but just "."

I will heapily switch to full path instead of "." but allt he cloning methods were really exppecting other parts to cd for them. Can you confirm please?

echo "Copyng existing ${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]} to `pwd`/${BUILD_CONFIG[OPENJDK_FOREST_NAME]} to be built"
mkdir -p "./${BUILD_CONFIG[OPENJDK_FOREST_NAME]}"
# we really do not want to use .git for dirs, as we expect user have them set up, ignoring them
local files=$(find ${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]} -maxdepth 1 -mindepth 1 | grep -v -e "/workspace$" -e "/build$" -e "/.git")
cp -rf $files "./${BUILD_CONFIG[OPENJDK_FOREST_NAME]}/"
}

unpackFromArchive() {
echo "Extracting source tarball ${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]} to `pwd`/${BUILD_CONFIG[OPENJDK_FOREST_NAME]} to be built"
mkdir -p "./${BUILD_CONFIG[OPENJDK_FOREST_NAME]}"
# if the tarball contains .git files, they should be ignored later withut shame
# todo, support also zips?
pushd "./${BUILD_CONFIG[OPENJDK_FOREST_NAME]}"
local topLevelItems=$(tar --exclude='*/*' -tf "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}" | wc -l)
if [ "$topLevelItems" -eq "1" ] ; then
echo "Source tarball contans exaclty one directory, using"
tar --strip-components 1 -xf "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}"
else
echo "Source tarball do not contains top level directory, using"
tar -xf "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}"
fi
popd
}

copyFromDirOrUnpackFromArchive() {
if [ -d "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}" ] ; then
copyFromDir
elif [ -f "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}" ] ; then
unpackFromArchive
else
echo "Not directory nor file ${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}"
exit 1
fi
rm -vf ./${BUILD_CONFIG[OPENJDK_FOREST_NAME]}/build/*/configure-support/config.status
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be needed as the build-scripts will clean the autoconf configuration in the intended build location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unluckily it is necessary. The methods later in build.sh, are not expoecting prexsiting configuration, and the builds were failing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you copyOrUntarZip() methods should be copying/untaring the source to where temurin-build scripts is doing the build, ie. to ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}
So you can simply exclude copying "build/*"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Thats what they do (the copying is on correect place, to correct destination, simply substituting instea of the cloned repo.
  • I will try to exclude build. Will be indeed better.

}

# Create a new clone or update the existing clone of the OpenJDK source repo
# TODO refactor this for Single Responsibility Principle (SRP)
checkoutAndCloneOpenJDKGitRepo() {

cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"

# Check that we have a git repo, we assume that it is a repo that contains openjdk source
if [ -d "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" ]; then
if [ -d "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" -a "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "false" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use && to be consistent with this script

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ouch. Sorry. Will do!

set +e
git --git-dir "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" remote -v
echo "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}"
Expand Down Expand Up @@ -78,6 +116,8 @@ checkoutAndCloneOpenJDKGitRepo() {
echo "If this is inside a docker you can purge the existing source by passing --clean-docker-build"
exit 1
fi
elif [ "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "true" ]; then
copyFromDirOrUnpackFromArchive
elif [ ! -d "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" ]; then
echo "Could not find a valid openjdk git repository at $(pwd)/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]} so re-cloning the source to openjdk"
rm -rf "${BUILD_CONFIG[WORKSPACE_DIR]:?}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"
Expand Down Expand Up @@ -106,8 +146,9 @@ checkoutAndCloneOpenJDKGitRepo() {
fi
fi

git clean -ffdx

if [ ! "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "true" ]; then
git clean -ffdx
fi
updateOpenj9Sources

createSourceTagFile
Expand All @@ -118,6 +159,17 @@ checkoutAndCloneOpenJDKGitRepo() {
# Checkout the required code to build from the given cached git repo
# Set checkoutRc to result so we can retry
checkoutRequiredCodeToBuild() {

if [ "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "true" ]; then
echo "skipping checkoutRequiredCodeToBuild - local directory under processing:"
echo " workspace = ${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"
echo " BUILD_VARIANT = ${BUILD_CONFIG[BUILD_VARIANT]}"
echo " TAG = ${BUILD_CONFIG[TAG]} - Used only in name, if at all"
echo " BRANCH = ${BUILD_CONFIG[BRANCH]} - UNUSED!"
checkoutRc=0
return
fi

checkoutRc=1

cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"
Expand Down
Loading