Skip to content

Commit

Permalink
Rename getReproducibleCompare to isEnableReproducibleCompare
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <[email protected]>
  • Loading branch information
sophia-guo committed Jun 16, 2023
1 parent b7e00a7 commit c781126
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
26 changes: 15 additions & 11 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Builder implements Serializable {
if (additionalBuildArgs) {
buildArgs += ' ' + additionalBuildArgs
}
def enableReproducibleCompare = getReproducibleCompare(platformConfig, variant)
def enableReproducibleCompare = isEnableReproducibleCompare(platformConfig, variant)
def testList = getTestList(platformConfig, variant)

def dynamicTestsParameters = getDynamicParams(platformConfig, variant)
Expand Down Expand Up @@ -221,17 +221,21 @@ class Builder implements Serializable {
/*
Get reproduciableCompare flag from the build configurations.
*/
Boolean getReproducibleCompare(Map<String, ?> configuration, String variant) {
Boolean isEnableReproducibleCompare(Map<String, ?> configuration, String variant) {
Boolean enableReproducibleCompare = DEFAULTS_JSON['testDetails']['enableReproducibleCompare'] as Boolean
if (configuration.containsKey('reproducibleCompare')) {
def reproducibleCompare
if (isMap(configuration.reproducibleCompare)) {
reproducibleCompare = (configuration.reproducibleCompare as Map).get(variant)
} else {
reproducibleCompare = configuration.reproducibleCompare
}
if (reproducibleCompare != null) {
enableReproducibleCompare = reproducibleCompare
if ( env.JOB_NAME.contains('pr-tester') || env.JOB_NAME.contains('release')) {
enableReproducibleCompare = false
} else {
if (configuration.containsKey('reproducibleCompare')) {
def reproducibleCompare
if (isMap(configuration.reproducibleCompare)) {
reproducibleCompare = (configuration.reproducibleCompare as Map).get(variant)
} else {
reproducibleCompare = configuration.reproducibleCompare
}
if (reproducibleCompare != null) {
enableReproducibleCompare = reproducibleCompare
}
}
}
return enableReproducibleCompare
Expand Down
4 changes: 2 additions & 2 deletions pipelines/build/common/config_regeneration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class Regeneration implements Serializable {
* @param configuration
* @param variant
*/
Boolean getReproducibleCompare(Map<String, ?> configuration, String variant) {
Boolean isEnableReproducibleCompare(Map<String, ?> configuration, String variant) {
Boolean enableReproducibleCompare = DEFAULTS_JSON['testDetails']['enableReproducibleCompare'] as Boolean
if (configuration.containsKey('reproducibleCompare')) {
def reproducibleCompare
Expand Down Expand Up @@ -445,7 +445,7 @@ class Regeneration implements Serializable {

def numMachines = getDynamicParams().get('numMachines')

def enableReproducibleCompare = getReproducibleCompare(platformConfig, variant)
def enableReproducibleCompare = isEnableReproducibleCompare(platformConfig, variant)

return new IndividualBuildConfig( // final build config
JAVA_TO_BUILD: javaToBuild,
Expand Down
16 changes: 8 additions & 8 deletions tools/reproduce_comparison/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Jenkins job does reproducible build compare.
import groovy.json.JsonOutput

pipeline {
agent any
agent { label 'dockerBuild&&linux&&x64' }
parameters {
string(name: 'COMPARED_JOB_NUMBER', defaultValue: '', description: 'Compared nightly build job name')
string(name: 'COMPARED_JOB_NAME', defaultValue: '', description: 'Compared nightly build job number')
Expand Down Expand Up @@ -59,7 +59,7 @@ pipeline {
jsonJobParams.BUILD_CONFIGURATION.SCM_REF = scmRef
jsonJobParams.BUILD_CONFIGURATION.BUILD_REF = buildRef
jsonJobParams.BUILD_CONFIGURATION.BUILD_ARGS += " --build-reproducible-date ${buildTimeStamp}"
jsonJobParams.BUILD_CONFIGURATION.ENABLE_REPRODUCIBLE_COMPARE = "false"
jsonJobParams.BUILD_CONFIGURATION.ENABLE_REPRODUCIBLE_COMPARE = false

def buildParams = [
text(name: 'BUILD_CONFIGURATION', value: JsonOutput.prettyPrint(JsonOutput.toJson(jsonJobParams.BUILD_CONFIGURATION))),
Expand Down Expand Up @@ -95,13 +95,13 @@ pipeline {

def originalJDKFile = findFiles(glob: "original/*.tar.gz")
def reproducedJDKFile = findFiles(glob: "reproduced/*.tar.gz")
def untarOriginalJDK = sh returnStatus: true, script: "tar -xz ${originalJDKFile[0].name} -C original"
def untarOriginalJDK = sh returnStatus: true, script: "tar xzf ${originalJDKFile[0].path} -C original"
if (untarOriginalJDK != 0 ) {
currentBuild.result = 'UNSTABLE'
error " Untar ${originalJDKFile[0].name} failed"
return
}
def untarReproducedJDK = sh returnStatus: true, script: "tar -xz ${reproducedJDKFile[0].name} -C reproduced"
}
def untarReproducedJDK = sh returnStatus: true, script: "tar xzf ${reproducedJDKFile[0].path} -C reproduced"
if (untarReproducedJDK != 0 ) {
currentBuild.result = 'UNSTABLE'
error " Untar ${reproducedJDKFile[0].name} failed"
Expand All @@ -115,13 +115,13 @@ pipeline {
checkout([$class: 'GitSCM', branches: [[name: 'master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "temurin-build"]], submoduleCfg: [], userRemoteConfigs: [[url: "https://github.com/adoptium/temurin-build.git"]]])
script {
try {
dir('temurin-build/tools/reproduce_comparison') {
dir('temurin-build/tooling') {
def rc = 0
if (COMPARED_JOB_NAME.contains('linux')) {
rc = sh returnStatus: true, script: "./tooling/linux_repo_compare.sh temurin ./original temurin ./reproduced"
rc = sh returnStatus: true, script: "./linux_repro_compare.sh temurin ${WORKSPACE}/original temurin ${WORKSPACE}/reproduced"
} else if (COMPARED_JOB_NAME.contains('mac')) {
// mac
//sh "./tooling/mac_repo_compare.sh temurin ./original temurin ./reproduced ${self_cert_file} ${self_cert_passwd}"
//sh "./tooling/mac_repro_compare.sh temurin ./original temurin ./reproduced ${self_cert_file} ${self_cert_passwd}"
echo 'todo mac build comparison'
} else if (COMPARED_JOB_NAME.contains('windows')) {
//windows
Expand Down

0 comments on commit c781126

Please sign in to comment.