Mir

Merge lp:~bregma/mir/build-on-saucy into lp:~mir-team/mir/trunk

Proposed by Stephen M. Webb
Status: Rejected
Rejected by: Alan Griffiths
Proposed branch: lp:~bregma/mir/build-on-saucy
Merge into: lp:~mir-team/mir/trunk
Diff against target: 59 lines (+8/-3)
4 files modified
examples/CMakeLists.txt (+1/-0)
src/server/compositor/swapper_factory.cpp (+4/-2)
src/server/options/program_option.cpp (+1/-0)
tests/mir_test_framework/process.cpp (+2/-1)
To merge this branch: bzr merge lp:~bregma/mir/build-on-saucy
Reviewer Review Type Date Requested Status
Alan Griffiths Disapprove
Daniel van Vugt Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Alexandros Frantzis (community) Needs Fixing
Review via email: mp+168566@code.launchpad.net

Commit message

Tweaks to get the code base building on Ubuntu 13.10 "Saucy Salamander".

Description of the change

Fixes to get mir building on Saucy Salamander. Mostly due to GCC 4.8 and CMake 2.8.11.

(1) include the required headers where previously they were indirectly included
(2) disables some new GCC 4.8 warnings in the presence of -Werror
(3) avoid depending on the side effects of code executed within an assert() statement, since CMake now sets NDEBUG

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

6 +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused")

Many (all?) of the assert() invocations in the code are pre/postcondition checks that are cheap and useful enough to have enabled all the time. I think the proper way to handle this would be to use some other (custom) function/macro that doesn't take NDEBUG into account.

30 +#ifndef NDEBUG

Since NDEBUG is set by CMake now, this test now never runs by default. See point above.

48 + if (pid <= 0)
49 + abort();

Mir uses 4 space indentation.

If it's urgent to get GCC 4.8 support then I am OK with this approach for now, but we should handle this issue in better way in the future.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> 6 +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused")
>
> Many (all?) of the assert() invocations in the code are pre/postcondition
> checks that are cheap and useful enough to have enabled all the time. I think
> the proper way to handle this would be to use some other (custom)
> function/macro that doesn't take NDEBUG into account.

All of the asserts (including the one changed) are precondition checks to provide a better diagnostic. I don't believe that we rely on side effects.

If NDEBUG is being set, then we shouldn't be using assert() for this.

> 30 +#ifndef NDEBUG
>
> Since NDEBUG is set by CMake now, this test now never runs by default. See
> point above.

If the test passing depends upon NDEBUG then at least one of the test and the behavior under test is wrong.

> If it's urgent to get GCC 4.8 support then I am OK with this approach for now,
> but we should handle this issue in better way in the future.

+1

review: Needs Fixing
lp:~bregma/mir/build-on-saucy updated
732. By Stephen M. Webb

adjusted coding style to match the oral folklore of the project

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~bregma/mir/build-on-saucy updated
733. By Stephen M. Webb

made removed warning more specific

Revision history for this message
Stephen M. Webb (bregma) wrote :

> I don't believe that we rely on side effects.

You may keep your faith. I will choose to rely on reading the code and logs from the ongoing unaddressed build failures in the staging PPA.

I modified the code to conform to the tab style. I also fixed the failing swapper factory test by moving the executed code outside of the assert() macro instead of commenting out the test. A more invasive change to provide a project-specific replacement for the standard assert() macro is beyond the scope of this change, which is targeted at getting mir to build on one its two target platforms (the current Ubuntu desktop development series).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Clang says no, because:
[ 26%] Building CXX object examples/CMakeFiles/mirdraw.dir/graphics_utils.cpp.o
clang: error: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-variable'?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

To fix the clang failure reported by Jenkins, you'll need to change:

6 +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")

to something like:

if (NOT "${CMAKE_CXX_COMPILER}" MATCHES "clang")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")
endif()

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Rather than tactically hiding the issues (e.g. disabling warnings) as proposed here I'd rather see them addressed strategically (fixing the code).

Is there any urgency to get mir building on saucy? Can we take the time to "do it right"?

I confess to a current lack of interest in saucy: I tried loading saucy on my netbook last week, but found that compiz/unity crashed whenever I started some applications.

review: Needs Fixing
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Rather than tactically hiding the issues (e.g. disabling warnings) as proposed
> here I'd rather see them addressed strategically (fixing the code).
>
> Is there any urgency to get mir building on saucy? Can we take the time to "do
> it right"?
>
> I confess to a current lack of interest in saucy: I tried loading saucy on my
> netbook last week, but found that compiz/unity crashed whenever I started some
> applications.

