Mir

Merge lp:~robert-ancell/mir/shared-android-input into lp:~mir-team/mir/trunk

Proposed by Robert Ancell
Status: Rejected
Rejected by: Daniel van Vugt
Proposed branch: lp:~robert-ancell/mir/shared-android-input
Merge into: lp:~mir-team/mir/trunk
Diff against target: 20 lines (+1/-5)
1 file modified
3rd_party/android-input/android/CMakeLists.txt (+1/-5)
To merge this branch: bzr merge lp:~robert-ancell/mir/shared-android-input
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Needs Fixing
Kevin DuBois (community) Approve
Alan Griffiths Approve
Daniel van Vugt Approve
Robert Carr Pending
Review via email: mp+157017@code.launchpad.net

Commit message

Revert android-input being a shared library:
 - It's not packaged
 - It doesn't have a globally unique name (it should be mirinput or similar to avoid colliding with names)
 - It's not versioned
 - There isn't a strong reason to have to maintain a separate library

Description of the change

Revert android-input being a shared library:
 - It's not packaged
 - It doesn't have a globally unique name (it should be mirinput or similar to avoid colliding with names)
 - It's not versioned
 - There isn't a strong reason to have to maintain a separate library

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
Daniel van Vugt (vanvugt) wrote :

This is a case where we explicitly want a STATIC library, and to not leave it up to CMake to decide (it might still use SHARED depending on CMake settings). So please change:
    add_library(android-input
to:
    add_library(android-input STATIC

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

> This is a case where we explicitly want a STATIC library, and to not leave it
> up to CMake to decide (it might still use SHARED depending on CMake settings).
> So please change:
> add_library(android-input
> to:
> add_library(android-input STATIC

Ah, I initially set it to STATIC but I noticed the old code didn't have this. Explicit is better than implicit here.

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

Cool. If making it static and potentially duplicated across the client and server libraries increases code bloat, then that's fine. We can worry about reducing bloat later.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Robert Carr - can you just check there's not a major side-effect of switching back to static? We had half a conversation on IRC and I think there weren't strong reasons for going shared.

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

This should be fine. We might plausibly want to split input out as a separate library at some point - but that ought to include mir::input along with the forked android code.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

not sure what jenkins is complaining about, but looks sensible to me as well.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

There is some crash going on in the acceptance tests, investigating.

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

[ 53%] Check that discovering Tests in acceptance-tests works
cd /home/dan/bzr/mir/tmp.ra/build/tests/acceptance-tests && /home/dan/bzr/mir/tmp.ra/build/bin/acceptance-tests --gtest_list_tests > /dev/null
Segmentation fault (core dumped)

The crash only happens to *-tests binaries. It does not happen if you run the partially built bin/mir and a real client.

So only crashing in *-tests and being triggered by a switch to STATIC, means it's almost certainly a symbol mix-up. This will happen in *-tests because those binaries link to both libmirclient and libmirserver. And that's now dangerous because those shared libraries will have identical symbols they both pull in from libandroid-input.

This is not to say that libandroid-input needs to always remain dynamic. We just have to tweak the dynamic loader and/or avoid "static" symbols in static/archive libraries.

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

The crash in both unit-tests and acceptance-tests looks like it's caused by this static:
    android::KeyCharacterMap::sEmpty

It's being unref'd and deleted twice. Because there is a copy in both libmirclient and libmirserver.

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

Wow, launchpad got confused.

This is not merged. It is rejected. Because the branch that actually merged is:
  lp:~vanvugt/mir/fix-1164253

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '3rd_party/android-input/android/CMakeLists.txt'
2--- 3rd_party/android-input/android/CMakeLists.txt 2013-03-13 04:54:15 +0000
3+++ 3rd_party/android-input/android/CMakeLists.txt 2013-04-04 20:13:23 +0000
4@@ -49,7 +49,7 @@
5
6
7 add_library(
8- android-input SHARED
9+ android-input STATIC
10 # The stuff that we want
11 frameworks/base/services/input/EventHub.cpp
12 frameworks/base/services/input/InputApplication.cpp
13@@ -97,7 +97,3 @@
14 PROPERTIES
15 COMPILE_FLAGS ${ANDROID_INPUT_COMPILE_FLAGS}
16 )
17-
18-install(
19- TARGETS android-input
20- LIBRARY DESTINATION lib)

Subscribers

People subscribed via source and target branches