Bug 1416029: Pass empty TRY_COMMIT_MESSAGE to mozharness on windows. r=dustin
authorTom Prince <mozilla@hocat.ca>
Tue, 24 Oct 2017 15:12:36 -0600
changeset 444621 7b9a2e0170692932331d69b4dbda2ae68c894e48
parent 444620 299bec984c403475a372597857ca5b0020536cd8
child 444622 e4af3344015d2955b85a535d79bdc7aa74e87c79
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1416029
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1416029: Pass empty TRY_COMMIT_MESSAGE to mozharness on windows. r=dustin Apparently the window's generic-worker uses batch files for running setting environment variables. In windows batch files, setting an environment variable to empty actually unsets. So, in order to avoid mozharness trying to determine the commit message itself, pass an empty TRY_COMMIT_MESSAGE as a space instead. MozReview-Commit-ID: 2nJfJE0EaF0
taskcluster/taskgraph/transforms/job/mozharness.py
--- a/taskcluster/taskgraph/transforms/job/mozharness.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness.py
@@ -216,18 +216,22 @@ def mozharness_on_generic_worker(config,
     env.update({
         'MOZ_BUILD_DATE': config.params['moz_build_date'],
         'MOZ_SCM_LEVEL': config.params['level'],
         'MOZ_AUTOMATION': '1',
     })
     if run['use-simple-package']:
         env.update({'MOZ_SIMPLE_PACKAGE_NAME': 'target'})
 
+    # The windows generic worker uses batch files to pass environment variables
+    # to commands.  Setting a variable to empty in a batch file unsets, so if
+    # there is no `TRY_COMMIT_MESSAGE`, pass a space instead, so that
+    # mozharness doesn't try to find the commit message on its own.
     if 'try' in config.params['project']:
-        env['TRY_COMMIT_MSG'] = config.params['message']
+        env['TRY_COMMIT_MSG'] = config.params['message'] or 'no commit message'
 
     if not job['attributes']['build_platform'].startswith('win'):
         raise Exception(
             "Task generation for mozharness build jobs currently only supported on Windows"
         )
 
     mh_command = [r'c:\mozilla-build\python\python.exe']
     mh_command.append('\\'.join([r'.\build\src\testing', run['script'].replace('/', '\\')]))