From ccdcd2b968bfcc601d7f7b5d467b660cf55da212 Mon Sep 17 00:00:00 2001 From: Mike Aizatsky Date: Tue, 7 Mar 2017 13:50:59 -0800 Subject: [PATCH] [infra] cleaning non-serializable variables Fighting jenkins not NotSerializableException error --- infra/libfuzzer-pipeline.groovy | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infra/libfuzzer-pipeline.groovy b/infra/libfuzzer-pipeline.groovy index 498e3cbdc..5f41bd037 100644 --- a/infra/libfuzzer-pipeline.groovy +++ b/infra/libfuzzer-pipeline.groovy @@ -21,7 +21,8 @@ def call(body) { body.delegate = config body() - def project = new groovy.json.JsonSlurperClassic().parseText(config["project_json"]) + def projectJson = config["project_json"] + def project = new groovy.json.JsonSlurperClassic().parseText(projectJson) // Project configuration. def projectName = project["name"] ?: env.JOB_BASE_NAME @@ -69,6 +70,9 @@ def call(body) { afl: ["address"] ] + // project is not serializable, clear it. + project = null + timeout(time: 12, unit: 'HOURS') { node { def workspace = pwd() @@ -76,7 +80,7 @@ def call(body) { def uid = sh(returnStdout: true, script: 'id -u $USER').trim() def dockerRunOptions = "-e BUILD_UID=$uid --cap-add SYS_PTRACE" - echo "Building $dockerTag: $project" + echo "Building $dockerTag: $projectJson" sh "docker run --rm $dockerRunOptions -v $workspace:/workspace ubuntu bash -c \"rm -rf /workspace/out\"" sh "mkdir -p $workspace/out" @@ -102,6 +106,7 @@ def call(body) { path: "/" + dockerContextDir ] echo "srcmap: $srcmap" writeFile file: srcmapFile, text: groovy.json.JsonOutput.toJson(srcmap) + srcmap = null } // stage("docker image") for (sanitizer : sanitizers.keySet()) {