Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: "Gregory M. Turner" <gmt@×××××××.net>
Cc: gentoo-dev@l.g.o, "Anthony G. Basile" <blueness@g.o>
Subject: Re: [gentoo-dev] impending c++11 clusterfuck?
Date: Wed, 02 Dec 2015 07:07:04
Message-Id: 20151202080637.14bfea23.mgorny@gentoo.org
In Reply to: Re: [gentoo-dev] impending c++11 clusterfuck? by "Gregory M. Turner"
1 On Tue, 01 Dec 2015 18:12:17 -0800
2 "Gregory M. Turner" <gmt@×××××××.net> wrote:
3
4 > On Tue, 2015-12-01 at 07:18 -0500, Anthony G. Basile wrote:
5 > > So on that bug we're talking about selectively
6 > > adding -std=c++11 (or possibly gnu++11) to packages.
7 >
8 > Yes, this is the biggest real-world problem we face.  It requires an
9 > immediate solution in the ~* branches; the affected ebuilds just dump a
10 > bunch of gcc gobbldeygook and crash.
11 >
12 > If I understand the generalized problem we are facing there, as a
13 > package gets "c++11-ized", all of its reverse-BDEPs find themselves in
14 > the following situation:
15 >
16 > Imagine cat/foo is a library.  cat/foo-3.0 is the newest non-c++11-ized
17 > version (in its slot, perhaps).  Now cat/foo-3.1 comes along and from
18 > then on, anything BDEPENDing on it must be built with -std=c++11 (I'm
19 > ignoring the c++11 vs. gnu++11 but presumably we'll eventually need to
20 > figure out some kind of game plan about that).
21
22 Just to be clear, this only happened because upstream started to use
23 C++11 features in API. Normally libraries don't go that far, or use
24 #ifs to support C++03.
25
26 > So, now, "everything" pulling in headers from  cat/foo finds itself in
27 > this situation:
28 >
29 >  o if it pulls in headers from <cat/foo-3.1, all is as before
30 >  o if it pulls in headers from >=cat/foo-3.1, we must add a CFLAG
31 >
32 > I guess the reasonable way to achieve that sort of behavior is
33 > pkgconfig (which is not really a rock-solid solution.  First, some
34 > packages might fail to put it in there (but, OK we just add it
35 > ourselves, let's say).  Second, how many of cat/foo's reverse BDEPs
36 > side-step pkgconfig?  Sometimes this is pretty common, I'm afraid.  
37
38 pkg-config is not a solution. -std= flags don't belong there.
39 Furthermore, if you put -std= flags there, it is likely to override
40 ${CXXFLAGS} and in particular make it really painful to force other
41 standard on ebuild's end.
42
43 > So, let's say lots of packages depending on cat/foo have this pkgconfig
44 > side-stepping problem, we could theoretically write some eclass to
45 > inject it when appropriate, and expect those side-stepping ebuilds to
46 > consume it, no?  That seems pretty easy and hopefully wouldn't require
47 > any of the scary ideas that have been discussed in this thread.
48
49 So you're saying we should write a whole eclass to do:
50
51 append-cppflags -std=c++11
52
53 ?
54
55 --
56 Best regards,
57 Michał Górny
58 <http://dev.gentoo.org/~mgorny/>

Replies

Subject Author
Re: [gentoo-dev] impending c++11 clusterfuck? "Anthony G. Basile" <blueness@g.o>
Re: [gentoo-dev] impending c++11 clusterfuck? "Gregory M. Turner" <gmt@×××××××.net>