Merge lp:~thomas-voss/location-service/fix-zesty-ftbfs into lp:location-service

Proposed by Thomas Voß
Status: Merged
Approved by: Thomas Voß
Approved revision: 298
Merged at revision: 298
Proposed branch: lp:~thomas-voss/location-service/fix-zesty-ftbfs
Merge into: lp:location-service
Diff against target: 151 lines (+17/-11)
10 files modified
debian/control (+1/-0)
debian/control.in (+1/-0)
snapcraft.yaml (+2/-0)
src/location/providers/fusion/provider.h (+2/-0)
src/location/providers/gps/android_hardware_abstraction_layer.cpp (+1/-0)
src/location/providers/gps/android_hardware_abstraction_layer.h (+2/-0)
src/location/providers/gps/sntp_client.cpp (+1/-0)
src/location/providers/proxy.h (+1/-0)
src/location/providers/ubx/_8/assist_now_online_client.cpp (+2/-0)
tests/CMakeLists.txt (+4/-11)
To merge this branch: bzr merge lp:~thomas-voss/location-service/fix-zesty-ftbfs
Reviewer Review Type Date Requested Status
Thomas Voß Approve
Review via email: mp+321479@code.launchpad.net

Commit message

Fix location-service FTBFS on zesty, mainly tracked on LP: #1640320

There are 2 compound causes for the FTBFS:
1. googletest update that caused cmake errors
2. missing vector includes that caused undefined reference errors

== googletest update issues ==
The googletest updated error is better described on LP: #1644062. The same fix applied to cmake-extras [1] (see comment #3 [2]) allows to detect and set the right paths for gtest and gmock, but then it runs into the same problem as comment #7 [3] which again causes the build to fail because dh_install complains about the extra files installed by googletest. This issue is better described by the commit that introduced the googletest install clause [4] and the comments there indicate that bundling googletest is not recomended - it should instead be added as an external project. This is exactly the approach taken by GMockConfig.make [5] file in cmake-extras does. The proposed solution for the first part of the FTBFS fix is to rely on that to properly reference and include both gtest and gmock.

== missing vector includes ==
The missing includes for vector causes yet another FTBFS. The includes used in this merge are simple a suggestion, I'm not familiar with location-service code so it is very likely that there is a better place to put those (or even use a different include).

[1] https://code.launchpad.net/~michihenning/cmake-extras/gtest-fixes/+merge/311565
[2] https://bugs.launchpad.net/ubuntu/+source/googletest/+bug/1644062/comments/3
[3] https://bugs.launchpad.net/ubuntu/+source/googletest/+bug/1644062/comments/7
[4] https://github.com/google/googletest/commit/98d988deac06637364f6cd41c45c3db4a8a0b6bc
[5] http://bazaar.launchpad.net/~cmake-extras/cmake-extras/trunk/view/head:/src/GMock/GMockConfig.cmake

Description of the change

Fix location-service FTBFS on zesty, mainly tracked on LP: #1640320

There are 2 compound causes for the FTBFS:
1. googletest update that caused cmake errors
2. missing vector includes that caused undefined reference errors

== googletest update issues ==
The googletest updated error is better described on LP: #1644062. The same fix applied to cmake-extras [1] (see comment #3 [2]) allows to detect and set the right paths for gtest and gmock, but then it runs into the same problem as comment #7 [3] which again causes the build to fail because dh_install complains about the extra files installed by googletest. This issue is better described by the commit that introduced the googletest install clause [4] and the comments there indicate that bundling googletest is not recomended - it should instead be added as an external project. This is exactly the approach taken by GMockConfig.make [5] file in cmake-extras does. The proposed solution for the first part of the FTBFS fix is to rely on that to properly reference and include both gtest and gmock.

== missing vector includes ==
The missing includes for vector causes yet another FTBFS. The includes used in this merge are simple a suggestion, I'm not familiar with location-service code so it is very likely that there is a better place to put those (or even use a different include).

[1] https://code.launchpad.net/~michihenning/cmake-extras/gtest-fixes/+merge/311565
[2] https://bugs.launchpad.net/ubuntu/+source/googletest/+bug/1644062/comments/3
[3] https://bugs.launchpad.net/ubuntu/+source/googletest/+bug/1644062/comments/7
[4] https://github.com/google/googletest/commit/98d988deac06637364f6cd41c45c3db4a8a0b6bc
[5] http://bazaar.launchpad.net/~cmake-extras/cmake-extras/trunk/view/head:/src/GMock/GMockConfig.cmake

