Bug 71022 - configure: error: Expat required for DRI.
Summary: configure: error: Expat required for DRI.
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-10-29 22:58 UTC by Vinson Lee
Modified: 2013-10-30 22:08 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Hardcode EXPAT in configure.ac (586 bytes, patch)
2013-10-30 00:05 UTC, Bryce Harrington
Details | Splinter Review
handle expat versions pre 2.1 (1.75 KB, patch)
2013-10-30 00:17 UTC, Emil Velikov
Details | Splinter Review

Description Vinson Lee 2013-10-29 22:58:23 UTC
mesa: 7e414b58640aee6e243d337e72cea290c354f632 (master)

Seeing a build error even with expat installed.

checking for EXPAT... no
configure: error: Expat required for DRI.

$ rpm -qa | grep expat
expat-2.0.1-11.el6_2.x86_64
expat-devel-2.0.1-11.el6_2.x86_64
Comment 1 Bryce Harrington 2013-10-29 23:07:11 UTC
Same error on ubuntu 12.04

$ apt-cache policy expat
expat:
  Installed: 2.0.1-7.2ubuntu1.1
  Candidate: 2.0.1-7.2ubuntu1.1

Looks like expat.pc was added in expat 2.1.  2.0 doesn't install it, so mesa's pkg-config check fails.

$ pkg-config --cflags --libs expat
Package expat was not found in the pkg-config search path.
Perhaps you should add the directory containing `expat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'expat' found
Comment 2 Bryce Harrington 2013-10-29 23:10:09 UTC
Reverting patch aec20d66 enables it to pass the configure check.

commit aec20d66d9d13e0acd6a7199b63e1383e1e9900a
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Tue Oct 29 21:14:41 2013 +0000

    automake: properly handle non-default expat installation
Comment 3 Matt Turner 2013-10-29 23:37:30 UTC
expat-2.1.0 was released March 24 2012. That's kind of a long time for it to not be in your distribution.

I'm personally okay with requiring 2.1.0, but I suppose people want new Mesa on old things.

I might suggest checking whether the pkgconfig file exists, and if it does do the regular PKG_CHECK_MODULES check, otherwise just set EXPAT_LIBS=-lexpat. Might work for everyone affected.
Comment 4 Emil Velikov 2013-10-29 23:52:08 UTC
(In reply to comment #3)
> expat-2.1.0 was released March 24 2012. That's kind of a long time for it to
> not be in your distribution.
> 
> I'm personally okay with requiring 2.1.0, but I suppose people want new Mesa
> on old things.
> 
> I might suggest checking whether the pkgconfig file exists, and if it does
> do the regular PKG_CHECK_MODULES check, otherwise just set
> EXPAT_LIBS=-lexpat. Might work for everyone affected.

Expat 2.0.1 Released 2007-06-06

I honestly hope that distros will update this piece of software, considering CVE-2012-1147 and CVE-2012-1148 (both affecting version 2.0 and earlier). Might be worth pinging the package maintainers.

But in the meantime, Matt's suggestion sounds great.
Comment 5 Bryce Harrington 2013-10-30 00:05:10 UTC
Created attachment 88328 [details] [review]
Hardcode EXPAT in configure.ac

expat 2.0 does not provide the pkgconfig file.

Hardcoding EXPAT as suggested, does fix the build locally for me.

Ubuntu 12.04 is an LTS and follows a conservative policy for updating libs, thus I would not expect them to want to update to 2.1, but they do sometimes backport specific stable fixes.  They've done so for CVE-2012-1148, but not afaict
CVE-2012-1147.
Comment 6 Bryce Harrington 2013-10-30 00:07:29 UTC
CVE-2012-1147 was determined not to be relevant on Ubuntu:

http://people.canonical.com/~ubuntu-security/cve/2012/CVE-2012-1147.html
Comment 7 Emil Velikov 2013-10-30 00:17:29 UTC
Created attachment 88329 [details] [review]
handle expat versions pre 2.1

(In reply to comment #6)
> CVE-2012-1147 was determined not to be relevant on Ubuntu:
> 
> http://people.canonical.com/~ubuntu-security/cve/2012/CVE-2012-1147.html

Fair enough, I would personally do with using the new version but that's just me.

The attached patch should work like a charm (tested and working fine here).
Comment 8 Bryce Harrington 2013-10-30 01:11:57 UTC
Yep, that does the trick.

Tested-by: Bryce Harrington <b.harrington@samsung.com>
Comment 9 Rob Clark 2013-10-30 21:49:08 UTC
fwiw, this would be nice to push.. it would at least fix my tinderbox:
http://tinderbox.x.org/builds/2013-10-30-0017/logs/libGL/#configure
Comment 10 Emil Velikov 2013-10-30 22:08:22 UTC
Pushed to master, sorry for the breakage guys.

commit 9eb3de1ce7acb59a8b38ddcef20366620ff02b60
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Wed Oct 30 00:03:43 2013 +0000

    automake: handle expat version pre 2.1


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.