Merge lp:~albaguirre/mir/automate-abi-check into lp:mir
- automate-abi-check
- Merge into development-branch
Status: | Merged |
---|---|
Approved by: | Alberto Aguirre |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2456 |
Proposed branch: | lp:~albaguirre/mir/automate-abi-check |
Merge into: | lp:mir |
Diff against target: |
459 lines (+183/-50) 16 files modified
cmake/ABICheck.cmake (+37/-11) debian/control (+1/-0) include/platform/mir/graphics/platform.h (+17/-14) src/include/client/mir/client_platform_factory.h (+4/-5) src/platforms/android/client/client_platform_factory.cpp (+2/-2) src/platforms/android/server/platform.cpp (+2/-2) src/platforms/common/server/symbols.map (+0/-9) src/platforms/mesa/client/client_platform_factory.cpp (+2/-2) src/platforms/mesa/server/platform.cpp (+2/-2) tests/integration-tests/graphics/mesa/test_buffer_integration.cpp (+1/-1) tests/mir_test_doubles/platform_factory.cpp (+1/-1) tests/unit-tests/graphics/android/test_platform.cpp (+1/-1) tools/abi-check-mirclient-skip-symbols (+1/-0) tools/generate-abi-base-dump.sh (+13/-0) tools/run_abi_compliance_checker.sh (+98/-0) tools/setup-partial-armhf-chroot.sh (+1/-0) |
To merge this branch: | bzr merge lp:~albaguirre/mir/automate-abi-check |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Kevin DuBois (community) | Approve | ||
Alexandros Frantzis (community) | Approve | ||
Alan Griffiths | Needs Information | ||
Review via email: mp+254947@code.launchpad.net |
Commit message
Automate abi-check
Description of the change
Automate abi-check
make abi-check now works without any additional user setup.
Setting the env variable MIR_ENABLE_
I added support to dump ABI for the client and graphic platform libraries but it currently won't check ABI since the previous release did not track these libraries.
I ran into a small issue due to mixing extern "C" with namespaces which confuses abi-compliance-
Since an extern "C" declaration will drop the namespace (e.g. there's no mir::client:
Alan Griffiths (alan-griffiths) wrote : | # |
Alberto Aguirre (albaguirre) wrote : | # |
1. Fixed.
2. It is indeed a make target - "make abi-check"
The environment variable is there to make it run as part of the default target (i.e. during a normal build).
Since CI jobs just run debian package builds, I thought it would be easier to configure a Jenkins Job to just populate an environment variable to "turn on" abi checking (for example in the CI job for mir/ubuntu)
I don't know how involved it is to configure a Jenkins job to somehow run "make abi-check".
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2434
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Kevin DuBois (kdub) wrote : | # |
> I don't know how involved it is to configure a Jenkins job to somehow run
> "make abi-check".
Perhaps "make abi-check" could be part of "make test" (so dh_auto_test would run it), or maybe we can make use of override_
Alberto Aguirre (albaguirre) wrote : | # |
> > I don't know how involved it is to configure a Jenkins job to somehow run
> > "make abi-check".
>
> Perhaps "make abi-check" could be part of "make test"
Good idea, will use add_test instead.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2435
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2443
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2446
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
343 +make -j${NUM_JOBS} abi-dump-base
This will rebuild the archive version of mir. It's not too bad since we will not be building the tests, but it still is an overhead we can avoid.
The alternative is to reuse the prebuilt archive packages. A way to do this is:
1. apt-get --print-uris --yes install libmirserver-dev libmirclient-dev ... | grep ^\' | cut -d\' -f > mir-archive.list
2. download each debian package in mir-archive.list (wget -i mir-archive.list)
3. Extract debian packages to some location (dpkg -x ... some/location)
4. MIR_ABI_
5. make abi-dump-base
Needs discussion
Alberto Aguirre (albaguirre) wrote : | # |
> 343 +make -j${NUM_JOBS} abi-dump-base
>
> This will rebuild the archive version of mir. It's not too bad since we will
> not be building the tests, but it still is an overhead we can avoid.
>
> The alternative is to reuse the prebuilt archive packages. A way to do this
> is:
>
> 1. apt-get --print-uris --yes install libmirserver-dev libmirclient-dev ... |
> grep ^\' | cut -d\' -f > mir-archive.list
> 2. download each debian package in mir-archive.list (wget -i mir-archive.list)
> 3. Extract debian packages to some location (dpkg -x ... some/location)
> 4. MIR_ABI_
> -qDEB_HOST_
> 5. make abi-dump-base
>
> Needs discussion
Yes I experimented with this a bit.
One issue is that you have to deal with the package cache - no uris will be printed if the package is already in your cache.
This shouldn't matter for a clean environment like in a CI job, but in a developer machine it could be an issue.
So a bit more intelligence is needed (figuring out the package names, some caching, looking into the existing package cache) - hence I went with the path of least resistance - apt-get source mir already downloads, caches and extracts, there's no package versions to figure out, etc.
I think it's doable but I guess I would consider that an additional optimization task that could be a separate MP.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2447
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Alexandros Frantzis (afrantzis) wrote : | # |
> I think it's doable but I guess I would consider that an additional optimization task that could be a separate MP.
OK. I think it's a task worth doing considering the processing time needed for rebuilding the archive sources with every CI (or is the plan to use it for autolanding only?).
Cemil Azizoglu (cemil-azizoglu) wrote : | # |
> > I think it's doable but I guess I would consider that an additional
> optimization task that could be a separate MP.
>
> OK. I think it's a task worth doing considering the processing time needed for
> rebuilding the archive sources with every CI (or is the plan to use it for
> autolanding only?).
I'd be in favor of autolanding only at first. So we incur minimal overhead in terms of build-time while catching before landing. We should follow up with a card for the optimization however, as some of the automation we talked about requires checker to be run for MPs as well (for instance, we want to know if ABI is broken so downstreams can be updated as well before Mir-side lands).
Kevin DuBois (kdub) wrote : | # |
lgtm, adding the card as a further improvement also sounds good.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Autolanding.
More details in the following jenkins job:
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Alberto Aguirre (albaguirre) wrote : | # |
^-Looks unrelated.
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'cmake/ABICheck.cmake' |
2 | --- cmake/ABICheck.cmake 2015-01-21 07:34:50 +0000 |
3 | +++ cmake/ABICheck.cmake 2015-04-02 15:51:41 +0000 |
4 | @@ -1,12 +1,20 @@ |
5 | cmake_minimum_required (VERSION 2.6) |
6 | |
7 | +find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker) |
8 | + |
9 | +if (NOT ABI_COMPLIANCE_CHECKER) |
10 | + message(WARNING "no ABI checks possible: abi-compliance-checker was not found") |
11 | + return() |
12 | +endif() |
13 | + |
14 | execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE) |
15 | |
16 | set(ABI_CHECK_BASE_DIR $ENV{MIR_ABI_CHECK_BASE_DIR}) |
17 | set(ABI_DUMP_PREBUILT_LIBDIR $ENV{MIR_ABI_DUMP_PREBUILT_LIBDIR}) |
18 | +set(ENABLE_ABI_CHECK_TEST $ENV{MIR_ENABLE_ABI_CHECK_TEST}) |
19 | |
20 | if ("${ABI_CHECK_BASE_DIR}" STREQUAL "") |
21 | - set(ABI_CHECK_BASE_DIR ${CMAKE_BINARY_DIR}/abi_dumps) |
22 | + set(ABI_CHECK_BASE_DIR ${CMAKE_BINARY_DIR}/mir-prev-release/obj-${ABI_CHECK_TARGET_MACH}/abi_dumps) |
23 | endif() |
24 | |
25 | set(ABI_DUMPS_DIR_PREFIX "abi_dumps/${ABI_CHECK_TARGET_MACH}") |
26 | @@ -35,9 +43,12 @@ |
27 | set(private_headers "${CMAKE_SOURCE_DIR}/src/include/${name}") |
28 | endif() |
29 | |
30 | - set(LIB_DESC_HEADERS "${CMAKE_SOURCE_DIR}/include/${name} |
31 | - ${private_headers}" |
32 | - ) |
33 | + get_value_for_arg("${ARGN}" "LIBRARY_HEADER" library_header) |
34 | + if ("${library_header}" STREQUAL "") |
35 | + set(LIB_DESC_HEADERS "${CMAKE_SOURCE_DIR}/include/${name}\n ${private_headers}") |
36 | + else() |
37 | + set(LIB_DESC_HEADERS ${library_header}) |
38 | + endif() |
39 | |
40 | if (NOT ${CMAKE_MAJOR_VERSION} LESS 3) |
41 | cmake_policy(SET CMP0026 OLD) |
42 | @@ -59,13 +70,24 @@ |
43 | configure_file(${CMAKE_SOURCE_DIR}/tools/lib_descriptor.xml.skel ${libname}_desc.xml) |
44 | endfunction() |
45 | |
46 | -#These headers are not part of the libmircommon interface |
47 | -set(android-platform-headers "${CMAKE_SOURCE_DIR}/src/include/common/mir/graphics/android") |
48 | +#These headers are not part of the libmircommon ABI |
49 | +set(mircommon-exclude-headers "${CMAKE_SOURCE_DIR}/src/include/common/mir/graphics/android\n ${CMAKE_SOURCE_DIR}/src/include/common/mir/input") |
50 | + |
51 | +#These headers are not part of the libmirplatform ABI |
52 | +set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input") |
53 | |
54 | make_lib_descriptor(client) |
55 | make_lib_descriptor(server) |
56 | -make_lib_descriptor(common INCLUDE_PRIVATE EXCLUDE_HEADERS ${android-platform-headers}) |
57 | -make_lib_descriptor(platform INCLUDE_PRIVATE) |
58 | +make_lib_descriptor(common INCLUDE_PRIVATE EXCLUDE_HEADERS ${mircommon-exclude-headers}) |
59 | +make_lib_descriptor(platform INCLUDE_PRIVATE EXCLUDE_HEADERS ${mirplatform-exclude-headers}) |
60 | +make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h) |
61 | +make_lib_descriptor(clientplatformandroid LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h) |
62 | +make_lib_descriptor(platformgraphicsmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h) |
63 | +make_lib_descriptor(platformgraphicsandroid LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h) |
64 | + |
65 | +add_custom_target(abi-release-dump |
66 | + COMMAND /bin/sh -c '${CMAKE_SOURCE_DIR}/tools/generate-abi-base-dump.sh ${CMAKE_SOURCE_DIR}' |
67 | +) |
68 | |
69 | macro(_add_custom_abi_dump_command libname version) |
70 | set(ABI_DUMP_NAME ${ABI_DUMPS_DIR_PREFIX}/${libname}_${version}.abi.tar.gz) |
71 | @@ -93,12 +115,12 @@ |
72 | set(OLD_ABI_DUMP "${ABI_CHECK_BASE_DIR}/${ABI_CHECK_TARGET_MACH}/${libname}_base.abi.tar.gz") |
73 | set(NEW_ABI_DUMP ${ABI_DUMPS_DIR_PREFIX}/${libname}_next.abi.tar.gz) |
74 | add_custom_target(abi-check-${libname} |
75 | - COMMAND abi-compliance-checker -l ${libname} -old "${OLD_ABI_DUMP}" -new "${NEW_ABI_DUMP}" -check-implementation |
76 | - DEPENDS abi-dump-${libname} |
77 | + COMMAND /bin/bash -c '${CMAKE_SOURCE_DIR}/tools/run_abi_compliance_checker.sh ${libname} ${CMAKE_BINARY_DIR}/mir-prev-release ${CMAKE_SOURCE_DIR} ${OLD_ABI_DUMP} ${NEW_ABI_DUMP}' |
78 | + DEPENDS abi-dump-${libname} abi-release-dump |
79 | ) |
80 | endmacro(_define_abi_check_for) |
81 | |
82 | -set(the_libs mirserver mirclient mircommon mirplatform) |
83 | +set(the_libs mirserver mirclient mircommon mirplatform mirclientplatformmesa mirclientplatformandroid mirplatformgraphicsmesa mirplatformgraphicsandroid) |
84 | |
85 | foreach(libname ${the_libs}) |
86 | _define_abi_dump_for(${libname}) |
87 | @@ -111,3 +133,7 @@ |
88 | add_custom_target(abi-dump DEPENDS ${abi-dump-list}) |
89 | add_custom_target(abi-dump-base DEPENDS ${abi-dump-base-list}) |
90 | add_custom_target(abi-check DEPENDS ${abi-check-list}) |
91 | + |
92 | +if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST) |
93 | + add_test(abi-compliance-check make abi-check) |
94 | +endif() |
95 | |
96 | === modified file 'debian/control' |
97 | --- debian/control 2015-03-31 02:35:42 +0000 |
98 | +++ debian/control 2015-04-02 15:51:41 +0000 |
99 | @@ -41,6 +41,7 @@ |
100 | valgrind [!arm64], |
101 | libglib2.0-dev, |
102 | libfreetype6-dev, |
103 | + abi-compliance-checker, |
104 | Standards-Version: 3.9.4 |
105 | Homepage: https://launchpad.net/mir |
106 | # If you aren't a member of ~mir-team but need to upload packaging changes, |
107 | |
108 | === modified file 'include/platform/mir/graphics/platform.h' |
109 | --- include/platform/mir/graphics/platform.h 2015-03-31 02:35:42 +0000 |
110 | +++ include/platform/mir/graphics/platform.h 2015-04-02 15:51:41 +0000 |
111 | @@ -129,10 +129,6 @@ |
112 | std::shared_ptr<options::Option> const& options, |
113 | std::shared_ptr<EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
114 | std::shared_ptr<DisplayReport> const& report); |
115 | -extern "C" std::shared_ptr<Platform> create_host_platform( |
116 | - std::shared_ptr<options::Option> const& options, |
117 | - std::shared_ptr<EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
118 | - std::shared_ptr<DisplayReport> const& report); |
119 | |
120 | /** |
121 | * Function prototype used to return a new guest graphics platform. The guest graphics platform |
122 | @@ -148,9 +144,6 @@ |
123 | extern "C" typedef std::shared_ptr<Platform>(*CreateGuestPlatform)( |
124 | std::shared_ptr<DisplayReport> const& report, |
125 | std::shared_ptr<NestedContext> const& nested_context); |
126 | -extern "C" std::shared_ptr<Platform> create_guest_platform( |
127 | - std::shared_ptr<DisplayReport> const& report, |
128 | - std::shared_ptr<NestedContext> const& nested_context); |
129 | |
130 | /** |
131 | * Function prototype used to add platform specific options to the platform-independant server options. |
132 | @@ -163,18 +156,28 @@ |
133 | */ |
134 | extern "C" typedef void(*AddPlatformOptions)( |
135 | boost::program_options::options_description& config); |
136 | -extern "C" void add_graphics_platform_options( |
137 | - boost::program_options::options_description& config); |
138 | |
139 | // TODO: We actually need to be more granular here; on a device with more |
140 | // than one graphics system we may need a different platform per GPU, |
141 | // so we should be associating platforms with graphics devices in some way |
142 | extern "C" typedef PlatformPriority(*PlatformProbe)(); |
143 | -extern "C" PlatformPriority probe_graphcis_platform(); |
144 | - |
145 | extern "C" typedef ModuleProperties const*(*DescribeModule)(); |
146 | -extern "C" ModuleProperties const* describe_graphics_module(); |
147 | -} |
148 | -} |
149 | +} |
150 | +} |
151 | + |
152 | +extern "C" std::shared_ptr<mir::graphics::Platform> create_host_platform( |
153 | + std::shared_ptr<mir::options::Option> const& options, |
154 | + std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
155 | + std::shared_ptr<mir::graphics::DisplayReport> const& report); |
156 | + |
157 | +extern "C" std::shared_ptr<mir::graphics::Platform> create_guest_platform( |
158 | + std::shared_ptr<mir::graphics::DisplayReport> const& report, |
159 | + std::shared_ptr<mir::graphics::NestedContext> const& nested_context); |
160 | + |
161 | +extern "C" void add_graphics_platform_options( |
162 | + boost::program_options::options_description& config); |
163 | + |
164 | +extern "C" mir::graphics::PlatformPriority probe_graphcis_platform(); |
165 | +extern "C" mir::ModuleProperties const* describe_graphics_module(); |
166 | |
167 | #endif // MIR_GRAPHICS_PLATFORM_H_ |
168 | |
169 | === modified file 'src/include/client/mir/client_platform_factory.h' |
170 | --- src/include/client/mir/client_platform_factory.h 2015-01-21 07:34:50 +0000 |
171 | +++ src/include/client/mir/client_platform_factory.h 2015-04-02 15:51:41 +0000 |
172 | @@ -42,12 +42,11 @@ |
173 | }; |
174 | |
175 | extern "C" typedef std::shared_ptr<ClientPlatform>(*CreateClientPlatform)(ClientContext* context); |
176 | -extern "C" std::shared_ptr<ClientPlatform> create_client_platform(ClientContext* context); |
177 | - |
178 | extern "C" typedef bool (*ClientPlatformProbe)(ClientContext* context); |
179 | -extern "C" bool is_appropriate_module(ClientContext* context); |
180 | +} |
181 | +} |
182 | |
183 | -} |
184 | -} |
185 | +extern "C" std::shared_ptr<mir::client::ClientPlatform> create_client_platform(mir::client::ClientContext* context); |
186 | +extern "C" bool is_appropriate_module(mir::client::ClientContext* context); |
187 | |
188 | #endif /* MIR_CLIENT_CLIENT_PLATFORM_FACTORY_H_ */ |
189 | |
190 | === renamed file 'src/include/common/mir/event_type_to_string.h' => 'src/include/client/mir/event_type_to_string.h' |
191 | === modified file 'src/platforms/android/client/client_platform_factory.cpp' |
192 | --- src/platforms/android/client/client_platform_factory.cpp 2015-02-02 12:18:18 +0000 |
193 | +++ src/platforms/android/client/client_platform_factory.cpp 2015-04-02 15:51:41 +0000 |
194 | @@ -28,7 +28,7 @@ |
195 | namespace mcla = mcl::android; |
196 | |
197 | extern "C" std::shared_ptr<mcl::ClientPlatform> |
198 | -mcl::create_client_platform(mcl::ClientContext* context) |
199 | +create_client_platform(mcl::ClientContext* context) |
200 | { |
201 | MirPlatformPackage platform; |
202 | context->populate_server_package(platform); |
203 | @@ -40,7 +40,7 @@ |
204 | } |
205 | |
206 | extern "C" bool |
207 | -mcl::is_appropriate_module(mcl::ClientContext* context) |
208 | +is_appropriate_module(mcl::ClientContext* context) |
209 | { |
210 | MirPlatformPackage platform; |
211 | context->populate_server_package(platform); |
212 | |
213 | === modified file 'src/platforms/android/server/platform.cpp' |
214 | --- src/platforms/android/server/platform.cpp 2015-03-31 02:35:42 +0000 |
215 | +++ src/platforms/android/server/platform.cpp 2015-04-02 15:51:41 +0000 |
216 | @@ -131,10 +131,10 @@ |
217 | return EGL_DEFAULT_DISPLAY; |
218 | } |
219 | |
220 | -extern "C" std::shared_ptr<mg::Platform> mg::create_host_platform( |
221 | +extern "C" std::shared_ptr<mg::Platform> create_host_platform( |
222 | std::shared_ptr<mo::Option> const& options, |
223 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& /*emergency_cleanup_registry*/, |
224 | - std::shared_ptr<DisplayReport> const& display_report) |
225 | + std::shared_ptr<mir::graphics::DisplayReport> const& display_report) |
226 | { |
227 | auto hwc_report = make_hwc_report(*options); |
228 | auto overlay_option = should_use_overlay_optimization(*options); |
229 | |
230 | === removed directory 'src/platforms/common/server' |
231 | === removed file 'src/platforms/common/server/symbols.map' |
232 | --- src/platforms/common/server/symbols.map 2015-03-31 02:35:42 +0000 |
233 | +++ src/platforms/common/server/symbols.map 1970-01-01 00:00:00 +0000 |
234 | @@ -1,9 +0,0 @@ |
235 | -MIR_GRAPHICS_PLATFORM_2 { |
236 | - global: |
237 | - add_graphics_platform_options; |
238 | - probe_graphics_platform; |
239 | - create_host_platform; |
240 | - create_guest_platform; |
241 | - describe_graphics_module; |
242 | - local: *; |
243 | -}; |
244 | |
245 | === modified file 'src/platforms/mesa/client/client_platform_factory.cpp' |
246 | --- src/platforms/mesa/client/client_platform_factory.cpp 2015-02-02 12:18:18 +0000 |
247 | +++ src/platforms/mesa/client/client_platform_factory.cpp 2015-04-02 15:51:41 +0000 |
248 | @@ -61,7 +61,7 @@ |
249 | |
250 | } |
251 | |
252 | -extern "C" std::shared_ptr<mcl::ClientPlatform> mcl::create_client_platform(mcl::ClientContext* context) |
253 | +extern "C" std::shared_ptr<mcl::ClientPlatform> create_client_platform(mcl::ClientContext* context) |
254 | { |
255 | MirPlatformPackage package; |
256 | context->populate_server_package(package); |
257 | @@ -75,7 +75,7 @@ |
258 | } |
259 | |
260 | extern "C" bool |
261 | -mcl::is_appropriate_module(mcl::ClientContext* context) |
262 | +is_appropriate_module(mcl::ClientContext* context) |
263 | { |
264 | MirPlatformPackage platform; |
265 | context->populate_server_package(platform); |
266 | |
267 | === modified file 'src/platforms/mesa/server/platform.cpp' |
268 | --- src/platforms/mesa/server/platform.cpp 2015-03-31 02:35:42 +0000 |
269 | +++ src/platforms/mesa/server/platform.cpp 2015-04-02 15:51:41 +0000 |
270 | @@ -165,10 +165,10 @@ |
271 | return bypass_option_; |
272 | } |
273 | |
274 | -extern "C" std::shared_ptr<mg::Platform> mg::create_host_platform( |
275 | +extern "C" std::shared_ptr<mg::Platform> create_host_platform( |
276 | std::shared_ptr<mo::Option> const& options, |
277 | std::shared_ptr<mir::EmergencyCleanupRegistry> const& emergency_cleanup_registry, |
278 | - std::shared_ptr<DisplayReport> const& report) |
279 | + std::shared_ptr<mir::graphics::DisplayReport> const& report) |
280 | { |
281 | auto real_fops = std::make_shared<RealVTFileOperations>(); |
282 | auto real_pops = std::unique_ptr<RealPosixProcessOperations>(new RealPosixProcessOperations{}); |
283 | |
284 | === modified file 'tests/integration-tests/graphics/mesa/test_buffer_integration.cpp' |
285 | --- tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2015-01-21 07:34:50 +0000 |
286 | +++ tests/integration-tests/graphics/mesa/test_buffer_integration.cpp 2015-04-02 15:51:41 +0000 |
287 | @@ -99,7 +99,7 @@ |
288 | |
289 | if (options->get<bool>("tests-use-real-graphics")) |
290 | { |
291 | - platform = mg::create_host_platform( |
292 | + platform = create_host_platform( |
293 | options, |
294 | std::make_shared<mtd::NullEmergencyCleanup>(), |
295 | mr::null_display_report()); |
296 | |
297 | === modified file 'tests/mir_test_doubles/platform_factory.cpp' |
298 | --- tests/mir_test_doubles/platform_factory.cpp 2015-01-22 09:00:14 +0000 |
299 | +++ tests/mir_test_doubles/platform_factory.cpp 2015-04-02 15:51:41 +0000 |
300 | @@ -35,7 +35,7 @@ |
301 | auto mtd::create_platform_with_null_dependencies() |
302 | -> std::shared_ptr<graphics::Platform> |
303 | { |
304 | - return graphics::create_host_platform( |
305 | + return create_host_platform( |
306 | std::make_shared<options::ProgramOption>(), |
307 | std::make_shared<NullEmergencyCleanup>(), |
308 | report::null_display_report()); |
309 | |
310 | === modified file 'tests/unit-tests/graphics/android/test_platform.cpp' |
311 | --- tests/unit-tests/graphics/android/test_platform.cpp 2015-03-31 02:35:42 +0000 |
312 | +++ tests/unit-tests/graphics/android/test_platform.cpp 2015-04-02 15:51:41 +0000 |
313 | @@ -265,5 +265,5 @@ |
314 | EXPECT_CALL(hwaccess, hw_get_module(StrEq(GRALLOC_HARDWARE_MODULE_ID), _)) |
315 | .Times(AtMost(1)); |
316 | |
317 | - auto platform = mg::create_guest_platform(mt::fake_shared(stub_report), nullptr); |
318 | + auto platform = create_guest_platform(mt::fake_shared(stub_report), nullptr); |
319 | } |
320 | |
321 | === added file 'tools/abi-check-mirclient-skip-symbols' |
322 | --- tools/abi-check-mirclient-skip-symbols 1970-01-01 00:00:00 +0000 |
323 | +++ tools/abi-check-mirclient-skip-symbols 2015-04-02 15:51:41 +0000 |
324 | @@ -0,0 +1,1 @@ |
325 | +mir_surface_set_event_handler |
326 | \ No newline at end of file |
327 | |
328 | === removed directory 'tools/abi_dumps' |
329 | === added file 'tools/generate-abi-base-dump.sh' |
330 | --- tools/generate-abi-base-dump.sh 1970-01-01 00:00:00 +0000 |
331 | +++ tools/generate-abi-base-dump.sh 2015-04-02 15:51:41 +0000 |
332 | @@ -0,0 +1,13 @@ |
333 | +#!/bin/sh |
334 | + |
335 | +NUM_JOBS=$(( $(grep -c ^processor /proc/cpuinfo) + 1 )) |
336 | + |
337 | +apt-get source mir |
338 | +MIR_RELEASE_DIR=$(find -maxdepth 1 -name mir-\* -type d) |
339 | +ln -sf ${MIR_RELEASE_DIR}/ mir-prev-release |
340 | +cd ${MIR_RELEASE_DIR} |
341 | +debian/rules override_dh_auto_configure |
342 | +cd obj-$(dpkg-architecture -qDEB_HOST_MULTIARCH) |
343 | +make -j${NUM_JOBS} abi-dump-base |
344 | + |
345 | + |
346 | |
347 | === added file 'tools/run_abi_compliance_checker.sh' |
348 | --- tools/run_abi_compliance_checker.sh 1970-01-01 00:00:00 +0000 |
349 | +++ tools/run_abi_compliance_checker.sh 2015-04-02 15:51:41 +0000 |
350 | @@ -0,0 +1,98 @@ |
351 | +#!/bin/bash |
352 | + |
353 | +declare -A abi_var_for |
354 | +abi_var_for=( ["mirclient"]="MIRCLIENT_ABI" \ |
355 | + ["mircommon"]="MIRCOMMON_ABI" \ |
356 | + ["mirplatform"]="MIRPLATFORM_ABI" \ |
357 | + ["mirprotobuf"]="MIRPROTOBUF_ABI" \ |
358 | + ["mirserver"]="MIRSERVER_ABI" \ |
359 | + ["mirclientplatformandroid"]="MIR_CLIENT_PLATFORM_ABI" \ |
360 | + ["mirclientplatformmesa"]="MIR_CLIENT_PLATFORM_ABI" \ |
361 | + ["mirplatformgraphicsandroid"]="MIR_SERVER_GRAPHICS_PLATFORM_ABI" \ |
362 | + ["mirplatformgraphicsmesa"]="MIR_SERVER_GRAPHICS_PLATFORM_ABI" ) |
363 | + |
364 | +print_help_and_exit() |
365 | +{ |
366 | + local prog=$(basename $0) |
367 | + |
368 | + local all_libs=${!abi_var_for[@]} |
369 | + local all_libs=${all_libs// /|} |
370 | + echo "Usage: $prog <libname> <old_release_dir> <new_release_dir> <old_abi_dump> <new_abi_dump>" |
371 | + echo "Runs a full ABI check if the ABI number has not been changed" |
372 | + echo "" |
373 | + echo " libname=[${all_libs}]" |
374 | + exit 0 |
375 | +} |
376 | + |
377 | +get_abi_number() |
378 | +{ |
379 | + local abi_var=${1} |
380 | + local search_dir=${2} |
381 | + grep -hR --include=CMakeLists.txt "set($abi_var [[:digit:]]\+)" ${search_dir}/src | grep -o '[[:digit:]]\+' |
382 | +} |
383 | + |
384 | +need_abi_check() |
385 | +{ |
386 | + local libname=${1} |
387 | + local old_release_dir=${2} |
388 | + local next_release_dir=${3} |
389 | + local abi_var=${abi_var_for[${libname}]} |
390 | + |
391 | + local old_abi=$(get_abi_number ${abi_var} ${old_release_dir}) |
392 | + local new_abi=$(get_abi_number ${abi_var} ${next_release_dir}) |
393 | + if [ -z "${old_abi}" ]; |
394 | + then |
395 | + old_abi=0 |
396 | + fi |
397 | + |
398 | + if [ -z "${new_abi}" ]; |
399 | + then |
400 | + echo "Failed to find new ${abi_var}" >&2 |
401 | + exit 1 |
402 | + fi |
403 | + echo "Detected ${abi_var}_new=${new_abi}" |
404 | + echo "Detected ${abi_var}_old=${old_abi}" |
405 | + |
406 | + if [ "${old_abi}" == "${new_abi}" ]; |
407 | + then |
408 | + return 0 |
409 | + else |
410 | + return 1 |
411 | + fi |
412 | +} |
413 | + |
414 | +if [ $# -ne 5 ]; |
415 | +then |
416 | + print_help_and_exit |
417 | +fi |
418 | + |
419 | +LIB_NAME=${1} |
420 | +OLD_RELEASE_DIR=${2} |
421 | +NEXT_RELEASE_DIR=${3} |
422 | +OLD_ABI_DUMP=${4} |
423 | +NEW_ABI_DUMP=${5} |
424 | + |
425 | +SKIP_SYMBOLS_FILE=${NEXT_RELEASE_DIR}/tools/abi-check-${LIB_NAME}-skip-symbols |
426 | +if [ -f ${SKIP_SYMBOLS_FILE} ]; |
427 | +then |
428 | +SKIP_SYMBOLS_OPT="-skip-symbols ${SKIP_SYMBOLS_FILE}" |
429 | +fi |
430 | + |
431 | +if need_abi_check ${LIB_NAME} ${OLD_RELEASE_DIR} ${NEXT_RELEASE_DIR}; |
432 | +then |
433 | + if [ ! -f "${OLD_ABI_DUMP}" ]; |
434 | + then |
435 | + # This does not return an error code on purpose |
436 | + # The previous release source may not have the required changes |
437 | + # to generate an ABI dump of the requested library |
438 | + # TODO: Exit with error code once the archive mir release |
439 | + # can dump ABI for all libraries of interest |
440 | + echo "Warning: No base abi dump exists for ${LIB_NAME}" |
441 | + echo "skipping abi-compliance-checker for ${LIB_NAME}" |
442 | + else |
443 | + echo "Running abi-compliance-checker for ${LIB_NAME}" |
444 | + abi-compliance-checker -l ${LIB_NAME} -old "${OLD_ABI_DUMP}" -new "${NEW_ABI_DUMP}" -check-implementation ${SKIP_SYMBOLS_OPT} |
445 | + fi |
446 | +else |
447 | + echo "No need for abi-compliance-checker, ABI has already been bumped for ${LIB_NAME}" |
448 | +fi |
449 | |
450 | === modified file 'tools/setup-partial-armhf-chroot.sh' |
451 | --- tools/setup-partial-armhf-chroot.sh 2015-01-21 07:34:50 +0000 |
452 | +++ tools/setup-partial-armhf-chroot.sh 2015-04-02 15:51:41 +0000 |
453 | @@ -39,6 +39,7 @@ |
454 | builddeps=$(echo ${builddeps} | sed -e 's/dpkg-checkbuilddeps://g' -e 's/Unmet build dependencies://g' -e 's/build-essential:native//g') |
455 | builddeps=$(echo ${builddeps} | sed 's/([^)]*)//g') |
456 | builddeps=$(echo ${builddeps} | sed 's/ /,/g') |
457 | +builddeps=$(echo ${builddeps} | sed -e 's/abi-compliance-checker//g') |
458 | |
459 | fakeroot debootstrap --include=${builddeps} --arch=armhf --download-only --variant=buildd vivid . |
460 |
1. This adds a build dependency on abi-compliance- checker - shouldn't we put that in debian/control?
2. Why "Setting the env variable MIR_RUN_ ABI_CHECK_ DURING_ BUILD"? I'd expected a target. E.g. "make abi-compliance- check".