To post a comment you must log in.
Revision history for this message
Thomas Voß (thomas-voss) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2017-03-07 10:01:34 +0000
3+++ debian/control 2017-03-30 18:31:14 +0000
4@@ -9,6 +9,7 @@
5 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
6 XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>
7 Build-Depends: cmake,
8+ cmake-extras,
9 curl,
10 libdbus-cpp-dev (>= 4.1.0),
11 debhelper (>= 9),
12
13=== modified file 'debian/control.in'
14--- debian/control.in 2017-03-07 10:01:34 +0000
15+++ debian/control.in 2017-03-30 18:31:14 +0000
16@@ -4,6 +4,7 @@
17 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
18 XSBC-Original-Maintainer: Thomas Voß <thomas.voss@canonical.com>
19 Build-Depends: cmake,
20+ cmake-extras,
21 curl,
22 libdbus-cpp-dev (>= 4.1.0),
23 debhelper (>= 9),
24
25=== modified file 'snapcraft.yaml'
26--- snapcraft.yaml 2017-03-24 21:13:53 +0000
27+++ snapcraft.yaml 2017-03-30 18:31:14 +0000
28@@ -53,6 +53,8 @@
29 - -DUBUNTU_LOCATION_SERVICE_VERSION_MAJOR=4
30 source: .
31 build-packages:
32+ - cmake
33+ - cmake-extras
34 - curl
35 - doxygen
36 - gcc
37
38=== modified file 'src/location/providers/fusion/provider.h'
39--- src/location/providers/fusion/provider.h 2016-08-18 14:56:31 +0000
40+++ src/location/providers/fusion/provider.h 2017-03-30 18:31:14 +0000
41@@ -21,6 +21,8 @@
42 #include <location/provider.h>
43 #include <location/providers/fusion/update_selector.h>
44
45+#include <vector>
46+
47 namespace location
48 {
49 namespace providers
50
51=== modified file 'src/location/providers/gps/android_hardware_abstraction_layer.cpp'
52--- src/location/providers/gps/android_hardware_abstraction_layer.cpp 2016-08-24 14:12:05 +0000
53+++ src/location/providers/gps/android_hardware_abstraction_layer.cpp 2017-03-30 18:31:14 +0000
54@@ -30,6 +30,7 @@
55 #include <boost/property_tree/ini_parser.hpp>
56
57 #include <random>
58+#include <vector>
59
60 namespace gps = location::providers::gps;
61 namespace android = location::providers::gps::android;
62
63=== modified file 'src/location/providers/gps/android_hardware_abstraction_layer.h'
64--- src/location/providers/gps/android_hardware_abstraction_layer.h 2016-08-18 14:56:31 +0000
65+++ src/location/providers/gps/android_hardware_abstraction_layer.h 2017-03-30 18:31:14 +0000
66@@ -23,6 +23,8 @@
67
68 #include <ubuntu/hardware/gps.h>
69
70+#include <vector>
71+
72 namespace location { namespace providers { namespace gps
73 {
74 namespace android
75
76=== modified file 'src/location/providers/gps/sntp_client.cpp'
77--- src/location/providers/gps/sntp_client.cpp 2016-06-26 21:17:03 +0000
78+++ src/location/providers/gps/sntp_client.cpp 2017-03-30 18:31:14 +0000
79@@ -28,6 +28,7 @@
80 #include <future>
81 #include <iostream>
82 #include <thread>
83+#include <vector>
84
85 namespace gps = location::providers::gps;
86 namespace ip = boost::asio::ip;
87
88=== modified file 'src/location/providers/proxy.h'
89--- src/location/providers/proxy.h 2016-08-18 14:56:31 +0000
90+++ src/location/providers/proxy.h 2017-03-30 18:31:14 +0000
91@@ -21,6 +21,7 @@
92 #include <location/provider.h>
93
94 #include <set>
95+#include <vector>
96
97 namespace location
98 {
99
100=== modified file 'src/location/providers/ubx/_8/assist_now_online_client.cpp'
101--- src/location/providers/ubx/_8/assist_now_online_client.cpp 2017-03-24 21:13:53 +0000
102+++ src/location/providers/ubx/_8/assist_now_online_client.cpp 2017-03-30 18:31:14 +0000
103@@ -18,6 +18,8 @@
104 #include <core/net/uri.h>
105 #include <core/net/http/response.h>
106
107+#include <boost/format.hpp>
108+
109 #include <iostream>
110
111 namespace _8 = location::providers::ubx::_8;
112
113=== modified file 'tests/CMakeLists.txt'
114--- tests/CMakeLists.txt 2017-03-07 10:01:34 +0000
115+++ tests/CMakeLists.txt 2017-03-30 18:31:14 +0000
116@@ -21,11 +21,7 @@
117 PROPERTIES COMPILE_FLAGS "-std=c99")
118
119 # Build with system gmock and embedded gtest
120-set (GMOCK_INCLUDE_DIR "/usr/include/gmock/include" CACHE PATH "gmock source include directory")
121-set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory")
122-set (GTEST_INCLUDE_DIR "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory")
123-
124-add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock")
125+find_package(GMock)
126
127 macro(LOCATION_SERVICE_ADD_TEST test_name src)
128 add_executable(
129@@ -47,10 +43,8 @@
130
131 ${ARGN}
132
133- gmock
134-
135- gtest
136- gtest_main)
137+ ${GMOCK_LIBRARIES}
138+ ${GTEST_BOTH_LIBRARIES})
139
140 add_test(${test_name} ${CMAKE_CURRENT_BINARY_DIR}/${test_name} --gtest_filter=*-*requires*)
141
142@@ -106,8 +100,7 @@
143 ${Boost_LIBRARIES}
144 ${PROCESS_CPP_LIBRARIES}
145
146- gtest
147- gtest_main
148+ ${GTEST_BOTH_LIBRARIES}
149 )
150 if (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER)
151 add_test(geoclue_provider_test ${DBUS_TEST_RUNNER_EXECUTABLE} --task=${CMAKE_CURRENT_BINARY_DIR}/geoclue_provider_test)

Subscribers

People subscribed via source and target branches

to all changes: