Subject: RFC: Move to C++14

From: Alexandros Frantzis <[email-masked]>
Date: Tue, 17 Feb 2015 14:37:31 +0200

Hi all,

I think it's to time to consider moving from C++11 to C++14 (at least
the C++14 features our compilers support). C++14 offers some useful
improvements over C++11, like:

* std::make_unique()
* standard literal suffixes for std::chrono (e.g. auto delay = 10ms;)
* std::shared_timed_mutex (aka RW mutex)
* generic lambdas
* lambda capture initializers (which, importantly, allow moving values into
  lambdas)

Moving to C++14 means that we will not be able to build Mir on a
pristine Ubuntu LTS 14.04 system. Note that, even now, Mir cannot be
fully built on the LTS because of changes in the Android interfaces. As
things currently stand, I believe that dropping support for 14.04 builds
in order to allow C++14 is a worthy trade-off.

In addition, not supporting 14.04 builds means that we will be able to
use all the new features of other libraries we depend on, e.g.
gmock/gtest.

It's also worth noting that our packages depend on g++-4.9 (which
supports the C++14 features we want).

I have published an MP introducing C++14 into our codebase:

https://code.launchpad.net/~afrantzis/mir/introduce-c++14/+merge/249988

Let me know what you think.

Thanks,
Alexandros

---

From: Alan Griffiths <[email-masked]>
Date: Tue, 17 Feb 2015 13:08:13 +0000

> Let me know what you think.

There are probably four important constituencies that need to build Mir
and they may well be targeting different platforms.

1. Mir developers - they are clearly targeting vivid
2. Client-side "toolkit" developers - these could be targeting the LTS
(trusty) or the stable release (utopic) as well as vivid
3. Server-side "Shell" developers - the ones we are aware of are
targeting vivid
4. Graphics "platform" developers - there are none, but they would
likely target the LTS (trusty)

So, there are reasons to support development on trusty.

Having said that, as the OP mentions C++14 support is only one of the
issues:

We've currently got an MP that reworks a test so that it builds with the
version of gmock available on trusty. If we assume that only /1/ above
needs to build the tests then we wouldn't need that.

IIUC it is also possible to install g++-4.9 on the LTS

So I don't see using C++14 disenfranchising anyone that doesn't already
have issues.

---

From: Oliver Ries <[email-masked]>
Date: Tue, 17 Feb 2015 07:33:17 -0700

> likely target the LTS (trusty)

yeah, please keep the L(ong) in LTS in mind :)

thx,
O.

---

From: Alan Griffiths <[email-masked]>
Date: Tue, 17 Feb 2015 14:42:48 +0000

> yeah, please keep the L(ong) in LTS in mind :)

This isn't about supporting a mir branch for LTS but the ability to
build the "cutting edge" development version on LTS.

---

From: Cemil Azizoglu <[email-masked]>
Date: Tue, 17 Feb 2015 11:11:37 -0600

> likely target the LTS (trusty)

I doubt such developers would do it in a vacuum. They probably would (need
to) work very closely to us - or even we would be doing it ourselves.

> --
> Mir-devel mailing list
> [email-masked]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/mir-devel
>

-- 
Cemil Azizoglu
Mir Display Server - Team Lead
Canonical USA

---

From: Christopher James Halse Rogers <[email-masked]>
Date: Wed, 18 Feb 2015 11:58:05 +1100

> IIUC it is also possible to install g++-4.9 on the LTS

Correct - the gcc-4.9 builds in 
https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test?field.series_filter=trusty

This PPA is maintained by the Ubuntu toolchain folks, and is entirely 
parallel-installable with the existing 14.04 buildchain.

As we have no requirement to stick the latest Mir code in the 14.04 
archive I think requiring a safe PPA is not too onerous.

> So I don't see using C++14 disenfranchising anyone that doesn't 

Given the easy availability of a C++14 compiler on 14.04, I'm very much 
in favour of enabling C++14 features.

---

From: Daniel van Vugt <[email-masked]>
Date: Wed, 18 Feb 2015 09:39:18 +0800

I think this is a bad idea.

Supporting trusty with the latest Mir is presently easy, as demonstrated:
https://code.launchpad.net/~vanvugt/mir/revive-trusty/+merge/249789

Using newer language specs I think is contrary to engineering maturity. 
Because it means we knowingly and needlessly reduce the number of 
distros Mir can support. And we also make the learning curve for people 
even steeper (fewer C++ developers know the new language features).

Overall this will lead to reduced adoption by users and reduced 
participation by developers. We need to be careful and draw the line 
somewhere... stop upgrading to the latest C++ every time one comes along.

- Daniel

---

From: Daniel van Vugt <[email-masked]>
Date: Wed, 18 Feb 2015 10:18:37 +0800

Also worth noting, it takes less effort to support trusty:
   https://code.launchpad.net/~vanvugt/mir/revive-trusty/+merge/249789
than it does to start using C++14 features:
   https://code.launchpad.net/~afrantzis/mir/introduce-c++14/+merge/249988

---

From: Christopher James Halse Rogers <[email-masked]>
Date: Wed, 18 Feb 2015 14:06:29 +1100

> https://code.launchpad.net/~afrantzis/mir/introduce-c++14/+merge/249988

That's obviously somewhat unfair. The effort required to *support* 
C++14 features is a 3-line, +1/-1 diff.

>> somewhere... stop upgrading to the latest C++ every time one comes 

Philosophical differences :).

I'm not convinced that this will result in reduced participation by 
developers; a fair contingent of developers will be *more* interested 
in a project using the most modern tools available.

I think we should be aggressively upgrading to better tools whenever 
it's easy. Obviously I'd quite like to do a bunch of Mir in Rust, but 
that's not easy. C++14 is a better tool that's extremely easy to use in 
Mir.

---

From: Daniel van Vugt <[email-masked]>
Date: Wed, 18 Feb 2015 12:43:21 +0800

As a compromise why don't we say Mir supports the latest LTS only?

So 14 months from now, we'll be free to jump to C++14 (and it will be 
more mature in implementation by then). But until then, we would stick 
to C++11 for trusty.

---

From: Daniel van Vugt <[email-masked]>
Date: Thu, 19 Feb 2015 10:12:16 +0800

We do seem to be guilty of having the same conversations in multiple 
different places a lot :)

Just FYI, the nail is in the coffin. C++14 support landed last night. So 
trusty is dropped I guess.

---

From: Cemil Azizoglu <[email-masked]>
Date: Thu, 19 Feb 2015 08:59:21 -0600

Trusty is not dropped. At least, not because we have moved to C++14. If
supporting Trusty were as simple as having compiler support, we already
have that with the PPA for 4.9 Chris pointed out. Though, other reasons
making that support difficult remain. But those are not related to the
choice of compiler.

Thanks,
Cemil

On Wed, Feb 18, 2015 at 8:12 PM, Daniel van Vugt <
[email-masked]> wrote:

> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/mir-devel
>

---

From: Kevin Gunn <[email-masked]>
Date: Thu, 19 Feb 2015 09:03:04 -0600

right, aren't android base & gmocks are also out of sync ?
br,kg

---

From: Cemil Azizoglu <[email-masked]>
Date: Thu, 19 Feb 2015 09:12:48 -0600

Correct.

---

From: Daniel van Vugt <[email-masked]>
Date: Fri, 20 Feb 2015 09:03:01 +0800

IMHO needing PPAs is less preferable to just working out-of-the box. I 
was aiming for and achieved the latter. Also PPAs don't help non-deb 
distros, which we should be mindful of (and have achieved in desrt's 
work on Fedora).

But I'm over it. We all have plenty of other things to worry about.

In future when we have products based on an Ubuntu LTS series, then it 
will be more of an issue. But for now we're safe -- even our RTMs are 
based on fairly recent releases. It's not a major problem yet.

