Skip to content

Commit

Permalink
Skip internal signing phase unless on windows/mac
Browse files Browse the repository at this point in the history
Signed-off-by: Stewart X Addison <[email protected]>
  • Loading branch information
sxa committed Nov 7, 2024
1 parent 6a60b6b commit bb9181b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pipelines/build/common/openjdk_build_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,7 @@ class Build {
def base_path
base_path = build_path
def repoHandler = new RepoHandler(USER_REMOTE_CONFIGS, ADOPT_DEFAULTS_JSON, buildConfig.CI_REF, buildConfig.BUILD_REF)

context.stage('internal sign') {
context.node('eclipse-codesign') {
// Safety first!
Expand Down Expand Up @@ -1661,6 +1662,7 @@ def buildScriptsAssemble(
def base_path
base_path = build_path
def assembleBuildArgs

// Remove jmod directories to be replaced with the stash saved above
batOrSh "rm -rf ${base_path}/hotspot/variant-server ${base_path}/support/modules_cmds ${base_path}/support/modules_libs"
// JDK 16 + jpackage executables need to be signed as well
Expand Down Expand Up @@ -1883,12 +1885,12 @@ def buildScriptsAssemble(
if (openjdk_build_dir_arg == "") {
// If not using a custom openjdk build dir, then query what autoconf created as the build sub-folder
if ( context.isUnix() ) {
base_path = context.sh(script: "ls -d ${build_path}/*", returnStdout:true)
base_path = context.sh(script: "ls -d ${build_path}/*", returnStdout:true).trim()
} else {
base_path = context.bat(script: "@ls -d ${build_path}/*", returnStdout:true).trim()
}
}
context.println "base build path for jmod signing = ${base_path}"
context.println "base_path for jmod signing = ${base_path}."
context.stash name: 'jmods',
includes: "${base_path}/hotspot/variant-server/**/*.exe," +
"${base_path}/hotspot/variant-server/**/*.dll," +
Expand Down Expand Up @@ -1958,7 +1960,7 @@ def buildScriptsAssemble(
if ((buildConfig.TARGET_OS == 'mac' || buildConfig.TARGET_OS == 'windows') && buildConfig.JAVA_TO_BUILD != 'jdk8u' && enableSigner) {
context.println "openjdk_build_pipeline: Internal signing phase required - skipping metadata reading"
} else {
// Run a downstream job on riscv machine that returns the java version. Otherwise, just read the version.txt
// Run a downstream job on riscv machine that returns the java version. Otherwise, just read the version.txt
String versionOut
if (buildConfig.BUILD_ARGS.contains('--cross-compile')) {
context.println "[WARNING] Don't read faked version.txt on cross compiled build! Archiving early and running downstream job to retrieve java version..."
Expand Down Expand Up @@ -2126,6 +2128,7 @@ def buildScriptsAssemble(
String userOrgRepo = "${splitAdoptUrl[splitAdoptUrl.size() - 2]}/${splitAdoptUrl[splitAdoptUrl.size() - 1]}"
// e.g. adoptium/temurin-build/master/build-farm/platform-specific-configurations
envVars.add("ADOPT_PLATFORM_CONFIG_LOCATION=${userOrgRepo}/${adoptBranch}/${ADOPT_DEFAULTS_JSON['configDirectories']['platform']}" as String)
def internalSigningRequired = (buildConfig.TARGET_OS == 'windows' || buildConfig.TARGET_OS == 'mac')

context.stage('queue') {
/* This loads the library containing two Helper classes, and causes them to be
Expand Down Expand Up @@ -2293,7 +2296,7 @@ def buildScriptsAssemble(
}
}
// Is thre potential for not enabling the signer on jdk8u instead of having this clause?
if ( enableSigner && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) {
if ( enableSigner && internalSigningRequired && buildConfig.JAVA_TO_BUILD != 'jdk8u' ) {
context.println "openjdk_build_pipeline: running eclipse signing phase"
buildScriptsEclipseSigner()
context.ws(workspace) {
Expand Down Expand Up @@ -2338,7 +2341,7 @@ def buildScriptsAssemble(
enableSigner,
envVars
)
if ( enableSigner ) {
if ( enableSigner && internalSigningRequired ) {
buildScriptsEclipseSigner()
context.println "openjdk_build_pipeline: running assemble phase (invocation 2)"
buildScriptsAssemble(
Expand All @@ -2358,7 +2361,7 @@ def buildScriptsAssemble(
enableSigner,
envVars
)
if ( enableSigner ) {
if ( enableSigner && internalSigningRequired ) {
buildScriptsEclipseSigner()
context.println "openjdk_build_pipeline: running assemble phase (invocation 3)"
buildScriptsAssemble(
Expand Down

0 comments on commit bb9181b

Please sign in to comment.