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
1=== renamed file 'include/server/mir/terminate_with_current_exception.h' => 'include/common/mir/terminate_with_current_exception.h'
2--- include/server/mir/terminate_with_current_exception.h 2014-12-03 12:30:58 +0000
3+++ include/common/mir/terminate_with_current_exception.h 2015-08-11 10:20:04 +0000
4@@ -2,15 +2,15 @@
5 * Copyright © 2014 Canonical Ltd.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8- * under the terms of the GNU General Public License version 3,
9+ * under the terms of the GNU Lesser General Public License version 3,
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15- * GNU General Public License for more details.
16+ * GNU Lesser General Public License for more details.
17 *
18- * You should have received a copy of the GNU General Public License
19+ * You should have received a copy of the GNU Lesser General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 *
22 * Authored By: Alan Griffiths <alan@octopull.co.uk>
23@@ -22,6 +22,11 @@
24 namespace mir
25 {
26 void terminate_with_current_exception();
27+
28+/// called by main thread to rethrow any termination exception
29+void check_for_termination_exception();
30+
31+void clear_termination_exception();
32 }
33
34 #endif /* MIR_TERMINATE_WITH_CURRENT_EXCEPTION_H_ */
35
36=== modified file 'src/common/CMakeLists.txt'
37--- src/common/CMakeLists.txt 2015-07-16 07:03:19 +0000
38+++ src/common/CMakeLists.txt 2015-08-11 10:20:04 +0000
39@@ -18,11 +18,14 @@
40 add_subdirectory(time)
41 add_subdirectory(dispatch)
42 add_subdirectory(fatal)
43+add_subdirectory(udev)
44
45 list(APPEND MIR_COMMON_SOURCES
46 $<TARGET_OBJECTS:mirtime>
47 $<TARGET_OBJECTS:mirfatal>
48+ $<TARGET_OBJECTS:mirudev>
49 ${CMAKE_CURRENT_SOURCE_DIR}/log.cpp
50+ ${CMAKE_CURRENT_SOURCE_DIR}/terminate_with_current_exception.cpp
51 )
52
53 set(PREFIX "${CMAKE_INSTALL_PREFIX}")
54
55=== modified file 'src/common/symbols.map'
56--- src/common/symbols.map 2015-06-18 02:46:16 +0000
57+++ src/common/symbols.map 2015-08-11 10:20:04 +0000
58@@ -142,3 +142,30 @@
59 };
60 local: *;
61 };
62+MIR_COMMON_5.1 {
63+ global: mir_*;
64+ extern "C++" {
65+ mir::check_for_termination_exception*;
66+ mir::clear_termination_exception*;
67+ mir::terminate_with_current_exception*;
68+ mir::udev::Context::?Context*;
69+ mir::udev::Context::Context*;
70+ mir::udev::Enumerator::begin*;
71+ mir::udev::Enumerator::end*;
72+ mir::udev::Enumerator::?Enumerator*;
73+ mir::udev::Enumerator::Enumerator*;
74+ mir::udev::Enumerator::iterator::operator*;
75+ mir::udev::Enumerator::match_parent*;
76+ mir::udev::Enumerator::match_subsystem*;
77+ mir::udev::Enumerator::match_sysname*;
78+ mir::udev::Enumerator::scan_devices*;
79+ mir::udev::Monitor::enable*;
80+ mir::udev::Monitor::fd*;
81+ mir::udev::Monitor::filter_by_subsystem*;
82+ mir::udev::Monitor::?Monitor*;
83+ mir::udev::Monitor::Monitor*;
84+ mir::udev::Monitor::process_events*;
85+ mir::udev::operator*;
86+ };
87+ local: *;
88+};
89
90=== added file 'src/common/terminate_with_current_exception.cpp'
91--- src/common/terminate_with_current_exception.cpp 1970-01-01 00:00:00 +0000
92+++ src/common/terminate_with_current_exception.cpp 2015-08-11 10:20:04 +0000
93@@ -0,0 +1,54 @@
94+/*
95+ * Copyright © 2015 Canonical Ltd.
96+ *
97+ * This program is free software: you can redistribute it and/or modify it
98+ * under the terms of the GNU Lesser General Public License version 3,
99+ * as published by the Free Software Foundation.
100+ *
101+ * This program is distributed in the hope that it will be useful,
102+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
103+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
104+ * GNU Lesser General Public License for more details.
105+ *
106+ * You should have received a copy of the GNU Lesser General Public License
107+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
108+ *
109+ * Authored by: Alan Griffiths <alan@octopull.co.uk>
110+ */
111+
112+#include "mir/terminate_with_current_exception.h"
113+
114+#include <unistd.h>
115+#include <csignal>
116+
117+#include <exception>
118+#include <mutex>
119+
120+namespace
121+{
122+std::exception_ptr termination_exception;
123+std::mutex termination_exception_mutex;
124+}
125+
126+void mir::clear_termination_exception()
127+{
128+ std::lock_guard<std::mutex> lock{termination_exception_mutex};
129+ termination_exception = nullptr;
130+}
131+
132+void mir::check_for_termination_exception()
133+{
134+ std::lock_guard<std::mutex> lock{termination_exception_mutex};
135+ if (termination_exception)
136+ std::rethrow_exception(termination_exception);
137+}
138+
139+void mir::terminate_with_current_exception()
140+{
141+ std::lock_guard<std::mutex> lock{termination_exception_mutex};
142+ if (!termination_exception)
143+ {
144+ termination_exception = std::current_exception();
145+ kill(getpid(), SIGTERM);
146+ }
147+}
148
149=== renamed directory 'src/platform/udev' => 'src/common/udev'
150=== modified file 'src/common/udev/CMakeLists.txt'
151--- src/platform/udev/CMakeLists.txt 2015-03-31 02:35:42 +0000
152+++ src/common/udev/CMakeLists.txt 2015-08-11 10:20:04 +0000
153@@ -2,5 +2,5 @@
154 udev_wrapper.cpp
155 )
156
157-list(APPEND MIR_PLATFORM_REFERENCES ${UDEV_LDFLAGS} ${UDEV_LIBRARIES})
158-set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)
159+list(APPEND MIR_COMMON_REFERENCES ${UDEV_LDFLAGS} ${UDEV_LIBRARIES})
160+set(MIR_COMMON_REFERENCES ${MIR_COMMON_REFERENCES} PARENT_SCOPE)
161
162=== renamed directory 'src/include/platform/mir/udev' => 'src/include/common/mir/udev'
163=== modified file 'src/platform/CMakeLists.txt'
164--- src/platform/CMakeLists.txt 2015-06-18 02:46:16 +0000
165+++ src/platform/CMakeLists.txt 2015-08-11 10:20:04 +0000
166@@ -13,7 +13,6 @@
167 set(MIR_PLATFORM_OBJECTS
168 $<TARGET_OBJECTS:mirplatformgraphicscommon>
169 $<TARGET_OBJECTS:miroptions>
170- $<TARGET_OBJECTS:mirudev>
171 )
172
173 set(MIR_PLATFORM_REFERENCES
174@@ -23,7 +22,6 @@
175
176 add_subdirectory(graphics/)
177 add_subdirectory(options)
178-add_subdirectory(udev)
179
180 set(MIR_PLATFORM_OBJECTS ${MIR_PLATFORM_OBJECTS} PARENT_SCOPE)
181 set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)
182
183=== modified file 'src/platform/symbols.map'
184--- src/platform/symbols.map 2015-07-20 03:16:27 +0000
185+++ src/platform/symbols.map 2015-08-11 10:20:04 +0000
186@@ -257,24 +257,6 @@
187 mir::graphics::red_channel_depth*;
188 mir::graphics::SimpleGLProgram::SimpleGLProgram*;
189 mir::graphics::tessellate_renderable_into_rectangle*;
190- mir::udev::Context::?Context*;
191- mir::udev::Context::Context*;
192- mir::udev::Enumerator::begin*;
193- mir::udev::Enumerator::end*;
194- mir::udev::Enumerator::?Enumerator*;
195- mir::udev::Enumerator::Enumerator*;
196- mir::udev::Enumerator::iterator::operator*;
197- mir::udev::Enumerator::match_parent*;
198- mir::udev::Enumerator::match_subsystem*;
199- mir::udev::Enumerator::match_sysname*;
200- mir::udev::Enumerator::scan_devices*;
201- mir::udev::Monitor::enable*;
202- mir::udev::Monitor::fd*;
203- mir::udev::Monitor::filter_by_subsystem*;
204- mir::udev::Monitor::?Monitor*;
205- mir::udev::Monitor::Monitor*;
206- mir::udev::Monitor::process_events*;
207- mir::udev::operator*;
208 };
209 local: *;
210 };
211
212=== modified file 'src/server/run_mir.cpp'
213--- src/server/run_mir.cpp 2015-06-17 05:20:42 +0000
214+++ src/server/run_mir.cpp 2015-08-11 10:20:04 +0000
215@@ -40,8 +40,6 @@
216 auto const intercepted = { SIGQUIT, SIGABRT, SIGFPE, SIGSEGV, SIGBUS };
217
218 std::weak_ptr<mir::EmergencyCleanup> weak_emergency_cleanup;
219-std::exception_ptr termination_exception;
220-std::mutex termination_exception_mutex;
221
222 extern "C" void perform_emergency_cleanup()
223 {
224@@ -76,10 +74,7 @@
225 std::function<void(int)> const& terminator)
226 {
227 DisplayServer* server_ptr{nullptr};
228- {
229- std::lock_guard<std::mutex> lock{termination_exception_mutex};
230- termination_exception = nullptr;
231- }
232+ clear_termination_exception();
233
234 auto const main_loop = config.the_main_loop();
235
236@@ -114,17 +109,5 @@
237 init(server);
238 server.run();
239
240- std::lock_guard<std::mutex> lock{termination_exception_mutex};
241- if (termination_exception)
242- std::rethrow_exception(termination_exception);
243-}
244-
245-void mir::terminate_with_current_exception()
246-{
247- std::lock_guard<std::mutex> lock{termination_exception_mutex};
248- if (!termination_exception)
249- {
250- termination_exception = std::current_exception();
251- kill(getpid(), SIGTERM);
252- }
253+ check_for_termination_exception();
254 }
255
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*;

Subscribers

People subscribed via source and target branches