Mir

Merge lp:~mir-team/mir/consolidate-crossbuild-scripts into lp:~mir-team/mir/trunk

Proposed by Kevin DuBois
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 540
Proposed branch: lp:~mir-team/mir/consolidate-crossbuild-scripts
Merge into: lp:~mir-team/mir/trunk
Diff against target: 311 lines (+160/-33)
7 files modified
cross-compile-chroot.sh (+7/-19)
debian/control (+2/-1)
doc/building_source_for_android.md (+6/-3)
tests/mir_test_framework/signal_dispatcher.cpp (+6/-5)
tools/install_on_android.sh (+9/-5)
tools/setup-android-dependencies.sh (+31/-0)
tools/setup-partial-armhf-chroot.sh (+99/-0)
To merge this branch: bzr merge lp:~mir-team/mir/consolidate-crossbuild-scripts
Reviewer Review Type Date Requested Status
Daniel van Vugt Abstain
PS Jenkins bot (community) continuous-integration Approve
Alexandros Frantzis (community) Approve
Alan Griffiths Approve
Kevin DuBois (community) Abstain
Review via email: mp+154762@code.launchpad.net

Commit message

pull the scripts used to help cross compile mir into the main build tree. also, add glog dependency to the armhf dependencies, remove some boost usage
fixes: LP #1124873

Description of the change

pull over the script used in ~kdub/mir/ndk-rewrite to the main build.
This branch will be deprecated.

This requires you to add the phablet-team/ppa to the setup you have for retrieving the dependencies (the ndk-rewrite branch had previously stored a copy of hybris in it, a hack that is going away)

example deb line: deb [arch=armhf] http://ppa.launchpad.net/phablet-team/ppa/ubuntu quantal main

also, remove some usage of boost threads that was causing me some problems

To post a comment you must log in.
Revision history for this message
Kevin DuBois (kdub) wrote :

just a test branch at the moment to check jenkins still works with the script bumps

review: Disapprove
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:474
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mir-team/mir/consolidate-crossbuild-scripts/+merge/154762/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mir-ci/160/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-android-raring-i386-build/77/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/161/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/mir-ci/160/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

the failure is because this line:
deb [arch=armhf] http://ppa.launchpad.net/phablet-team/ppa/ubuntu quantal main
is needed in the builder setup's sources.list for the hybris armhf packages

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

I know it's just a test right now. But the name "consolidate-crossbuild-scripts" implies only script changes, and maybe docs. So this change looks out of place:

=== modified file 'tests/mir_test_framework/signal_dispatcher.cpp'

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:474
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mir-team/mir/consolidate-crossbuild-scripts/+merge/154762/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mir-ci/180/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-raring-i386-build/105
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/181/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/mir-ci/180/rebuild

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

FAILED: Continuous integration, rev:475
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mir-team/mir/consolidate-crossbuild-scripts/+merge/154762/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mir-ci/194/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-raring-i386-build/125
    FAILURE: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/195/console

Click here to trigger a rebuild:
http://s-jenkins:8080/job/mir-ci/194/rebuild

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

FAILED: Continuous integration, rev:476
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mir-team/mir/consolidate-crossbuild-scripts/+merge/154762/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/mir-ci/195/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-android-raring-i386-build/126
    SUCCESS: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/196
        deb: http://jenkins.qa.ubuntu.com/job/mir-quantal-amd64-ci/196/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins:8080/job/mir-ci/195/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

> just a test branch at the moment to check jenkins still works with the script
> bumps
scripts now work, changing to abstain

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

> I know it's just a test right now. But the name "consolidate-crossbuild-
> scripts" implies only script changes, and maybe docs. So this change looks out
> of place:
>
> === modified file 'tests/mir_test_framework/signal_dispatcher.cpp'

updated the descriptions to bring attention to it.

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

LGTM

(The cleanup of signal_dispatcher.cpp would probably be better as a separate MP, but not worth blocking.)

review: Approve
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

63 can look at the script and instructions in lp:~kdub/mir/ndk-rewrite as an

Should we change this to point to lp:mir, or is the information in lp:~kdub/mir/ndk-rewrite more suitable?

76 +provides a scripting example of how to cross compile. The 'setup partial-armhf-chroot.sh' will attempt to download all the arm dependencies you need. You have to have your APT sources.list files pointed at arm repositories.

Since we want .md files to be readable without preprocessing, we should wrap the lines nicely.

103 +++ setup-android-dependencies.sh
139 +++ setup-partial-armhf-chroot.sh

Perhaps tools/ would be a better place for these files?

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

