Skip to content

Commit

Permalink
Merge branch 'master' into fix_AddBuildNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
austin0 authored Sep 2, 2020
2 parents 16762af + e9d3ebf commit 0250a7d
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 13 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ the one you are trying to build.
-k, --keep
if using docker, keep the container after the build.
--make-exploded-image
creates an exploded image (useful for codesigning jmods). Use --assemble-exploded-image once you have signed the jmods to complete the packaging steps.
-n, --no-colour
disable colour output.
Expand Down
3 changes: 2 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ The following examples all use `-m1` as an example - this gets replaced with a l
3. OpenJDK extensions branches the `openj9` branch to create the release branch, called `openj9-0.nn.0`
4. Ask someone in the extensions team to make the following modifications:
* Update [closed/get_j9_source.sh](https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/openj9/closed/get_j9_source.sh) (Link is for JDK11, chnage as appropriate!) to pull in Eclipse OpenJ9 & OMR milestone 1 tags e.g. `openj9-0.nn.0-m1`([Sample PR](https://github.com/ibmruntimes/openj9-openjdk-jdk11/commit/4607d33d99c566054261557fdf34bcbfaefc6480))
* Update custom-spec.gmk.in with correct `J9JDK_EXT_VERSION` for the release, [Sample commit for 11](https://github.com/ibmruntimes/openj9-openjdk-jdk8/commit/8512fe26e568962d4ee08f82f2f59d3bb241bb9d) and [Sample commit for 11](https://github.com/ibmruntimes/openj9-openjdk-jdk11/commit/c7964e29fea19a7803a86bc991de0d0e45547dc8) e.g:
* Update custom-spec.gmk.in with correct `J9JDK_EXT_VERSION` for the release, [Sample commit for 8](https://github.com/ibmruntimes/openj9-openjdk-jdk8/commit/8512fe26e568962d4ee08f82f2f59d3bb241bb9d) and [Sample commit for 11](https://github.com/ibmruntimes/openj9-openjdk-jdk11/commit/c7964e29fea19a7803a86bc991de0d0e45547dc8) e.g:
```
jdk11+ ==> J9JDK_EXT_VERSION       := 11.0.5.0-m1
jdk8     ==>  J9JDK_EXT_VERSION       := $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_MOD_VERSION).$(JDK_FIX_VERSION)-m1
Expand All @@ -154,6 +154,7 @@ JDK_FIX_VERSION=0
* `targetConfigurations`: remove all "hotspot" entries
* `releaseType`: `Nightly`
* `overridePublishName`: github binaries publish name, e.g. `jdk8u232-b09_openj9-0.17.0-m1` or `jdk-11.0.5+10_openj9-0.17.0-m1`
(Note: Everything before the underscore should be copied from the OPENJDK_TAG value inside <extensions_repo_url>/closed/openjdk-tag.gmk)
* `scmReference`: extensions release branch: e.g. `openj9-0.17.0`
* `additionalConfigureArgs`: JDK8: `--with-milestone=fcs`, JDK11+: `--without-version-pre --without-version-opt`
* `enableTests`: "ticked"
Expand Down
4 changes: 4 additions & 0 deletions configureBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ function setMakeArgs() {
"darwin") BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]=${BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]:-"product-images mac-legacy-jre-bundle"} ;;
*) BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]=${BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]:-"product-images legacy-jre-image"} ;;
esac
# In order to build an exploded image, no other make targets can be used
if [ "${BUILD_CONFIG[MAKE_EXPLODED]}" == "true" ]; then
BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]=""
fi
else
BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]=${BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]:-"images"}
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Config11 {
],
riscv64Linux : [
os : 'linux',
additionalNodeLabels : 'riscvcross',
dockerImage : 'adoptopenjdk/centos6_build_image',
arch : 'riscv64',
configureArgs : '--disable-ddr --openjdk-target=riscv64-unknown-linux-gnu --with-sysroot=/opt/fedora28_riscv_root'
],
Expand Down
4 changes: 3 additions & 1 deletion pipelines/jobs/pipeline_job_template.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ if(!binding.hasVariable('triggerSchedule')) {
gitRefSpec = ""
propagateFailures = false
runTests = true
runInstaller = true

// if true means this is running in the pr builder pipeline
if (binding.hasVariable('PR_BUILDER')) {
triggerSchedule = "0 0 31 2 0"
gitRefSpec = "+refs/pull/*:refs/remotes/origin/pr/* +refs/heads/master:refs/remotes/origin/master +refs/heads/*:refs/remotes/origin/*"
propagateFailures = true
runTests = false
runInstaller = false
}

if (!binding.hasVariable('disableJob')) {
Expand Down Expand Up @@ -61,7 +63,7 @@ pipelineJob("${BUILD_FOLDER}/${JOB_NAME}") {
stringParam('overridePublishName', "", '<strong>REQUIRED for OpenJ9</strong>: Name that determines the publish name (and is used by the meta-data file), defaults to scmReference(minus _adopt if present).<br/>Nightly builds: Leave blank (defaults to a date_time stamp).<br/>OpenJ9 Release build Java 8 example <code>jdk8u192-b12_openj9-0.12.1</code> and for OpenJ9 Java 11 example <code>jdk-11.0.2+9_openj9-0.12.1</code>.')
stringParam('scmReference', "", 'Tag name or Branch name from which to build. Nightly builds: Defaults to, Hotspot=dev, OpenJ9=openj9, others=master.</br>Release builds: For hotspot JDK8 this would be the OpenJDK tag, for hotspot JDK11+ this would be the Adopt merge tag for the desired OpenJDK tag eg.jdk-11.0.4+10_adopt, and for OpenJ9 this will be the release branch, eg.openj9-0.14.0.')
booleanParam('enableTests', runTests, 'If set to true the test pipeline will be executed')
booleanParam('enableInstallers', true, 'If set to true the installer pipeline will be executed')
booleanParam('enableInstallers', runInstaller, 'If set to true the installer pipeline will be executed')
stringParam('additionalConfigureArgs', "", "Additional arguments that will be ultimately passed to OpenJDK's <code>./configure</code>")
stringParam('additionalBuildArgs', "", "Additional arguments to be passed to <code>makejdk-any-platform.sh</code>")
stringParam('overrideFileNameVersion', "", "When forming the filename, ignore the part of the filename derived from the publishName or timestamp and override it.<br/>For instance if you set this to 'FOO' the final file name will be of the form: <code>OpenJDK8U-jre_ppc64le_linux_openj9_FOO.tar.gz</code>")
Expand Down
27 changes: 22 additions & 5 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ buildTemplatedFile() {
ADDITIONAL_MAKE_TARGETS=" test-image"
fi

if [[ "${BUILD_CONFIG[MAKE_EXPLODED]}" == "true" ]]; then
# In order to make an exploded image we cannot have any additional targets
ADDITIONAL_MAKE_TARGETS=""
fi

FULL_MAKE_COMMAND="${BUILD_CONFIG[MAKE_COMMAND_NAME]} ${BUILD_CONFIG[MAKE_ARGS_FOR_ANY_PLATFORM]} ${BUILD_CONFIG[USER_SUPPLIED_MAKE_ARGS]} ${ADDITIONAL_MAKE_TARGETS}"

# shellcheck disable=SC2002
Expand Down Expand Up @@ -922,6 +927,16 @@ cd "${BUILD_CONFIG[WORKSPACE_DIR]}"

parseArguments "$@"

if [[ "${BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]}" == "true" ]]; then
buildTemplatedFile
executeTemplatedFile
removingUnnecessaryFiles
copyFreeFontForMacOS
createOpenJDKTarArchive
showCompletionMessage
exit 0
fi

buildSharedLibs

wipeOutOldTargetDir
Expand All @@ -934,12 +949,14 @@ configureCommandParameters
buildTemplatedFile
executeTemplatedFile

printJavaVersionString
addInfoToReleaseFile
if [[ "${BUILD_CONFIG[MAKE_EXPLODED]}" != "true" ]]; then
printJavaVersionString
addInfoToReleaseFile
removingUnnecessaryFiles
copyFreeFontForMacOS
createOpenJDKTarArchive
fi

removingUnnecessaryFiles
copyFreeFontForMacOS
createOpenJDKTarArchive
showCompletionMessage

# ccache is not detected properly TODO
Expand Down
11 changes: 11 additions & 0 deletions sbin/common/config_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# map. This is why we can't have nice things.
CONFIG_PARAMS=(
ADOPT_PATCHES
ASSEMBLE_EXPLODED_IMAGE
OPENJDK_BUILD_REPO_BRANCH
OPENJDK_BUILD_REPO_URI
BRANCH
Expand Down Expand Up @@ -65,6 +66,7 @@ TEST_IMAGE_PATH
JVM_VARIANT
MACOSX_CODESIGN_IDENTITY
MAKE_ARGS_FOR_ANY_PLATFORM
MAKE_EXPLODED
MAKE_COMMAND_NAME
NUM_PROCESSORS
OPENJDK_BUILD_NUMBER
Expand Down Expand Up @@ -198,6 +200,12 @@ function parseConfigurationArguments() {
"--make-args" )
BUILD_CONFIG[USER_SUPPLIED_MAKE_ARGS]="$1"; shift;;

"--make-exploded-image" )
BUILD_CONFIG[MAKE_EXPLODED]=true;;

"--assemble-exploded-image" )
BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]=true;;

"--codesign-identity" )
BUILD_CONFIG[MACOSX_CODESIGN_IDENTITY]="$1"; shift;;

Expand Down Expand Up @@ -353,6 +361,9 @@ function configDefaults() {
# The OpenJDK source code repository to build from, e.g. an AdoptOpenJDK repo
BUILD_CONFIG[REPOSITORY]=""

BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]=${BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]:-"false"}
BUILD_CONFIG[MAKE_EXPLODED]=${BUILD_CONFIG[MAKE_EXPLODED]:-"false"}

# The default AdoptOpenJDK/openjdk-build repo branch
BUILD_CONFIG[OPENJDK_BUILD_REPO_BRANCH]="master"

Expand Down
33 changes: 28 additions & 5 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ checkoutAndCloneOpenJDKGitRepo() {

updateOpenj9Sources

createSourceTagFile

cd "${BUILD_CONFIG[WORKSPACE_DIR]}"
}

Expand Down Expand Up @@ -628,12 +630,33 @@ applyPatches() {
fi
}

# jdk8u requires a .hgtip file to populate the "SOURCE" tag in the release file.
# Creates .hgtip and populates it with the git sha of the last commit(s).
createSourceTagFile(){
if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then
local OpenJDK_TopDir="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}"
local OpenJDK_SHA=$(git -C $OpenJDK_TopDir rev-parse --short HEAD)
if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]; then
# OpenJ9 list 3 SHA's in their release file: OpenJDK, OpenJ9, and OMR.
local OpenJ9_TopDir="$OpenJDK_TopDir/openj9"
local OMR_TopDir="$OpenJDK_TopDir/omr"
local OpenJ9_SHA=$(git -C $OpenJ9_TopDir rev-parse --short HEAD)
local OMR_SHA=$(git -C $OMR_TopDir rev-parse --short HEAD)
(printf "OpenJDK: %s OpenJ9: %s OMR: %s" $OpenJDK_SHA $OpenJ9_SHA $OMR_SHA) > $OpenJDK_TopDir/.hgtip
else # Other variants only list the main repo SHA.
(printf "OpenJDK: %s" $OpenJDK_SHA) > $OpenJDK_TopDir/.hgtip
fi
fi
}

##################################################################

function configureWorkspace() {
createWorkspace
downloadingRequiredDependencies
relocateToTmpIfNeeded
checkoutAndCloneOpenJDKGitRepo
applyPatches
if [[ "${BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]}" != "true" ]]; then
createWorkspace
downloadingRequiredDependencies
relocateToTmpIfNeeded
checkoutAndCloneOpenJDKGitRepo
applyPatches
fi
}

0 comments on commit 0250a7d

Please sign in to comment.