Open Bug 1031235 Opened 10 years ago Updated 2 years ago

mach does too much mozconfig loading

Categories

(Firefox Build System :: General, defect)

defect

Tracking

(Not tracked)

People

(Reporter: glandium, Unassigned)

Details

Apply the following patch:

diff --git a/python/mozbuild/mozbuild/mozconfig.py b/python/mozbuild/mozbuild/mozconfig.py
--- a/python/mozbuild/mozbuild/mozconfig.py
+++ b/python/mozbuild/mozbuild/mozconfig.py
@@ -210,16 +210,19 @@ class MozconfigLoader(ProcessExecutionMi
         env = dict(os.environ)
 
         args = self._normalize_command([self._loader_script,
             self.topsrcdir.replace(os.sep, '/'), path], True)
 
         try:
             # We need to capture stderr because that's where the shell sends
             # errors if execution fails.
+            import sys, traceback
+            print >> sys.stderr, "mozconfig"
+            traceback.print_stack()
             output = subprocess.check_output(args, stderr=subprocess.STDOUT,
                 cwd=self.topsrcdir, env=env)
         except subprocess.CalledProcessError as e:
             lines = e.output.splitlines()
 
             # Output before actual execution shouldn't be relevant.
             try:
                 index = lines.index('------END_BEFORE_SOURCE')

Try a simple command, like mach clobber, and you'll see it run twice, and that's because of MachCommandBase.__init__: once in the dummy MozbuildObject.from_environment and once more with self.mozconfig.

Essentially, any command does that.

But the best of all is mach help, because it does that for every single mach command it knows that has conditions (like is_firefox).
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.