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
--- 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']