Correct tag "Needs Fixing"

review: Needs Information
Revision history for this message
Robert Ancell (robert-ancell) wrote :

> I confess to a current lack of interest in saucy: I tried loading saucy on my
> netbook last week, but found that compiz/unity crashed whenever I started some
> applications.

Ubuntu Touch is moving to Saucy = we're moving to saucy. A number of us have been running it for some time, so please update. There was a major Unity update recently which seems to have fixed some stability issues - please retry.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That's odd. I just set up a fresh saucy machine and it builds lp:mir without any errors.

Can you please do an update and try again? I suspect this whole proposal is unnecessary.

There are warnings about things in gmock/gtest headers but we expect and ignore those because we'd rather not modify the 3rd_party stuff.

review: Needs Information
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh I see the problem now. It fails to build with debuild on saucy.

You can however do a regular cmake/make without any errors. And even cmake -Duse_debflags=ON still succeeds. There's something about debuild that makes it more sensitive though.

review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
review: Disapprove
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :
review: Disapprove

Unmerged revisions

733. By Stephen M. Webb

made removed warning more specific

732. By Stephen M. Webb

adjusted coding style to match the oral folklore of the project

731. By Stephen M. Webb

repaired the use of assert() on code with side effects

730. By Stephen M. Webb

removed unused-variable warning causing a FTBFS with GCC 4.8

729. By Stephen M. Webb

added required header to fix FTBFS

728. By Kevin DuBois

Add an algorithm for dynamically switching between two differrent BufferSwapper algorithms.

Approved by PS Jenkins bot, Alan Griffiths, Alexandros Frantzis, Robert Carr, kevin gunn.

727. By Alan Griffiths

client: close surface fds when finished with surface.

Approved by Alexandros Frantzis, PS Jenkins bot.

726. By Robert Carr

debian/: Add boost program options to dependencies for libmirserver-dev.

Approved by Alan Griffiths, Alexandros Frantzis, PS Jenkins bot.

725. By Daniel van Vugt

Make the default cursor more cursor-like.

Approved by Robert Ancell, Alan Griffiths, PS Jenkins bot.

724. By Robert Carr

Change client library display sizes to unsigned.

Approved by Robert Ancell, PS Jenkins bot, Alan Griffiths.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/CMakeLists.txt'
2--- examples/CMakeLists.txt 2013-05-22 14:19:25 +0000
3+++ examples/CMakeLists.txt 2013-06-11 15:08:28 +0000
4@@ -1,4 +1,5 @@
5 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fno-strict-aliasing -Wextra")
6+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")
7
8 add_library(eglapp STATIC
9 eglapp.c
10
11=== modified file 'src/server/compositor/swapper_factory.cpp'
12--- src/server/compositor/swapper_factory.cpp 2013-05-29 23:18:31 +0000
13+++ src/server/compositor/swapper_factory.cpp 2013-06-11 15:08:28 +0000
14@@ -37,7 +37,8 @@
15 gr_allocator(gr_alloc),
16 number_of_buffers(2)
17 {
18- assert(gr_alloc);
19+ if (!gr_allocator)
20+ abort();
21 }
22
23 mc::SwapperFactory::SwapperFactory(
24@@ -45,7 +46,8 @@
25 gr_allocator(gr_alloc),
26 number_of_buffers(number_of_buffers)
27 {
28- assert(gr_alloc);
29+ if (!gr_allocator)
30+ abort();
31 }
32
33 std::unique_ptr<mc::BufferSwapperMaster> mc::SwapperFactory::create_swapper_master(
34
35=== modified file 'src/server/options/program_option.cpp'
36--- src/server/options/program_option.cpp 2013-04-30 23:28:00 +0000
37+++ src/server/options/program_option.cpp 2013-06-11 15:08:28 +0000
38@@ -21,6 +21,7 @@
39 #include <boost/program_options/parsers.hpp>
40
41 #include <fstream>
42+#include <iostream>
43
44 namespace mo = mir::options;
45 namespace po = boost::program_options;
46
47=== modified file 'tests/mir_test_framework/process.cpp'
48--- tests/mir_test_framework/process.cpp 2012-12-20 09:00:28 +0000
49+++ tests/mir_test_framework/process.cpp 2013-06-11 15:08:28 +0000
50@@ -66,7 +66,8 @@
51 , terminated(false)
52 , detached(false)
53 {
54- assert(pid > 0);
55+ if (pid <= 0)
56+ abort();
57 }
58
59 mtf::Process::~Process()

Subscribers

People subscribed via source and target branches