bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

'mach build' fails after building a universal build



Firefox Build System
4 years ago
5 months ago


(Reporter: mshal, Assigned: mshal)


Mac OS X

Firefox Tracking Flags

(firefox-esr31 affected, b2g-v2.0 fixed)



(1 attachment)



4 years ago
In bug 978211, we're trying to run 'mach build' in automation. However, in a universal OSX build (where we explicitly specify MOZ_OBJDIR), after all steps have completed we get:

Your build was successful!
Error running mach:


The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.

You should consider filing a bug for this issue.

If filing a bug, please include the full output of mach, including this error

The details of the failure are as follows:

Exception: config.status not available. Run configure.

  File "/Users/marf/mozilla-central-git/python/mozbuild/mozbuild/mach_commands.py", line 430, in build
    if self.substs['MOZ_BUILD_APP'] != 'mobile/android':
  File "/Users/marf/mozilla-central-git/python/mozbuild/mozbuild/base.py", line 286, in substs
    return self.config_environment.substs
  File "/Users/marf/mozilla-central-git/python/mozbuild/mozbuild/base.py", line 273, in config_environment
    raise Exception('config.status not available. Run configure.')

I tried to fix this by considering MOZ_BUILD_PROJECTS when looking for config.status:

diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py
index 53b39c2..a06357b 100644
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -267,7 +267,18 @@ class MozbuildObject(ProcessExecutionMixin):
         if self._config_environment:
             return self._config_environment
-        config_status = os.path.join(self.topobjdir, 'config.status')
+        make_extra = self.mozconfig['make_extra'] or []
+        make_extra = dict(m.split('=', 1) for m in make_extra)
+        # For universal builds, grab config.status from the first arch
+        projects = make_extra.get('MOZ_BUILD_PROJECTS')
+        if projects:
+            subdir = os.path.join(self.topobjdir, projects.split(' ')[0])
+        else:
+            subdir = ''
+        config_status = os.path.join(self.topobjdir, subdir, 'config.status')
         if not os.path.exists(config_status):
             raise Exception('config.status not available. Run configure.')

But unfortunately that makes 'make check' fail in some tests, so I'm guessing it's not the right place to add this in. This is similar to the issue seen in bug 832112 / bug 762358. Any suggestions?

Comment 1

4 years ago
gps, glandium - can either of you help out here?
Flags: needinfo?(mh+mozilla)
Flags: needinfo?(gps)

Comment 2

4 years ago
I suspect this code path is broken for universal OS X builds, automation or not. I don't think I've ever tried universal OS X builds myself and can't remember much about how they work. But I /thought/ there were 2 objdirs involved, possibly in sibling directories. I bet base.py just needs to be educated about universal OS X builds.

I didn't cross-reference the source, but this is in the "print the binary path" code, right? If my hypothesis about the failure is correct, I would just not print a binary for universal builds. Or print both if you aren't feeling lazy :)
Flags: needinfo?(gps)
Universal builds use MOZ_BUILD_PROJECTS in client.mk, which creates a sub-objdir for each entry in that list, so you wind up with $MOZ_OBJDIR/{i386,x86_64}, each containing a full objdir for that cpu arch. The root "objdir" at MOZ_OBJDIR is otherwise empty.

Unfortunately this abstraction bleeds through quite a bit, hence all the hardcoded buildbot knowledge to run a bunch of make steps in one of the subdirs.

Comment 4

4 years ago
Created attachment 8454477 [details] [diff] [review]

Rather than hard-code a workaround only for Universal builds, can we just skip the message generating if we get an exception?
Assignee: nobody → mshal
Attachment #8454477 - Flags: review?(gps)


4 years ago
Flags: needinfo?(mh+mozilla)

Comment 5

4 years ago
Comment on attachment 8454477 [details] [diff] [review]

Review of attachment 8454477 [details] [diff] [review]:

::: python/mozbuild/mozbuild/mach_commands.py
@@ +438,5 @@
> +                app = self.substs['MOZ_BUILD_APP']
> +                if app in ('browser', 'mobile/android'):
> +                    print('For more information on what to do now, see '
> +                        'https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox')
> +            except Exception:

except Exception is a bit heavy handed. But this is just UX code, so meh.
Attachment #8454477 - Flags: review?(gps) → review+

Comment 7

4 years ago
Looks like this has already been merged to m-c: http://hg.mozilla.org/mozilla-central/rev/82875b65c9a7
Last Resolved: 4 years ago
Resolution: --- → FIXED


4 years ago
status-b2g-v2.0: --- → fixed
status-firefox-esr31: --- → fixed
Duplicate of this bug: 1102505
status-firefox-esr31: fixed → affected

Comment 9

4 years ago
Aha, it looks like I'm using ESR31.2.0 which is too old for this fix.


5 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.