[gentoo-dev] Depending on clang as a compiler

2014-02-26 Thread Georg Rudoy
Hi!

First of all, I'm not a Gentoo dev but a proud Gentoo user and also a
developer of a piece of software that's present in portage tree under
app-lc/ category, and Gentoo is kind of tier-1 distro for me.

I'm currently considering using C++14 in my project, particularly
features that aren't supported by gcc 4.8 and are barely supported by
4.9 [1], but the standard is already fully supported by clang 3.4 [2].
Thus I wonder how bad is actually depending on recent clang in
ebuilds?

I ask because depending on the outcome of the discussion I'll either
start playing around with C++14 in, say, only new modules that aren't
present in the tree yet (most likely I guess) but are good candidates
for inclusion, or postpone that until gcc like 4.10 is released (less
likely but most safe I guess), or happily start using all new nifty
C++14 features in the existing codebase as well (extremely unlikely
:)).

[1] http://gcc.gnu.org/projects/cxx1y.html
[2] http://clang.llvm.org/cxx_status.html under C++1y section

-- 
  Georg Rudoy



Re: [gentoo-dev] Depending on clang as a compiler

2014-02-26 Thread Dirkjan Ochtman
On Wed, Feb 26, 2014 at 9:26 AM, Georg Rudoy 0xd34df...@gmail.com wrote:
 I'm currently considering using C++14 in my project, particularly
 features that aren't supported by gcc 4.8 and are barely supported by
 4.9 [1], but the standard is already fully supported by clang 3.4 [2].
 Thus I wonder how bad is actually depending on recent clang in
 ebuilds?

If you want to do that, it's not a problem with me. That said, I
probably wouldn't install packages that wanted to pull in a whole
different toolchain unless I wanted them really badly (but on machines
where I already have clang installed, I might not even notice).

I'd say there's value in staying close to where the community's at, if
you actually want your software to be used. If you don't care that
much about your software being used by other people, nobody can stop
you.

Cheers,

Dirkjan



Re: [gentoo-dev] Depending on clang as a compiler

2014-02-26 Thread Michał Górny
Dnia 2014-02-26, o godz. 12:26:06
Georg Rudoy 0xd34df...@gmail.com napisał(a):

 I'm currently considering using C++14 in my project, particularly
 features that aren't supported by gcc 4.8 and are barely supported by
 4.9 [1], but the standard is already fully supported by clang 3.4 [2].
 Thus I wonder how bad is actually depending on recent clang in
 ebuilds?

Well, you should note that DEPENDing on sys-devel/clang is currently
implemented as USE=clang in sys-devel/llvm (please don't depend on that
directly, we will split it back ASAP). So if someone doesn't have clang
enabled, he'd hit portage telling him to enable the flag.

Good news is that you won't take people by surprise, i.e. they will
notice that you're forcing them to use clang. Bad news is that it won't
be as transparent as you wished it was.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] Depending on clang as a compiler

2014-02-26 Thread Georg Rudoy
2014-02-26 12:35 GMT+04:00 Dirkjan Ochtman d...@gentoo.org:
 On Wed, Feb 26, 2014 at 9:26 AM, Georg Rudoy 0xd34df...@gmail.com wrote:
 I'm currently considering using C++14 in my project, particularly
 features that aren't supported by gcc 4.8 and are barely supported by
 4.9 [1], but the standard is already fully supported by clang 3.4 [2].
 Thus I wonder how bad is actually depending on recent clang in
 ebuilds?

 If you want to do that, it's not a problem with me. That said, I
 probably wouldn't install packages that wanted to pull in a whole
 different toolchain unless I wanted them really badly (but on machines
 where I already have clang installed, I might not even notice).

 I'd say there's value in staying close to where the community's at, if
 you actually want your software to be used. If you don't care that
 much about your software being used by other people, nobody can stop
 you.

I thought about some policy-related problems. Good if there aren't any.

Thanks for the opinion. Depending strictly on clang is more like a
temporary measure until gcc catches up, which I hope will happen fast
enough. In this case I'll also probably stick with just introducing
the dependency in newer, probably even unpackaged modules so everyone
will be able to use what's already considered to be somewhat stable
and solid part of the app with standard gcc.

-- 
  Georg Rudoy



Re: [gentoo-dev] Depending on clang as a compiler

2014-02-26 Thread Georg Rudoy
2014-02-26 12:52 GMT+04:00 Michał Górny mgo...@gentoo.org:
 Dnia 2014-02-26, o godz. 12:26:06
 Georg Rudoy 0xd34df...@gmail.com napisał(a):

 I'm currently considering using C++14 in my project, particularly
 features that aren't supported by gcc 4.8 and are barely supported by
 4.9 [1], but the standard is already fully supported by clang 3.4 [2].
 Thus I wonder how bad is actually depending on recent clang in
 ebuilds?

 Well, you should note that DEPENDing on sys-devel/clang is currently
 implemented as USE=clang in sys-devel/llvm (please don't depend on that
 directly, we will split it back ASAP). So if someone doesn't have clang
 enabled, he'd hit portage telling him to enable the flag.

And what about setting CMAKE_CXX_COMPILER in src_configure() (or where
it should be overriden)? I don't think it's a good idea to forcefully
set the compiler binary in CMakeLists.txt itself, is it better done in
ebuild?

-- 
  Georg Rudoy



Re: [gentoo-dev] Depending on clang as a compiler

2014-02-26 Thread Michał Górny
Dnia 2014-02-26, o godz. 12:56:30
Georg Rudoy 0xd34df...@gmail.com napisał(a):

 2014-02-26 12:52 GMT+04:00 Michał Górny mgo...@gentoo.org:
  Dnia 2014-02-26, o godz. 12:26:06
  Georg Rudoy 0xd34df...@gmail.com napisał(a):
 
  I'm currently considering using C++14 in my project, particularly
  features that aren't supported by gcc 4.8 and are barely supported by
  4.9 [1], but the standard is already fully supported by clang 3.4 [2].
  Thus I wonder how bad is actually depending on recent clang in
  ebuilds?
 
  Well, you should note that DEPENDing on sys-devel/clang is currently
  implemented as USE=clang in sys-devel/llvm (please don't depend on that
  directly, we will split it back ASAP). So if someone doesn't have clang
  enabled, he'd hit portage telling him to enable the flag.
 
 And what about setting CMAKE_CXX_COMPILER in src_configure() (or where
 it should be overriden)? I don't think it's a good idea to forcefully
 set the compiler binary in CMakeLists.txt itself, is it better done in
 ebuild?

I don't know CMake well but I think it's enough to set CXX before
calling cmake-utils_src_configure(). You gotta know the details better.
And yes, it's better done in ebuild, it will also make it easier to
support new enough gcc.

You may add some checks for necessary features in CMake though,
and fail explicitly when the compiler doesn't provide them.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature