Bug 1274350 - Ensure that environment variables in task definitions are always strings r=me
authorTim Taubert <ttaubert@mozilla.com>
Thu, 02 Jun 2016 11:04:55 +0200
changeset 12233 6220b0c247affbb96291a1434f06a57ac5338414
parent 12232 4d5f8d533df4946bf3ce556eba3f23b2b7dba19f
child 12234 bd5fa88a8d4a525f7935fadbaa891eb9f40ae556
push id1283
push userttaubert@mozilla.com
push dateThu, 02 Jun 2016 09:06:31 +0000
reviewersme
bugs1274350
Bug 1274350 - Ensure that environment variables in task definitions are always strings r=me
automation/taskcluster/graph/build.js
automation/taskcluster/graph/builds/win2012x64-debug.yml
automation/taskcluster/graph/builds/win2012x64-opt.yml
--- a/automation/taskcluster/graph/build.js
+++ b/automation/taskcluster/graph/build.js
@@ -152,16 +152,24 @@ function generateTasks(definition) {
 
     // Append subtasks.
     tasks = tasks.concat(subtasks);
 
     // The dependents field is not part of the schema.
     delete task.dependents;
   }
 
+  // Convert env variables to strings.
+  tasks.forEach(function (task) {
+    var env = task.task.payload.env || {};
+    Object.keys(env).forEach(function (name) {
+      env[name] = env[name] + "";
+    });
+  });
+
   return tasks;
 }
 
 // Parse YAML task definitions.
 var BUILDS = parseDirectory(path.join(__dirname, "./builds/"));
 var TASKS = parseDirectory(path.join(__dirname, "./tasks/"));
 
 var graph = {
--- a/automation/taskcluster/graph/builds/win2012x64-debug.yml
+++ b/automation/taskcluster/graph/builds/win2012x64-debug.yml
@@ -11,20 +11,20 @@
         - type: directory
           path: "public\\build"
           expires: !from_now 24
       command:
         - "time /t && hg clone -r %NSS_HEAD_REVISION% %NSS_HEAD_REPOSITORY% nss"
         - "time /t && bash -c nss/automation/taskcluster/windows/build.sh"
       env:
         PATH: "c:\\mozilla-build\\python;c:\\mozilla-build\\msys\\local\\bin;c:\\mozilla-build\\7zip;c:\\mozilla-build\\info-zip;c:\\mozilla-build\\python\\Scripts;c:\\mozilla-build\\yasm;c:\\mozilla-build\\msys\\bin;c:\\Windows\\system32;c:\\mozilla-build\\upx391w;c:\\mozilla-build\\moztools-x64\\bin;c:\\mozilla-build\\wget"
-        NSS_ENABLE_TLS_1_3: "1"
+        NSS_ENABLE_TLS_1_3: 1
         DOMSUF: localdomain
         HOST: localhost
-        USE_64: "1"
+        USE_64: 1
       image: !!js/undefined
 
     extra:
       treeherder:
         build:
           platform: windows2012-64
         collection:
           debug: true
--- a/automation/taskcluster/graph/builds/win2012x64-opt.yml
+++ b/automation/taskcluster/graph/builds/win2012x64-opt.yml
@@ -11,21 +11,21 @@
         - type: directory
           path: "public\\build"
           expires: !from_now 24
       command:
         - "time /t && hg clone -r %NSS_HEAD_REVISION% %NSS_HEAD_REPOSITORY% nss"
         - "time /t && bash -c nss/automation/taskcluster/windows/build.sh"
       env:
         PATH: "c:\\mozilla-build\\python;c:\\mozilla-build\\msys\\local\\bin;c:\\mozilla-build\\7zip;c:\\mozilla-build\\info-zip;c:\\mozilla-build\\python\\Scripts;c:\\mozilla-build\\yasm;c:\\mozilla-build\\msys\\bin;c:\\Windows\\system32;c:\\mozilla-build\\upx391w;c:\\mozilla-build\\moztools-x64\\bin;c:\\mozilla-build\\wget"
-        NSS_ENABLE_TLS_1_3: "1"
+        NSS_ENABLE_TLS_1_3: 1
         DOMSUF: localdomain
         HOST: localhost
-        BUILD_OPT: "1"
-        USE_64: "1"
+        BUILD_OPT: 1
+        USE_64: 1
       image: !!js/undefined
 
     extra:
       treeherder:
         build:
           platform: windows2012-64
         collection:
           opt: true