Re: Compilation on Debian SID

From: Olly Betts <olly(at)survex(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Compilation on Debian SID
Date: 2011-11-26 23:05:22
Message-ID: 20111126230522.GV24964@survex.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Sat, Nov 26, 2011 at 08:18:31PM +0000, Dave Page wrote:
> On Sat, Nov 26, 2011 at 12:38 AM, Olly Betts <olly(at)survex(dot)com> wrote:
> > The reason this code has stopped building is that wxwidgets2.8 in Debian
> > unstable was recently patched to stop defining the ATTRIBUTE_PRINTF* macros
> > (which are too generically named and cause clashes with other software)
> > and to instead define WX_ATTRIBUTE_PRINTF* (as wx2.9 already does).  This
> > patch can be seen here:
> >
> > http://patch-tracker.debian.org/patch/series/view/wxwidgets2.8/2.8.12.1-3/fix-
> > macro-namespace-pollution.patch
> >
> > The bug motivating this change is here:
> >
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521924
>
> Hmm, thanks for the info. I really thought the Debian guys had stopped
> unilaterally breaking wxWidgets like that (downstream patching used to
> cause other problems with Debian in years gone by). Reminds me of why
> I prefer Redhat.

It's hardly unilateral - wxWidgets 2.9 has made exactly the same change.
So if you view it as "breaking wxWidgets", then it's only backporting
breakage from the next wx release series...

> > My take on this is that the ATTRIBUTE_PRINTF* macros weren't intended to be
> > used outside of the wx headers - there aren't publicly documented anywhere,
> > and wx upstream has renamed them in 2.9 without mentioning the fact in
> > docs/changes.txt (which is intended to document all wx API changes).
> >
> > So I would say it's a bug in pgadmin that it makes use of these macros -
> > it should define them itself if it needs them (and to avoid clashes with
> > everyone else who carelessly defines them without thinking through the
> > implications, it ought to define something like PG_ATTRIBUTE_PRINTF*
> > instead of ATTRIBUTE_PRINTF*).
>
> There are a lot of things that aren't documented in wxWidgets. If we
> removed all of them from pgAdmin... well, we just couldn't.

OTOH, you shouldn't be too surprised if such features disappear from
underneath you.

> Unfortunately we can't just copy them because the licences aren't
> compatible.

This isn't original wx code - a number of projects define equivalent
macros (and often with the same names, which is where the problems lie
when they do it in API headers and you want to use two or more such
projects at once).

So just find one with a licence that's compatible:

http://www.google.com/codesearch#search/&q=ATTRIBUTE_PRINTF&type=cs

E.g. libxml is MIT/X:

http://www.google.com/codesearch#y1w3ejFL0VQ/include/libxml/xmlversion.h&q=ATTRIBUTE_PRINTF&type=cs&l=431

> Anyway, thanks again for the info - I guess we'll just check to see if
> WX_ATTRIBUTE_PRINTF* is defined, and if so use that instead of
> ATTRIBUTE_PRINTF*.

Practically that'll fix it (and will work for 2.9 too), but you might
get bitten again in the future.

Cheers,
Olly

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2011-11-28 09:56:37 Re: Compilation on Debian SID
Previous Message Dave Page 2011-11-26 20:18:31 Re: Compilation on Debian SID