On 19/02/15 22:59, Cemil Azizoglu wrote:
> On Wed, Feb 18, 2015 at 8:12 PM, Daniel van Vugt
> <[email-masked] <mailto:[email-masked]>>
> wrote:
>
>     Just FYI, the nail is in the coffin. C++14 support landed last
>     night. So trusty is dropped I guess.
>
>
>
>             https://code.launchpad.net/~__vanvugt/mir/revive-trusty/+__merge/249789
>             <https://code.launchpad.net/~vanvugt/mir/revive-trusty/+merge/249789>
>
>                 * lambda capture initializers (which, importantly, allow
>                 moving values
>                 into
>                     lambdas)
>
>                 https://code.launchpad.net/~__afrantzis/mir/introduce-c++14/__+merge/249988
>                 <https://code.launchpad.net/~afrantzis/mir/introduce-c++14/+merge/249988>
>
>     [email-masked] <mailto:[email-masked]>
>     https://lists.ubuntu.com/__mailman/listinfo/mir-devel
>     <https://lists.ubuntu.com/mailman/listinfo/mir-devel>
>
>
>
>
> --
> Cemil Azizoglu

---

From: Gauravdeep Singh <[email-masked]>
Date: Sun, 22 Feb 2015 16:56:12 +0530

Hi,

 Can anyone please help me out to figure out an entry point to get involved in the development process...!!
Any help is highly appreciable.

Thanks,
Regards,
Gauravdeep Singh

Date: Thu, 19 Feb 2015 09:12:48 -0600
Subject: Re: RFC: Move to C++14
From: [email-masked]
To: [email-masked]
CC: [email-masked]

Correct.
On Thu, Feb 19, 2015 at 9:03 AM, Kevin Gunn <[email-masked]> wrote:
right, aren't android base & gmocks are also out of sync ?br,kg 
On Thu, Feb 19, 2015 at 8:59 AM, Cemil Azizoglu <[email-masked]> wrote:
Trusty is not dropped. At least, not because we have moved to C++14. If supporting Trusty were as simple as having compiler support, we already have that with the PPA for 4.9 Chris pointed out. Though, other reasons making that support difficult remain. But those are not related to the choice of compiler.
Thanks,Cemil

On Wed, Feb 18, 2015 at 8:12 PM, Daniel van Vugt <[email-masked]> wrote:
We do seem to be guilty of having the same conversations in multiple different places a lot :)

Just FYI, the nail is in the coffin. C++14 support landed last night. So trusty is dropped I guess.

to C++11 for trusty.

- Daniel

Hi all,

* std::make_unique()

* generic lambdas

* lambda capture initializers (which, importantly, allow moving values

into

   lambdas)

gmock/gtest.

Thanks,

Alexandros

-- 

Mir-devel mailing list

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/mir-devel

-- 
Cemil AzizogluMir Display Server - Team LeadCanonical USA

--

Mir-devel mailing list

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/mir-devel

-- 
Cemil AzizogluMir Display Server - Team LeadCanonical USA

-- 
Mir-devel mailing list
[email-masked]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/mir-devel

---

From: Alan Griffiths <[email-masked]>
Date: Sun, 22 Feb 2015 16:15:31 +0000

> Any help is highly appreciable.

Hi Gauravdeep,

that depends an awful lot on what you're interested in doing, what time
you have for it, and what experience you have.

The project lives here: https://code.launchpad.net/mir/ (if you want to
propose changes you'll need to sign up to the Ubuntu Code of Conduct).

There are instructions for building and testing the Mir code at
http://unity.ubuntu.com/mir/index.html

If there's a particular problem or feature you'd like to address then
there we can discuss by email or on IRC (freenode #ubuntu-mir) how it
best fits with the existing codebase and design.

Regards,
Alan

---

From: Daniel van Vugt <[email-masked]>
Date: Mon, 23 Feb 2015 09:10:22 +0800

Gauravdeep,

Also keep in mind that online copy of our docs is a bit out of date. 
What it doesn't say (and it should) is that you need to be running vivid 
(Ubuntu 15.04 pre-release) to build the latest Mir source:
    http://cdimage.ubuntu.com/daily-live/current/
Then follow the docs and building Mir should be easy. Once you've built 
it you can run the demo programs immediately and start tinkering however 
you like.

Another side to getting involved in the development process is to 
participate in code reviews, which anyone can do. Either subscribe by 
email to:
    https://code.launchpad.net/~mir-team/mir/development-branch/+subscribe
or if you don't want your email getting flooded with messages, just 
check up on this page and start commenting:
    https://code.launchpad.net/mir/+activereviews

Please do get involved. That goes for anyone :)

- Daniel