Bug 1769405 - Part 2: Rename mozconfig_and_target to base_mozconfig_info and return dictionary. r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D147272
This commit is contained in:
Tooru Fujisawa
2022-06-10 19:16:59 +00:00
parent 90d8a3142c
commit d63cf11cf0

View File

@@ -281,7 +281,7 @@ class MozbuildObject(ProcessExecutionMixin):
@staticmethod
@memoize
def get_mozconfig_and_target(topsrcdir, path, env_mozconfig):
def get_base_mozconfig_info(topsrcdir, path, env_mozconfig):
# env_mozconfig is only useful for unittests, which change the value of
# the environment variable, which has an impact on autodetection (when
# path is MozconfigLoader.AUTODETECT), and memoization wouldn't account
@@ -329,17 +329,17 @@ class MozbuildObject(ProcessExecutionMixin):
sandbox.include_file(os.path.join(base_dir, "init.configure"))
# Force mozconfig options injection before getting the target.
sandbox._value_for(sandbox["mozconfig_options"])
return (
sandbox._value_for(sandbox["mozconfig"]),
sandbox._value_for(sandbox["real_target"]),
)
return {
"mozconfig": sandbox._value_for(sandbox["mozconfig"]),
"target": sandbox._value_for(sandbox["real_target"]),
}
except SystemExit:
print(out.getvalue())
raise
@property
def mozconfig_and_target(self):
return self.get_mozconfig_and_target(
def base_mozconfig_info(self):
return self.get_base_mozconfig_info(
self.topsrcdir, self._mozconfig, os.environ.get("MOZCONFIG")
)
@@ -349,7 +349,7 @@ class MozbuildObject(ProcessExecutionMixin):
This a dict as returned by MozconfigLoader.read_mozconfig()
"""
return self.mozconfig_and_target[0]
return self.base_mozconfig_info["mozconfig"]
@property
def config_environment(self):
@@ -569,7 +569,7 @@ class MozbuildObject(ProcessExecutionMixin):
return path
def resolve_config_guess(self):
return self.mozconfig_and_target[1].alias
return self.base_mozconfig_info["target"].alias
def notify(self, msg):
"""Show a desktop notification with the supplied message