Bug 1274655 - Set MOZ_SOURCE_REPO in mozharness to avoid variance from shared repos; r?jlund draft
authorGregory Szorc <gps@mozilla.com>
Fri, 20 May 2016 12:46:27 -0700
changeset 370503 9c2614362d16cdc2938e4a13663ce6b2a1d064d6
parent 370443 e559f3bacc6ff98dad508086ee9f95940bca72ae
child 521768 c4d1a40d59cb355ffbef2c08c00b161b153f5023
push id19082
push userbmo:gps@mozilla.com
push dateTue, 24 May 2016 21:50:55 +0000
reviewersjlund
bugs1274655, 1270317
milestone49.0a1
Bug 1274655 - Set MOZ_SOURCE_REPO in mozharness to avoid variance from shared repos; r?jlund Recent changes to mozharness in bug 1270317 started using pooled shared storage for Mercurial repos. This means the "default" path in Mercurial repos is variable depending on which repo was the first to be built on a machine. By default, the Firefox build system resolves the source repository from `hg paths default`. This is now incorrect default behavior in automation. We fix the regression by setting MOZ_SOURCE_REPO in the environment to path to the repository that mozharness is currently building. MozReview-Commit-ID: 34IPf7PJfuA
testing/mozharness/mozharness/mozilla/building/buildbase.py
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -844,16 +844,23 @@ or run without that action (ie: --no-{ac
         # as we don't always want every key below added to the same dict
         env = copy.deepcopy(
             super(BuildScript, self).query_env(**kwargs)
         )
 
         # first grab the buildid
         env['MOZ_BUILD_DATE'] = self.query_buildid()
 
+        # Set the source repository to what we're building from since
+        # the default is to query `hg paths` which isn't reliable with pooled
+        # storage
+        repo_path = self._query_repo()
+        assert repo_path
+        env['MOZ_SOURCE_REPO'] = repo_path
+
         if self.query_is_nightly() or self.query_is_nightly_promotion():
             if self.query_is_nightly():
                 # nightly promotion needs to set update_channel but not do all the 'IS_NIGHTLY'
                 # automation parts like uploading symbols for now
                 env["IS_NIGHTLY"] = "yes"
             # in branch_specifics.py we might set update_channel explicitly
             if c.get('update_channel'):
                 env["MOZ_UPDATE_CHANNEL"] = c['update_channel']