> 63 can look at the script and instructions in lp:~kdub/mir/ndk-rewrite as
> an
>
> Should we change this to point to lp:mir, or is the information in
> lp:~kdub/mir/ndk-rewrite more suitable?
>
> 76 +provides a scripting example of how to cross compile. The 'setup partial-
> armhf-chroot.sh' will attempt to download all the arm dependencies you need.
> You have to have your APT sources.list files pointed at arm repositories.
>
> Since we want .md files to be readable without preprocessing, we should wrap
> the lines nicely.
>
> 103 +++ setup-android-dependencies.sh
> 139 +++ setup-partial-armhf-chroot.sh
>
> Perhaps tools/ would be a better place for these files?

should be addressed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good.

review: Approve
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 :

Linked bug 1124873 because it appears to be relevant.

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

I'm not going to spend time testing with the Nexus today so can't really declare this properly reviewed.

If I was to nit-pick then I would say try to avoid using "$1" more than once in a script. It is easier for maintenance and readability to use:
  foo="$1"
and then $foo thereafter.

I will trust the existing approvals are enough for now.

review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cross-compile-chroot.sh'
2--- cross-compile-chroot.sh 2013-03-14 05:33:42 +0000
3+++ cross-compile-chroot.sh 2013-03-26 16:33:23 +0000
4@@ -1,34 +1,22 @@
5 #!/bin/bash
6 # build script for Mir on android arm devices
7-# test run requires package 'android-tools-adb'
8-#
9-# you should use this file if you have to do an integration test, or as
10-# an example of how to build. this script will do more downloading than you
11-# might want in a development workflow
12 #
13 set -e
14
15 BUILD_DIR=build-android-arm
16
17-#note:ndk-rewrite is just temporary until the real is pushed
18 if [ "$MIR_NDK_PATH" = "" ]; then
19- export MIR_NDK_PATH=`pwd`/ndk-rewrite
20+ export MIR_NDK_PATH=`pwd`/partial-armhf-chroot
21+ if [ ! -d ${MIR_NDK_PATH} ]; then
22+ echo "no partial root specified or detected. attempting to create one"
23+ pushd tools > /dev/null
24+ ./setup-partial-armhf-chroot.sh ${MIR_NDK_PATH}
25+ popd > /dev/null
26+ fi
27 fi
28
29 echo "Using MIR_NDK_PATH: $MIR_NDK_PATH"
30
31-if [[ -d ${MIR_NDK_PATH} ]]; then
32- pushd ${MIR_NDK_PATH}
33- bzr pull
34- popd
35-else
36- bzr branch lp:~kdub/mir/ndk-rewrite ${MIR_NDK_PATH}
37-fi
38-
39-pushd ${MIR_NDK_PATH} > /dev/null
40- ./generate-armhf-deps.sh
41-popd > /dev/null
42-
43 #start with a clean build every time
44 rm -rf ${BUILD_DIR}
45 mkdir ${BUILD_DIR}
46
47=== modified file 'debian/control'
48--- debian/control 2013-03-13 04:54:15 +0000
49+++ debian/control 2013-03-26 16:33:23 +0000
50@@ -16,7 +16,8 @@
51 libgbm-dev [!armhf],
52 libprotobuf-dev,
53 pkg-config,
54- libhybris-dev [armhf]
55+ libhybris-dev [armhf],
56+ libgoogle-glog-dev
57 Standards-Version: 3.9.3
58 Homepage: https://launchpad.net/mir
59 # If you aren't a member of ~mir-team but need to upload packaging changes,
60
61=== modified file 'doc/building_source_for_android.md'
62--- doc/building_source_for_android.md 2013-03-13 09:19:56 +0000
63+++ doc/building_source_for_android.md 2013-03-26 16:33:23 +0000
64@@ -56,10 +56,10 @@
65 targeting a quantal phablet image)
66
67 2. Set up a chroot with the mir dependencies installed. At the moment, you
68- can look at the script and instructions in lp:~kdub/mir/ndk-rewrite as an
69+ can look at the script and instructions in lp:mir as an
70 example of how to set up a partial chroot you can build mir against.
71
72-3. There are a few options, but here is an example of how to build mir for android
73+3. There are a few ways to do this, but here is an example of how to build mir for android
74
75 $ bzr branch lp:mir
76 $ mkdir mir/build; cd mir/build
77@@ -67,4 +67,7 @@
78 $ make
79
80 N.B. The `cross-compile-android.sh` script in mir's top level directory
81-provides a scripting example of how to cross compile
82+provides a scripting example of how to cross compile.
83+The 'setup-partial-armhf-chroot.sh' will attempt to download all the arm
84+dependencies you need. You have to have your APT sources.list files pointed at
85+arm repositories.
86
87=== modified file 'tests/mir_test_framework/signal_dispatcher.cpp'
88--- tests/mir_test_framework/signal_dispatcher.cpp 2012-12-21 08:16:26 +0000
89+++ tests/mir_test_framework/signal_dispatcher.cpp 2013-03-26 16:33:23 +0000
90@@ -18,8 +18,8 @@
91
92 #include "mir_test_framework/signal_dispatcher.h"
93
94-#include <boost/thread.hpp>
95-
96+#include <mutex>
97+#include <thread>
98 #include <signal.h>
99 #include <sys/types.h>
100 #include <sys/socket.h>
101@@ -84,7 +84,7 @@
102 namespace
103 {
104 std::shared_ptr<mtf::SignalDispatcher> instance;
105-boost::once_flag init_flag;
106+std::once_flag init_flag;
107
108 void init()
109 {
110@@ -104,6 +104,7 @@
111 {
112 Private() : worker_thread(std::bind(&Private::worker, this))
113 {
114+ worker_thread.detach();
115 }
116
117 void worker()
118@@ -123,13 +124,13 @@
119 }
120 }
121
122- boost::thread worker_thread;
123+ std::thread worker_thread;
124 mtf::SignalDispatcher::SignalType signal_channel;
125 };
126
127 std::shared_ptr<mtf::SignalDispatcher> mtf::SignalDispatcher::instance()
128 {
129- boost::call_once(::init_flag, ::init);
130+ std::call_once(::init_flag, ::init);
131
132 return ::instance;
133 }
134
135=== renamed file 'install_on_android.sh' => 'tools/install_on_android.sh'
136--- install_on_android.sh 2013-03-12 21:45:48 +0000
137+++ tools/install_on_android.sh 2013-03-26 16:33:23 +0000
138@@ -1,5 +1,7 @@
139 #!/bin/bash
140 # build script for Mir on android arm devices
141+# script assumes that the Mir dependencies are already set up on the device.
142+# if they are not set up, see the setup-android-dependencies.sh script
143 # test run requires package 'android-tools-adb'
144 # test also assumes that the device is rooted and accessible over the adb bridge
145 #
146@@ -7,7 +9,13 @@
147 #
148
149 set -e
150-BUILD_DIR=build-android-arm
151+
152+if [ -z ${1} ]; then
153+ BUILD_DIR=build-android-arm
154+else
155+ BUILD_DIR=${1}
156+fi
157+
158 pushd ${BUILD_DIR} > /dev/null
159 #
160 # Upload and run the tests!
161@@ -32,10 +40,6 @@
162 done
163
164 echo "ubuntu_chroot shell;
165- apt-get install libprotobuf7
166- libboost-system1.49.0
167- libboost-program-options1.49.0
168- libboost-thread1.49.0;
169 cd ${RUN_DIR};
170 export GTEST_OUTPUT=xml:./;
171 export LD_LIBRARY_PATH=.;
172
173=== added file 'tools/setup-android-dependencies.sh'
174--- tools/setup-android-dependencies.sh 1970-01-01 00:00:00 +0000
175+++ tools/setup-android-dependencies.sh 2013-03-26 16:33:23 +0000
176@@ -0,0 +1,31 @@
177+#!/bin/bash
178+# build script for Mir on android arm devices
179+# test run requires package 'android-tools-adb'
180+# test also assumes that the device is rooted and accessible over the adb bridge
181+#
182+# todo: this script should become part of the 'make install'/'make test' system
183+#
184+
185+set -e
186+
187+pushd /tmp > /dev/null
188+ rm -f libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb
189+ rm -f libgflags2_2.0-1_armhf.deb
190+
191+ wget "https://launchpad.net/ubuntu/+archive/primary/+files/libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb"
192+ wget "https://launchpad.net/ubuntu/+archive/primary/+files/libgflags2_2.0-1_armhf.deb"
193+
194+ adb push libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb /data/ubuntu/root
195+ adb push libgflags2_2.0-1_armhf.deb /data/ubuntu/root
196+
197+ echo "ubuntu_chroot shell;
198+ cd /root;
199+ dpkg -i libgflags2_2.0-1_armhf.deb libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb
200+ apt-get install libprotobuf7 \
201+ libboost-system1.49.0 \
202+ libboost-program-options1.49.0 \
203+ libboost-thread1.49.0;
204+
205+ exit;
206+ exit" | adb shell
207+popd > /dev/null
208
209=== added file 'tools/setup-partial-armhf-chroot.sh'
210--- tools/setup-partial-armhf-chroot.sh 1970-01-01 00:00:00 +0000
211+++ tools/setup-partial-armhf-chroot.sh 2013-03-26 16:33:23 +0000
212@@ -0,0 +1,99 @@
213+#!/bin/bash
214+
215+set -e
216+
217+if [ -z $1 ]; then
218+ echo "please supply directory to create partial chroot in. (eg, ./setup-partial-armhf-chroot.sh mychroot-dir)"
219+ exit
220+fi
221+
222+echo "creating phablet-compatible quantal armhf partial chroot for mir compiles in directory ${1}"
223+
224+if [ ! -d ${1} ]; then
225+ mkdir -p ${1}
226+fi
227+
228+pushd ${1} > /dev/null
229+
230+ ARCHITECTURE=armhf
231+
232+ declare -a PACKAGES=(
233+ libboost1.49-dev
234+ libboost-chrono1.49-dev
235+ libboost-chrono1.49-dev
236+ libboost-date-time1.49-dev
237+ libboost-filesystem1.49-dev
238+ libboost-program-options1.49-dev
239+ libprotobuf-dev
240+ libboost-chrono1.49.0
241+ libboost-date-time1.49.0
242+ libboost-filesystem1.49.0
243+ libboost-system1.49.0
244+ libboost-system1.49-dev
245+ libboost-thread1.49-dev
246+ libboost-thread1.49.0
247+ libboost-regex1.49-dev
248+ libboost-regex1.49.0
249+ libboost-program-options1.49.0
250+ libhybris
251+ libhybris-dev
252+ libicu48
253+ libprotobuf7
254+ libprotobuf-dev
255+ libegl1-mesa-dev
256+ libgles2-mesa-dev
257+ zlib1g)
258+
259+ #cleanup
260+ for i in * ; do
261+ if [[ -d ${i} ]]; then
262+ echo "removing directory: ./${i}"
263+ rm -rf ./${i}
264+ fi
265+ done
266+
267+ for i in ${PACKAGES[@]}; do
268+
269+ PACKAGE_VERSION=`apt-cache show ${i}:${ARCHITECTURE} | grep Version | awk -F: '{print $NF}' | sed "s/ //g"`
270+ PACKAGE_FILENAME="${i}_${PACKAGE_VERSION}_${ARCHITECTURE}.deb"
271+
272+ if [ ! -f ${PACKAGE_FILENAME} ]; then
273+ echo "Downloading mir dependency: ${i}"
274+ apt-get download "${i}:${ARCHITECTURE}"
275+ else
276+ echo "already downloaded: ${PACKAGE_FILENAME}"
277+ fi
278+
279+ #quick sanity check
280+ if [ ! -f ${PACKAGE_FILENAME} ]; then
281+ echo "error: did not download expected file (${PACKAGE_FILENAME}. script is malformed!"; exit 1
282+ fi
283+
284+ echo "Extracting: ${PACKAGE_FILENAME}"
285+ dpkg -x ${PACKAGE_FILENAME} .
286+ done
287+
288+ #glog is only available in raring for armhf. we download the raring sources and
289+ #install them manually for this quantal script
290+ if [ ! -f libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb ]; then
291+ wget "https://launchpad.net/ubuntu/+archive/primary/+files/libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb"
292+ fi
293+
294+ if [ ! -f libgflags2_2.0-1_armhf.deb ]; then
295+ wget "https://launchpad.net/ubuntu/+archive/primary/+files/libgflags2_2.0-1_armhf.deb"
296+ fi
297+
298+ if [ ! -f libgoogle-glog-dev_0.3.2-4ubuntu1_armhf.deb ]; then
299+ wget "http://launchpadlibrarian.net/134086853/libgoogle-glog-dev_0.3.2-4ubuntu1_armhf.deb"
300+ fi
301+ dpkg -x libgflags2_2.0-1_armhf.deb .
302+ dpkg -x libgoogle-glog0_0.3.2-4ubuntu1_armhf.deb .
303+ dpkg -x libgoogle-glog-dev_0.3.2-4ubuntu1_armhf.deb .
304+
305+ #todo: we get egl/gles headers from the mesa packages, but should be pointing at the hybris libraries
306+ #just rewrite the symlinks for now
307+ rm ./usr/lib/arm-linux-gnueabihf/libEGL.so
308+ rm ./usr/lib/arm-linux-gnueabihf/libGLESv2.so
309+ ln -s libhybris-egl/libEGL.so.1 ./usr/lib/arm-linux-gnueabihf/libEGL.so
310+ ln -s libhybris-egl/libGLESv2.so.2 ./usr/lib/arm-linux-gnueabihf/libGLESv2.so
311+popd > /dev/null

Subscribers

People subscribed via source and target branches