[Mesa-dev] [RFC][PATCH 5/5] Android.mk: Fix checkbuild on Mac builders.

Alistair Strachan astrachan at google.com
Wed Jul 25 19:33:50 UTC 2018

On Wed, Jul 25, 2018 at 5:48 AM Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 25 July 2018 at 00:21, John Stultz <john.stultz at linaro.org> wrote:
> > From: Alistair Strachan <astrachan at google.com>
> >
> > This is a forward port of a patch in the AOSP/master tree:
> > https://android.googlesource.com/platform/external/mesa3d/+/d7f894a7d39e66ca5a832c19edaf175400041aff%5E%21/
> >
> > The libmesa_dri_common target depends on xgettext unconditionally, but
> > this is not a documented dependency of AOSP and is not installed on the
> > Mac builders, so we must not build any part of mesa3d on these
> > platforms.
> >
> > Cc: Rob Herring <rob.herring at linaro.org>
> > Cc: Alistair Strachan <astrachan at google.com>
> > Cc: Marissa Wall <marissaw at google.com>
> > Cc: Sumit Semwal <sumit.semwal at linaro.org>
> > Cc: Emil Velikov <emil.l.velikov at gmail.com>
> > Cc: Rob Clark <robdclark at gmail.com>
> > Signed-off-by: Alistair Strachan <astrachan at google.com>
> > Signed-off-by: John Stultz <john.stultz at linaro.org>
> > ---
> >  Android.mk | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/Android.mk b/Android.mk
> > index 494b4b9..128db4d 100644
> > --- a/Android.mk
> > +++ b/Android.mk
> > @@ -30,6 +30,8 @@
> >  # module will also be built.  DRI modules will be loaded by libGLES_mesa.
> >
> >  ifneq ($(BOARD_USE_CUSTOMIZED_MESA), true)
> > +ifneq ($(BOARD_GPU_DRIVERS),)
> > +
> Something looks fairly weird here. Commit message talks about Mac and
> xgettext while this here checks for BOARD_GPU_DRIVERS.

This change is actually papering over another bug in the makefiles: if
BOARD_GPU_DRIVERS is the empty string, bits of mesa (I think the Intel
drivers IIRC) will still be built due to some makefile logic that I
didn't track down yet. This can be reproduced with "mmma
external/mesa3d" for a device that does not specify

As part of 'checkbuild', all reachable modules will be built for a
given lunch target, this means all modules *must build* or the modules
should not be emitted in the first place. If that bug was tracked down
and fixed, we wouldn't need to mask the parsing of the mesa
makefile/directory because BOARD_GPU_DRIVERS being the empty string
would be enough to suppress these driver module definitions.

> IIRC, libGLES_mesa must be explicitly pulled in the device
> manifest/project in order to for Mesa be built. The exact same one
> tends to set BOARD_GPU_DRIVERS.

external/mesa3d is part of the upstream manifest. We are therefore
holding this project to the highest standard: all modules must build
on all targets, or be appropriately suppressed. All modules reachable
with "mmm" must build for every target.

> Or looking it from another angle - if the Mac builder is missing
> xgettext one could add it, becoming in sync with other builders.
> Quick search shows that it's available in brew (brew install gettext)
> and one can build it locally.

AFAICT this won't happen. The dependencies for AOSP are documented on
https://source.android.com/setup/build/initializing, and this list
does not include xgettext. It's just that Linux distros tend to
include xgettext in even the most minimal installation. On Mac, such a
list (other than the one documented by that page) does not exist. To
me, this seems like a porting issue that should be resolved
appropriately for AOSP.

(IOW: ideally the dependencies on xgettext and python-maco should be
removed so that these tools are not required to build Mesa for
Android. The python-maco dependency has been worked around on the AOSP
fork of mesa by directing the makefiles to a set of pregenerated files
but this change, along with the hack discussed here, is not a
good/sustainable solution.)

> -Emil

More information about the mesa-dev mailing list