Mir

Merge lp:~alan-griffiths/mir/prerequsites-for-fixing-1483223 into lp:mir

Proposed by Alan Griffiths
Status: Work in progress
Proposed branch: lp:~alan-griffiths/mir/prerequsites-for-fixing-1483223
Merge into: lp:mir
Diff against target: 266 lines (+96/-45)
9 files modified
include/common/mir/terminate_with_current_exception.h (+8/-3)
src/common/CMakeLists.txt (+3/-0)
src/common/symbols.map (+27/-0)
src/common/terminate_with_current_exception.cpp (+54/-0)
src/common/udev/CMakeLists.txt (+2/-2)
src/platform/CMakeLists.txt (+0/-2)
src/platform/symbols.map (+0/-18)
src/server/run_mir.cpp (+2/-19)
src/server/symbols.map (+0/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/prerequsites-for-fixing-1483223
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Fixing
Kevin DuBois (community) Approve
Cemil Azizoglu (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+267580@code.launchpad.net

Commit message

Move entry points used by android-input-static into mircommon

In part this is to see whether the team thinks moving the code like this is justified to resolve the android-input-static dependencies properly.

Description of the change

Move entry points used by android-input-static into mircommon

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

That usage of mir::udev::Monitor should be gone as soon as we move evdev related input handling to input platforms. Then it being in mirplatform should not cause problems?

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

(1) This is still series 0.16 we're on, not 0.17:
8 -set(MIR_VERSION_MINOR 16) # This should change at least with every MIRSERVER_ABI
9 +set(MIR_VERSION_MINOR 17) # This should change at least with every MIRSERVER_ABI

review: Needs Fixing
2834. By Alan Griffiths

Fix thinko (we're still on 0.16)

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

(1) Thanks.

(2) Udev enumeration feels like something that should only live in the server. Putting it in libmircommon means we're bloating every client with code it will never use. Is that right? Is it just the lesser evil?

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

(3) src/server/symbols.map: MIR_SERVER_33 should be 34

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

> (2) Udev enumeration feels like something that should only live in the server.
> Putting it in libmircommon means we're bloating every client with code it will
> never use. Is that right? Is it just the lesser evil?

I think Andreas is right that it /belongs/ in an input platform library. But that's not where the input code that uses it is currently linked.

The alternative to this is therefore to clean up the input stack so that chunks are not linked into mirclient. (I hope this is what will happen naturally with the other input platform work.)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
2835. By Alan Griffiths

Revert libmirserver soname bump

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

> I think Andreas is right that it /belongs/ in an input platform library. But..

+1

review: Approve
Revision history for this message
Kevin DuBois (kdub) wrote :

iirc, mesa uses udev to figure out appropriate devices, so probably can't be isolated to an input platform.

Revision history for this message
Kevin DuBois (kdub) :
review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

(3) The mirserver ABI bump to 34 was correct. You can't remove a function from an ABI without declaring a breakage (bump). So we need to bump it, if not here then immediately after this lands.

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

^ because:

256 === modified file 'src/server/symbols.map'
257 --- src/server/symbols.map 2015-07-25 08:10:48 +0000
258 +++ src/server/symbols.map 2015-08-11 10:20:04 +0000
259 @@ -286,7 +286,6 @@
260 mir::shell::WindowManager::operator*;
261 mir::shell::WindowManager::?WindowManager*;
262 mir::shell::WindowManager::WindowManager*;
263 - mir::terminate_with_current_exception*;
264 mir::time::Alarm::?Alarm*;
265 mir::time::Alarm::Alarm*;
266 mir::time::AlarmFactory::?AlarmFactory*;

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

Moved this series to WIP as I now think there's a better order in which to tackle things.

Unmerged revisions

2835. By Alan Griffiths

Revert libmirserver soname bump

2834. By Alan Griffiths

Fix thinko (we're still on 0.16)

2833. By Alan Griffiths

mirserver ABI break - bump the soname

2832. By Alan Griffiths

mirserver ABI break - bump the soname

2831. By Alan Griffiths

Fix symbol versioning in mircommon

2830. By Alan Griffiths

Move mir::udev to common

2829. By Alan Griffiths

remove terminate_with_current_exception() from server symbols

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== renamed file 'include/server/mir/terminate_with_current_exception.h' => 'include/common/mir/terminate_with_current_exception.h'
--- include/server/mir/terminate_with_current_exception.h 2014-12-03 12:30:58 +0000
+++ include/common/mir/terminate_with_current_exception.h 2015-08-11 10:20:04 +0000
@@ -2,15 +2,15 @@
2 * Copyright © 2014 Canonical Ltd.2 * Copyright © 2014 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.6 * as published by the Free Software Foundation.
7 *7 *
8 * This program is distributed in the hope that it will be useful,8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.11 * GNU Lesser General Public License for more details.
12 *12 *
13 * You should have received a copy of the GNU General Public License13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored By: Alan Griffiths <alan@octopull.co.uk>16 * Authored By: Alan Griffiths <alan@octopull.co.uk>
@@ -22,6 +22,11 @@
22namespace mir22namespace mir
23{23{
24void terminate_with_current_exception();24void terminate_with_current_exception();
25
26/// called by main thread to rethrow any termination exception
27void check_for_termination_exception();
28
29void clear_termination_exception();
25}30}
2631
27#endif /* MIR_TERMINATE_WITH_CURRENT_EXCEPTION_H_ */32#endif /* MIR_TERMINATE_WITH_CURRENT_EXCEPTION_H_ */
2833
=== modified file 'src/common/CMakeLists.txt'
--- src/common/CMakeLists.txt 2015-07-16 07:03:19 +0000
+++ src/common/CMakeLists.txt 2015-08-11 10:20:04 +0000
@@ -18,11 +18,14 @@
18add_subdirectory(time)18add_subdirectory(time)
19add_subdirectory(dispatch)19add_subdirectory(dispatch)
20add_subdirectory(fatal)20add_subdirectory(fatal)
21add_subdirectory(udev)
2122
22list(APPEND MIR_COMMON_SOURCES23list(APPEND MIR_COMMON_SOURCES
23 $<TARGET_OBJECTS:mirtime>24 $<TARGET_OBJECTS:mirtime>
24 $<TARGET_OBJECTS:mirfatal>25 $<TARGET_OBJECTS:mirfatal>
26 $<TARGET_OBJECTS:mirudev>
25 ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp27 ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp
28 ${CMAKE_CURRENT_SOURCE_DIR}/terminate_with_current_exception.cpp
26 )29 )
2730
28set(PREFIX "${CMAKE_INSTALL_PREFIX}")31set(PREFIX "${CMAKE_INSTALL_PREFIX}")
2932
=== modified file 'src/common/symbols.map'
--- src/common/symbols.map 2015-06-18 02:46:16 +0000
+++ src/common/symbols.map 2015-08-11 10:20:04 +0000
@@ -142,3 +142,30 @@
142 };142 };
143 local: *;143 local: *;
144};144};
145MIR_COMMON_5.1 {
146 global: mir_*;
147 extern "C++" {
148 mir::check_for_termination_exception*;
149 mir::clear_termination_exception*;
150 mir::terminate_with_current_exception*;
151 mir::udev::Context::?Context*;
152 mir::udev::Context::Context*;
153 mir::udev::Enumerator::begin*;
154 mir::udev::Enumerator::end*;
155 mir::udev::Enumerator::?Enumerator*;
156 mir::udev::Enumerator::Enumerator*;
157 mir::udev::Enumerator::iterator::operator*;
158 mir::udev::Enumerator::match_parent*;
159 mir::udev::Enumerator::match_subsystem*;
160 mir::udev::Enumerator::match_sysname*;
161 mir::udev::Enumerator::scan_devices*;
162 mir::udev::Monitor::enable*;
163 mir::udev::Monitor::fd*;
164 mir::udev::Monitor::filter_by_subsystem*;
165 mir::udev::Monitor::?Monitor*;
166 mir::udev::Monitor::Monitor*;
167 mir::udev::Monitor::process_events*;
168 mir::udev::operator*;
169 };
170 local: *;
171};
145172
=== added file 'src/common/terminate_with_current_exception.cpp'
--- src/common/terminate_with_current_exception.cpp 1970-01-01 00:00:00 +0000
+++ src/common/terminate_with_current_exception.cpp 2015-08-11 10:20:04 +0000
@@ -0,0 +1,54 @@
1/*
2 * Copyright © 2015 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Alan Griffiths <alan@octopull.co.uk>
17 */
18
19#include "mir/terminate_with_current_exception.h"
20
21#include <unistd.h>
22#include <csignal>
23
24#include <exception>
25#include <mutex>
26
27namespace
28{
29std::exception_ptr termination_exception;
30std::mutex termination_exception_mutex;
31}
32
33void mir::clear_termination_exception()
34{
35 std::lock_guard<std::mutex> lock{termination_exception_mutex};
36 termination_exception = nullptr;
37}
38
39void mir::check_for_termination_exception()
40{
41 std::lock_guard<std::mutex> lock{termination_exception_mutex};
42 if (termination_exception)
43 std::rethrow_exception(termination_exception);
44}
45
46void mir::terminate_with_current_exception()
47{
48 std::lock_guard<std::mutex> lock{termination_exception_mutex};
49 if (!termination_exception)
50 {
51 termination_exception = std::current_exception();
52 kill(getpid(), SIGTERM);
53 }
54}
055
=== renamed directory 'src/platform/udev' => 'src/common/udev'
=== modified file 'src/common/udev/CMakeLists.txt'
--- src/platform/udev/CMakeLists.txt 2015-03-31 02:35:42 +0000
+++ src/common/udev/CMakeLists.txt 2015-08-11 10:20:04 +0000
@@ -2,5 +2,5 @@
2 udev_wrapper.cpp2 udev_wrapper.cpp
3)3)
44
5list(APPEND MIR_PLATFORM_REFERENCES ${UDEV_LDFLAGS} ${UDEV_LIBRARIES})5list(APPEND MIR_COMMON_REFERENCES ${UDEV_LDFLAGS} ${UDEV_LIBRARIES})
6set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)6set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE)
77
=== renamed directory 'src/include/platform/mir/udev' => 'src/include/common/mir/udev'
=== modified file 'src/platform/CMakeLists.txt'
--- src/platform/CMakeLists.txt 2015-06-18 02:46:16 +0000
+++ src/platform/CMakeLists.txt 2015-08-11 10:20:04 +0000
@@ -13,7 +13,6 @@
13set(MIR_PLATFORM_OBJECTS13set(MIR_PLATFORM_OBJECTS
14 $<TARGET_OBJECTS:mirplatformgraphicscommon>14 $<TARGET_OBJECTS:mirplatformgraphicscommon>
15 $<TARGET_OBJECTS:miroptions>15 $<TARGET_OBJECTS:miroptions>
16 $<TARGET_OBJECTS:mirudev>
17)16)
1817
19set(MIR_PLATFORM_REFERENCES18set(MIR_PLATFORM_REFERENCES
@@ -23,7 +22,6 @@
2322
24add_subdirectory(graphics/)23add_subdirectory(graphics/)
25add_subdirectory(options)24add_subdirectory(options)
26add_subdirectory(udev)
2725
28set(MIR_PLATFORM_OBJECTS ${MIR_PLATFORM_OBJECTS} PARENT_SCOPE)26set(MIR_PLATFORM_OBJECTS ${MIR_PLATFORM_OBJECTS} PARENT_SCOPE)
29set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)27set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)
3028
=== modified file 'src/platform/symbols.map'
--- src/platform/symbols.map 2015-07-20 03:16:27 +0000
+++ src/platform/symbols.map 2015-08-11 10:20:04 +0000
@@ -257,24 +257,6 @@
257 mir::graphics::red_channel_depth*;257 mir::graphics::red_channel_depth*;
258 mir::graphics::SimpleGLProgram::SimpleGLProgram*;258 mir::graphics::SimpleGLProgram::SimpleGLProgram*;
259 mir::graphics::tessellate_renderable_into_rectangle*;259 mir::graphics::tessellate_renderable_into_rectangle*;
260 mir::udev::Context::?Context*;
261 mir::udev::Context::Context*;
262 mir::udev::Enumerator::begin*;
263 mir::udev::Enumerator::end*;
264 mir::udev::Enumerator::?Enumerator*;
265 mir::udev::Enumerator::Enumerator*;
266 mir::udev::Enumerator::iterator::operator*;
267 mir::udev::Enumerator::match_parent*;
268 mir::udev::Enumerator::match_subsystem*;
269 mir::udev::Enumerator::match_sysname*;
270 mir::udev::Enumerator::scan_devices*;
271 mir::udev::Monitor::enable*;
272 mir::udev::Monitor::fd*;
273 mir::udev::Monitor::filter_by_subsystem*;
274 mir::udev::Monitor::?Monitor*;
275 mir::udev::Monitor::Monitor*;
276 mir::udev::Monitor::process_events*;
277 mir::udev::operator*;
278 };260 };
279 local: *;261 local: *;
280};262};
281263
=== modified file 'src/server/run_mir.cpp'
--- src/server/run_mir.cpp 2015-06-17 05:20:42 +0000
+++ src/server/run_mir.cpp 2015-08-11 10:20:04 +0000
@@ -40,8 +40,6 @@
40auto const intercepted = { SIGQUIT, SIGABRT, SIGFPE, SIGSEGV, SIGBUS };40auto const intercepted = { SIGQUIT, SIGABRT, SIGFPE, SIGSEGV, SIGBUS };
4141
42std::weak_ptr<mir::EmergencyCleanup> weak_emergency_cleanup;42std::weak_ptr<mir::EmergencyCleanup> weak_emergency_cleanup;
43std::exception_ptr termination_exception;
44std::mutex termination_exception_mutex;
4543
46extern "C" void perform_emergency_cleanup()44extern "C" void perform_emergency_cleanup()
47{45{
@@ -76,10 +74,7 @@
76 std::function<void(int)> const& terminator)74 std::function<void(int)> const& terminator)
77{75{
78 DisplayServer* server_ptr{nullptr};76 DisplayServer* server_ptr{nullptr};
79 {77 clear_termination_exception();
80 std::lock_guard<std::mutex> lock{termination_exception_mutex};
81 termination_exception = nullptr;
82 }
8378
84 auto const main_loop = config.the_main_loop();79 auto const main_loop = config.the_main_loop();
8580
@@ -114,17 +109,5 @@
114 init(server);109 init(server);
115 server.run();110 server.run();
116111
117 std::lock_guard<std::mutex> lock{termination_exception_mutex};112 check_for_termination_exception();
118 if (termination_exception)
119 std::rethrow_exception(termination_exception);
120}
121
122void mir::terminate_with_current_exception()
123{
124 std::lock_guard<std::mutex> lock{termination_exception_mutex};
125 if (!termination_exception)
126 {
127 termination_exception = std::current_exception();
128 kill(getpid(), SIGTERM);
129 }
130}113}
131114
=== modified file 'src/server/symbols.map'
--- src/server/symbols.map 2015-07-25 08:10:48 +0000
+++ src/server/symbols.map 2015-08-11 10:20:04 +0000
@@ -286,7 +286,6 @@
286 mir::shell::WindowManager::operator*;286 mir::shell::WindowManager::operator*;
287 mir::shell::WindowManager::?WindowManager*;287 mir::shell::WindowManager::?WindowManager*;
288 mir::shell::WindowManager::WindowManager*;288 mir::shell::WindowManager::WindowManager*;
289 mir::terminate_with_current_exception*;
290 mir::time::Alarm::?Alarm*;289 mir::time::Alarm::?Alarm*;
291 mir::time::Alarm::Alarm*;290 mir::time::Alarm::Alarm*;
292 mir::time::AlarmFactory::?AlarmFactory*;291 mir::time::AlarmFactory::?AlarmFactory*;

Subscribers

People subscribed via source and target branches