Mir

Merge lp:~alan-griffiths/mir/0.28.1-to-ubuntu into lp:mir/ubuntu

Proposed by Alan Griffiths
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 1308
Proposed branch: lp:~alan-griffiths/mir/0.28.1-to-ubuntu
Merge into: lp:mir/ubuntu
Diff against target: 2619 lines (+704/-854)
58 files modified
CMakeLists.txt (+16/-5)
benchmarks/frame-uniformity/CMakeLists.txt (+0/-6)
cmake/ABICheck.cmake (+0/-114)
cmake/FindGtestGmock.cmake (+55/-91)
debian/changelog (+29/-0)
debian/control (+0/-2)
doc/abi_compatibility_tools.md (+0/-26)
doc/getting_and_using_mir.md (+4/-1)
doc/getting_involved_in_mir.md (+32/-17)
examples/CMakeLists.txt (+93/-180)
examples/miral-kiosk/CMakeLists.txt (+5/-0)
examples/miral-shell/miral-app.sh (+8/-2)
examples/miral-shell/miral-desktop.sh (+8/-2)
examples/miral-shell/miral-run.sh (+12/-1)
examples/miral-shell/miral-xrun.sh (+8/-3)
examples/miral-shell/shell_main.cpp (+1/-1)
examples/miral-shell/spinner/eglspinner.cpp (+17/-2)
examples/miral-shell/titlebar_config.cpp (+19/-1)
include/core/mir/optional_value.h (+5/-0)
include/server/mir/server_action_queue.h (+10/-0)
include/server/mir/shell/persistent_surface_store.h (+1/-1)
src/CMakeLists.txt (+2/-1)
src/capnproto/CMakeLists.txt (+6/-1)
src/include/server/mir/glib_main_loop.h (+5/-0)
src/miral/CMakeLists.txt (+12/-7)
src/miral/runner.cpp (+2/-2)
src/platforms/eglstream-kms/server/display.cpp (+0/-1)
src/platforms/eglstream-kms/server/egl_output.cpp (+1/-1)
src/platforms/mesa/server/buffer_allocator.cpp (+2/-3)
src/platforms/mesa/server/kms/cursor.cpp (+0/-1)
src/platforms/mesa/server/kms/display_buffer.cpp (+4/-6)
src/protobuf/symbols.map (+24/-0)
src/server/CMakeLists.txt (+7/-0)
src/server/frontend/wayland/wayland_connector.cpp (+130/-18)
src/server/frontend/wayland/wayland_connector.h (+5/-1)
src/server/frontend/wayland/wayland_default_configuration.cpp (+1/-0)
src/server/glib_main_loop.cpp (+55/-1)
src/server/input/default_input_device_hub.cpp (+8/-7)
src/server/shell/default_persistent_surface_store.cpp (+1/-1)
src/utils/CMakeLists.txt (+2/-0)
src/utils/run.cpp (+1/-1)
tests/CMakeLists.txt (+2/-1)
tests/include/mir/test/doubles/triggered_main_loop.h (+1/-0)
tests/integration-tests/CMakeLists.txt (+1/-2)
tests/mir_test_doubles/CMakeLists.txt (+2/-2)
tests/mir_test_doubles/triggered_main_loop.cpp (+6/-0)
tests/mir_test_framework/CMakeLists.txt (+2/-2)
tests/mir_test_framework/canonical_window_manager.cpp (+1/-1)
tests/miral/drag_and_drop.cpp (+1/-1)
tests/performance-tests/CMakeLists.txt (+1/-1)
tests/unit-tests/CMakeLists.txt (+2/-4)
tests/unit-tests/platforms/mesa/kms/test_cursor.cpp (+6/-7)
tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp (+1/-1)
tests/unit-tests/scene/test_mediating_display_changer.cpp (+6/-0)
tests/unit-tests/test_glib_main_loop.cpp (+70/-0)
tests/unit-tests/test_raii.cpp (+2/-0)
tools/abi_check.sh (+0/-315)
tools/setup-partial-armhf-chroot.sh (+9/-10)
To merge this branch: bzr merge lp:~alan-griffiths/mir/0.28.1-to-ubuntu
Reviewer Review Type Date Requested Status
Alan Griffiths Abstain
Mir CI Bot continuous-integration Approve
Review via email: mp+332861@code.launchpad.net

Commit message

Mir 0.28.1 release to ubuntu

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:1308
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/132/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/5179/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5416/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5403/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5403/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5403/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5222/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5222/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/132/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:1309
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/133/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5180
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5417
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5404
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5404
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5404
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5223/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5223
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5223/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/133/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The (build-time) code that locates the miral-shell titlebar font fails to find any font on the build machine (as it doesn't have desktop options installed).

review: Needs Fixing
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:1310
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/134/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5181
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5418
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5405
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5405
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5405
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5224/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5224
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5224/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/134/rebuild

review: Approve (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:1311
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/135/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/5184
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5421
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5408
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5408
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5408
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=artful/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=artful/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=artful/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=mesa,release=zesty/5227/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5227
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/5227/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ubuntu-ci/135/rebuild

review: Approve (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> The (build-time) code that locates the miral-shell titlebar font fails to find
> any font on the build machine (as it doesn't have desktop options installed).

Sorted

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

I'm still seeing bug 1720223 on the mesa-drm platform

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

> I'm still seeing bug 1720223 on the mesa-drm platform

Actually, that was bug 1728574

But still voting "needs fixing" as the following test is failing on artful:

Mir-on-Mir

    Use an X11 based desktop (Unity, Gnome, etc.). These tests run for a default 10 seconds.
    Start two terminal sessions, one for a "host" server, one to launch the tests.

        Start a "host" server: $ mir_demo_server --window-manager system-compositor
    Test that S/W rendering clients run and can be moved(resized) with Alt+Left(Middle)-Button:

...

        $ mir_demo_server --no-file --host $XDG_RUNTIME_DIR/mir_socket --test-timeout 10 --test-client mir_demo_client_egltriangle

When resizing the triangle, the nested server crashes. (Doesn't happen with the same code built for Zesty.)

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

> > I'm still seeing bug 1720223 on the mesa-drm platform
>
> Actually, that was bug 1728574
>
> But still voting "needs fixing" as the following test is failing on artful:
>
> Mir-on-Mir
>
> Use an X11 based desktop (Unity, Gnome, etc.). These tests run for a
> default 10 seconds.
> Start two terminal sessions, one for a "host" server, one to launch the
> tests.
>
> Start a "host" server: $ mir_demo_server --window-manager system-
> compositor
> Test that S/W rendering clients run and can be moved(resized) with
> Alt+Left(Middle)-Button:
>
> ...
>
> $ mir_demo_server --no-file --host $XDG_RUNTIME_DIR/mir_socket --test-
> timeout 10 --test-client mir_demo_client_egltriangle
>
> When resizing the triangle, the nested server crashes. (Doesn't happen with
> the same code built for Zesty.)

Mmm, this happens with 0.28.0 too.

What was different when testing 0.20.0? It was shortly before the Artful releasee and my laptop had been upgraded to Artful (and had U7 installed). Since then Artful has been released and re-installed on the laptop from an ISO image.

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

> Mmm, this happens with 0.28.0 too.

Logged as bug 1728613

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-10-11 15:00:09 +0000
+++ CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -1,4 +1,4 @@
1# Copyright © 2012 Canonical Ltd.1# Copyright © 2012-2017 Canonical Ltd.
2#2#
3# This program is free software: you can redistribute it and/or modify3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU General Public License version 2 or 3 as4# it under the terms of the GNU General Public License version 2 or 3 as
@@ -29,7 +29,7 @@
2929
30set(MIR_VERSION_MAJOR 0)30set(MIR_VERSION_MAJOR 0)
31set(MIR_VERSION_MINOR 28)31set(MIR_VERSION_MINOR 28)
32set(MIR_VERSION_PATCH 0)32set(MIR_VERSION_PATCH 1)
3333
34add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})34add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
35add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})35add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
@@ -275,6 +275,16 @@
275 pkg_check_modules(DRM REQUIRED libdrm)275 pkg_check_modules(DRM REQUIRED libdrm)
276endif()276endif()
277277
278# This incantation gets the MIR_EGL_SUPPORTED default right for Mesa
279execute_process(COMMAND grep mir_toolkit /usr/include/EGL/eglplatform.h
280 OUTPUT_VARIABLE MIR_EGL_SUPPORTED_OUT)
281
282if (MIR_EGL_SUPPORTED_OUT STREQUAL "")
283 option(MIR_EGL_SUPPORTED "Build examples that depend on Mir EGL." OFF)
284else()
285 option(MIR_EGL_SUPPORTED "Build examples that depend on Mir EGL." ON)
286endif()
287
278set(MIR_TRACEPOINT_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/mir/tools)288set(MIR_TRACEPOINT_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/mir/tools)
279289
280set(MIR_GENERATED_INCLUDE_DIRECTORIES)290set(MIR_GENERATED_INCLUDE_DIRECTORIES)
@@ -288,9 +298,10 @@
288 add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1)298 add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1)
289endif ()299endif ()
290300
291add_subdirectory(benchmarks/)
292add_subdirectory(examples/)301add_subdirectory(examples/)
293add_subdirectory(playground/)302if (MIR_EGL_SUPPORTED)
303 add_subdirectory(playground/)
304endif()
294add_subdirectory(guides/)305add_subdirectory(guides/)
295add_subdirectory(cmake/)306add_subdirectory(cmake/)
296307
@@ -299,6 +310,7 @@
299 pkg_check_modules(LIBEVDEV REQUIRED libevdev)310 pkg_check_modules(LIBEVDEV REQUIRED libevdev)
300 include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})311 include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
301 add_subdirectory(tests/)312 add_subdirectory(tests/)
313 add_subdirectory(benchmarks/)
302314
303 # There's no nice way to format this. Thanks CMake.315 # There's no nice way to format this. Thanks CMake.
304 mir_add_test(NAME LGPL-required316 mir_add_test(NAME LGPL-required
@@ -313,7 +325,6 @@
313endif ()325endif ()
314326
315enable_coverage_report(mirserver)327enable_coverage_report(mirserver)
316include (cmake/ABICheck.cmake)
317328
318add_custom_target(ptest329add_custom_target(ptest
319 COMMAND "${CMAKE_SOURCE_DIR}/tools/run_ctests.sh" "--cost-file" "${CMAKE_BINARY_DIR}/ptest_ctest_cost_data.txt" "sh ${CMAKE_BINARY_DIR}/discover_all_tests.sh" "--" "$$ARGS"330 COMMAND "${CMAKE_SOURCE_DIR}/tools/run_ctests.sh" "--cost-file" "${CMAKE_BINARY_DIR}/ptest_ctest_cost_data.txt" "sh ${CMAKE_BINARY_DIR}/discover_all_tests.sh" "--" "$$ARGS"
320331
=== modified file 'benchmarks/frame-uniformity/CMakeLists.txt'
--- benchmarks/frame-uniformity/CMakeLists.txt 2017-08-25 06:41:20 +0000
+++ benchmarks/frame-uniformity/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -28,8 +28,6 @@
28 mirserver28 mirserver
29 mirclient29 mirclient
30 mirplatform30 mirplatform
31
32 mir-test-assist
3331
34 # needed for fake_event_hub_server_configuration.h (which relies on private APIs)32 # needed for fake_event_hub_server_configuration.h (which relies on private APIs)
35 mir-test-framework-static33 mir-test-framework-static
@@ -37,9 +35,5 @@
37 # needed for vsync_simulating_graphics_platform.cpp35 # needed for vsync_simulating_graphics_platform.cpp
38 mir-test-doubles-static36 mir-test-doubles-static
3937
40 ${Boost_LIBRARIES}
41 ${GTEST_BOTH_LIBRARIES}
42 ${GMOCK_LIBRARY}
43 ${GMOCK_MAIN_LIBRARY}
44 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.38 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
45)39)
4640
=== removed file 'cmake/ABICheck.cmake'
--- cmake/ABICheck.cmake 2017-05-08 03:04:26 +0000
+++ cmake/ABICheck.cmake 1970-01-01 00:00:00 +0000
@@ -1,114 +0,0 @@
1cmake_minimum_required (VERSION 2.6)
2
3find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker)
4if (NOT ABI_COMPLIANCE_CHECKER)
5 message(WARNING "no ABI checks possible: abi-compliance-checker was not found")
6 return()
7endif()
8
9set(ENABLE_ABI_CHECK_TEST $ENV{MIR_ENABLE_ABI_CHECK_TEST})
10execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE)
11
12set(ABI_DUMPS_DIR "${CMAKE_BINARY_DIR}/abi_dumps/${ABI_CHECK_TARGET_MACH}")
13
14# Given a list of key value pairs such as "key1 value1 key2 value2...keyN valueN"
15# extract the value corresponding to the given key
16function(get_value_for_key a_list key value)
17 list(FIND a_list ${key} idx)
18 if (idx GREATER -1)
19 math(EXPR idx "${idx} + 1")
20 list(GET a_list ${idx} tmp_value)
21 set(${value} "${tmp_value}" PARENT_SCOPE)
22 endif()
23endfunction()
24
25# Makes a one-entry per line list of all include paths used
26# to compile the given library target
27function(get_includes libname output)
28 get_property(lib_includes TARGET ${libname} PROPERTY INCLUDE_DIRECTORIES)
29 list(REMOVE_DUPLICATES lib_includes)
30 string(REPLACE ";" "\n " tmp_out "${lib_includes}")
31 set(${output} "${tmp_out}" PARENT_SCOPE)
32endfunction()
33
34# Creates the XML descriptor file that describes the given library target
35# suitable for abi-compliance-checker
36function(make_lib_descriptor name)
37 set(libname "mir${name}")
38
39 # Optional argument LIBRARY_HEADER - use the given header to describe
40 # the binary library instead of assuming its described by include/<name>
41 get_value_for_key("${ARGN}" "LIBRARY_HEADER" library_header)
42 if ("${library_header}" STREQUAL "")
43 set(LIB_DESC_HEADERS "${CMAKE_SOURCE_DIR}/include/${name}\n ${private_headers}")
44 else()
45 set(LIB_DESC_HEADERS ${library_header})
46 endif()
47
48 # FIXME: Property "LOCATION" is now deprecated
49 if (NOT ${CMAKE_MAJOR_VERSION} LESS 3)
50 cmake_policy(SET CMP0026 OLD)
51 endif()
52 get_property(LIB_DESC_LIBS TARGET ${libname} PROPERTY LOCATION)
53
54 get_includes(${libname} LIB_DESC_INCLUDE_PATHS)
55 set(LIB_DESC_GCC_OPTS "${CMAKE_CXX_FLAGS}")
56
57 # Optional EXCLUDE_HEADERS - a list
58 # while attempting an abi dump
59 get_value_for_key("${ARGN}" "EXCLUDE_HEADERS" LIB_DESC_SKIP_HEADERS)
60
61 configure_file(${CMAKE_SOURCE_DIR}/tools/lib_descriptor.xml.skel ${libname}_desc.xml)
62endfunction()
63
64#These headers are not part of the libmirplatform ABI
65set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input")
66
67make_lib_descriptor(core)
68make_lib_descriptor(client)
69make_lib_descriptor(server)
70make_lib_descriptor(common)
71make_lib_descriptor(cookie)
72make_lib_descriptor(platform EXCLUDE_HEADERS ${mirplatform-exclude-headers})
73if(MIR_BUILD_PLATFORM_MESA_KMS)
74make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h)
75make_lib_descriptor(platformgraphicsmesakms LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h)
76endif()
77make_lib_descriptor(platforminputevdev LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/input/)
78
79
80macro(_define_abi_dump_for libname)
81 set(ABI_DUMP_NAME ${ABI_DUMPS_DIR}/${libname}_next.abi.tar.gz)
82
83 add_custom_command(OUTPUT ${ABI_DUMP_NAME}
84 COMMAND abi-compliance-checker -gcc-path ${CMAKE_CXX_COMPILER} -l ${libname} -v1 next -dump-path ${ABI_DUMP_NAME} -dump-abi ${libname}_desc.xml
85 DEPENDS ${libname}
86 )
87 add_custom_target(abi-dump-${libname} DEPENDS ${ABI_DUMP_NAME})
88endmacro(_define_abi_dump_for)
89
90macro(_define_abi_check_for libname)
91 add_custom_target(abi-check-${libname}
92 COMMAND /bin/bash -c '${CMAKE_SOURCE_DIR}/tools/abi_check.sh ${libname} ${ABI_DUMPS_DIR} ${CMAKE_SOURCE_DIR}'
93 DEPENDS abi-dump-${libname}
94 )
95endmacro(_define_abi_check_for)
96
97set(the_libs mircore mirserver mirclient mircommon mirplatform mircookie mirplatforminputevdev)
98if(MIR_BUILD_PLATFORM_MESA_KMS)
99 set(the_libs ${the_libs} mirclientplatformmesa mirplatformgraphicsmesakms)
100endif()
101
102foreach(libname ${the_libs})
103 _define_abi_dump_for(${libname})
104 _define_abi_check_for(${libname})
105 list(APPEND abi-dump-list abi-dump-${libname})
106 list(APPEND abi-check-list abi-check-${libname})
107endforeach(libname)
108
109add_custom_target(abi-dump DEPENDS ${abi-dump-list})
110add_custom_target(abi-check DEPENDS ${abi-check-list})
111
112if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST)
113 add_test(abi-compliance-check make abi-check)
114endif()
1150
=== modified file 'cmake/FindGtestGmock.cmake'
--- cmake/FindGtestGmock.cmake 2017-09-07 05:58:13 +0000
+++ cmake/FindGtestGmock.cmake 2017-10-27 17:26:09 +0000
@@ -1,96 +1,60 @@
1include(ExternalProject)
2include(FindPackageHandleStandardArgs)1include(FindPackageHandleStandardArgs)
32
4#3find_package(GTest)
5# When cross compiling MIR_CHROOT points to our chroot.4
6# When not cross compiling, it should be blank to use the host system.5if (NOT GTEST_FOUND)
7#6 include(ExternalProject)
8set(usr ${MIR_CHROOT}/usr)7
98 find_path(GTEST_ROOT
10if (EXISTS ${usr}/src/googletest)9 NAMES CMakeLists.txt
11 set (USING_GOOGLETEST_1_8 TRUE)10 PATHS /usr/src/gtest /usr/src/googletest/googletest/
12 set (GTEST_INSTALL_DIR ${usr}/src/googletest/googletest/include)11 DOC "Path to GTest CMake project")
13else()12
14 set (GTEST_INSTALL_DIR ${usr}/src/gmock/gtest/include)13 ExternalProject_Add(GTest PREFIX ./gtest
15endif()14 SOURCE_DIR ${GTEST_ROOT}
1615 CMAKE_ARGS
17#gtest16 -DCMAKE_CXX_COMPILER_WORKS=1
18find_path(17 -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'
19 GTEST_INCLUDE_DIR gtest/gtest.h18 -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
20 HINTS ${GTEST_INSTALL_DIR}19 INSTALL_COMMAND true)
21)20
2221 ExternalProject_Get_Property(GTest binary_dir)
23#gmock22
24find_path(23 add_library(gtest UNKNOWN IMPORTED)
25 GMOCK_INSTALL_DIR CMakeLists.txt24 set_target_properties(gtest PROPERTIES IMPORTED_LOCATION ${binary_dir}/libgtest.a)
26 HINTS ${usr}/src/googletest ${usr}/src/gmock)25 add_dependencies(gtest GTest)
27if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")26 set(GTEST_LIBRARY "gtest")
28 message(FATAL_ERROR "google-mock package not found")27
29endif()28 add_library(gtest_main UNKNOWN IMPORTED)
29 set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION ${binary_dir}/libgtest_main.a)
30 add_dependencies(gtest_main GTest)
31 set(GTEST_MAIN_LIBRARY "gtest_main")
32
33 set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
34 find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h)
35 find_package_handle_standard_args(GTest GTEST_LIBRARY GTEST_BOTH_LIBRARIES GTEST_INCLUDE_DIRS)
36endif()
37
38find_file(GMOCK_SOURCE
39 NAMES gmock-all.cc
40 DOC "GMock source"
41 PATHS /usr/src/googletest/googlemock/src/ /usr/src/gmock/ /usr/src/gmock/src)
42
43message(STATUS "GMOCK_SOURCE=${GMOCK_SOURCE}")
3044
31find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)45find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
3246
33if (USING_GOOGLETEST_1_8)47add_library(GMock STATIC ${GMOCK_SOURCE})
34 set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)48
35 set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR}/googlemock)49if (EXISTS /usr/src/googletest/googlemock/src)
36 set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)50 set_source_files_properties(${GMOCK_SOURCE} PROPERTIES COMPILE_FLAGS "-I/usr/src/googletest/googlemock")
37else()51endif()
38 set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)52
39 set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR})53if (EXISTS /usr/src/gmock/src)
40 set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)54 set_source_files_properties(${GMOCK_SOURCE} PROPERTIES COMPILE_FLAGS "-I/usr/src/gmock")
41endif()55endif()
4256
43set(GTEST_CXX_FLAGS "-fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")57find_package_handle_standard_args(GMock DEFAULT_MSG GMOCK_INCLUDE_DIR)
44if (cmake_build_type_lower MATCHES "threadsanitizer")58
45 set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread")59set(GMOCK_LIBRARY GMock)
46elseif (cmake_build_type_lower MATCHES "ubsanitizer")60set(GMOCK_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARY})
47 set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=undefined")
48endif()
49
50set(GTEST_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS}")
51list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
52list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
53
54if (USING_GOOGLETEST_1_8)
55 list(APPEND GTEST_CMAKE_ARGS -DBUILD_GTEST=ON)
56endif()
57
58if (cmake_build_type_lower MATCHES "threadsanitizer")
59 #Skip compiler check, since if GCC is the compiler, we need to link against -ltsan
60 #explicitly; specifying additional linker flags doesn't seem possible for external projects
61 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER_WORKS=1)
62endif()
63if (${CMAKE_CROSSCOMPILING})
64 if(DEFINED MIR_CHROOT)
65 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
66 else()
67 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
68 list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
69 endif()
70endif()
71
72ExternalProject_Add(
73 GMock
74 #where to build in source tree
75 PREFIX ${GMOCK_PREFIX}
76 #where the source is external to the project
77 SOURCE_DIR ${GMOCK_INSTALL_DIR}
78 #forward the compilers to the subproject so cross-arch builds work
79 CMAKE_ARGS ${GTEST_CMAKE_ARGS}
80 BINARY_DIR ${GMOCK_BASE_BINARY_DIR}
81
82 #we don't need to install, so skip
83 INSTALL_COMMAND ""
84)
85
86set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
87set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
88set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
89set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
90set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
91set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
92set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
93
94find_package_handle_standard_args(GTest DEFAULT_MSG
95 GMOCK_INCLUDE_DIR
96 GTEST_INCLUDE_DIR)
9761
=== modified file 'debian/changelog'
--- debian/changelog 2017-10-11 15:06:23 +0000
+++ debian/changelog 2017-10-27 17:26:09 +0000
@@ -1,3 +1,32 @@
1mir (0.28.1) UNRELEASED; urgency=medium
2
3 * New upstream release 0.28.1(https://launchpad.net/mir/+milestone/0.28.1)
4 - ABI summary:
5 . mirclient ABI unchanged at 9
6 . miral ABI unchanged at 2
7 . mirserver ABI unchanged to 45
8 . mircommon ABI unchanged at 7
9 . mirplatform ABI unchanged at 61
10 . mirprotobuf ABI unchanged at 3
11 . mirplatformgraphics ABI unchanged at 13
12 . mirclientplatform ABI unchanged at 5
13 . mirinputplatform ABI unchanged at 7
14 . mircore ABI unchanged at 1
15 - Enhancements:
16 . Fix build (and add instructions) for Fedora
17 . Wayland support for keymaps
18 . Don't use Mir EGL if it isn't available.
19 . [miral-app, miral-desktop] Default to using SDL's Wayland support.
20 . Use system GMock detection (unless cross-compiling)
21 - Bugs fixed:
22 . Wayland demo client doesn't cross-compile. (LP: #1723971)
23 . mir fails to find drm.h. (LP: #1722147)
24 . Don't treat failing to bypass buffers as a fatal error. (LP: #1723235)
25 . Build process depends on Debian toolchain. (LP: #1724202)
26 . XWayland clients updates not causing redraw (LP: #1720223)
27
28 -- Alan Griffiths <alan@Octopull-desktop> Tue, 17 Oct 2017 14:14:37 +0100
29
1mir (0.28.0+17.10.20171011.1-0ubuntu1) artful; urgency=medium30mir (0.28.0+17.10.20171011.1-0ubuntu1) artful; urgency=medium
231
3 * New upstream release 0.28.0(https://launchpad.net/mir/+milestone/0.28.0)32 * New upstream release 0.28.0(https://launchpad.net/mir/+milestone/0.28.0)
433
=== modified file 'debian/control'
--- debian/control 2017-10-08 14:03:45 +0000
+++ debian/control 2017-10-27 17:26:09 +0000
@@ -22,7 +22,6 @@
22 libgbm-dev,22 libgbm-dev,
23 libglm-dev,23 libglm-dev,
24 libprotobuf-dev,24 libprotobuf-dev,
25 pkg-config,
26 libgoogle-glog-dev,25 libgoogle-glog-dev,
27 liblttng-ust-dev,26 liblttng-ust-dev,
28 libxkbcommon-dev (>= 0.5),27 libxkbcommon-dev (>= 0.5),
@@ -36,7 +35,6 @@
36 valgrind [amd64 i386 armhf arm64],35 valgrind [amd64 i386 armhf arm64],
37 libglib2.0-dev,36 libglib2.0-dev,
38 libfreetype6-dev,37 libfreetype6-dev,
39 abi-compliance-checker,
40 libevdev-dev,38 libevdev-dev,
41 libinput-dev (>= 0.21),39 libinput-dev (>= 0.21),
42 uuid-dev,40 uuid-dev,
4341
=== removed file 'doc/abi_compatibility_tools.md'
--- doc/abi_compatibility_tools.md 2017-05-08 03:04:26 +0000
+++ doc/abi_compatibility_tools.md 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1Tracking ABI compatibility {#abi_compatibility_tools}
2================================
3
4A few make targets exist to help us track ABI compatibility across
5different Mir versions and ensure we increase the ABI version properly.
6These targets invoke the abi-compliance-checker tool for the actual ABI check.
7
8The targets are:
9
10* **make abi-check**
11
12 Compiles all the public libraries in the current tree and checks their ABI against the latest released archive version
13
14* **make abi-check-\<library>**
15
16 Compiles only the specified library in the current tree and checks its ABI against the latest released archive version
17
18 - *library* can be any of the public library targets such as mirclient, mirserver, mirplatform, mircommon, etc.
19
20Sample usage
21------------
22
23 $ bzr branch lp:mir && cd mir
24 $ debian/rules override_dh_auto_configure
25 $ cd <build-dir>
26 $ make abi-check
270
=== modified file 'doc/getting_and_using_mir.md'
--- doc/getting_and_using_mir.md 2017-09-07 09:53:20 +0000
+++ doc/getting_and_using_mir.md 2017-10-27 17:26:09 +0000
@@ -4,7 +4,10 @@
4Getting Mir examples4Getting Mir examples
5--------------------5--------------------
66
7You can install the Mir examples as follows:7These instructions assume that you’re using Ubuntu 17.10 later. For
8earlier releases of Ubuntu or other distributions see \ref getting_involved_in_mir.
9
10You can install the Mir examples along with the Mir graphics drivers as follows:
811
9 $ sudo apt install mir-demos qterminal12 $ sudo apt install mir-demos qterminal
10 $ sudo apt install mir-graphics-drivers-desktop qtubuntu-desktop13 $ sudo apt install mir-graphics-drivers-desktop qtubuntu-desktop
1114
=== modified file 'doc/getting_involved_in_mir.md'
--- doc/getting_involved_in_mir.md 2017-09-07 09:53:20 +0000
+++ doc/getting_involved_in_mir.md 2017-10-27 17:26:09 +0000
@@ -9,26 +9,41 @@
99
10The Mir project is hosted on Launchpad: https://launchpad.net/mir10The Mir project is hosted on Launchpad: https://launchpad.net/mir
1111
12
13Getting Mir source & dependencies
14---------------------------------
15### On Ubuntu
16
17These instructions assume that you’re using Ubuntu 16.04LTS or later.
18
19You’ll need a few development tools installed:
20
21 $ sudo apt install devscripts equivs bzr
22
23With these installed you can checkout Mir and get the remaining dependencies:
24
25 $ bzr branch lp:mir
26 $ sudo mk-build-deps -i
27
28### On Fedora
29
30You’ll need some development tools and packages installed:
31
32 $ sudo dnf install bzr cmake gcc-c++ boost-devel mesa-libEGL-devel \
33 mesa-libGLES-devel glm-devel protobuf-lite-devel protobuf-compiler \
34 capnproto-devel capnproto glog-devel gflags-devel systemd-devel \
35 glib2-devel wayland-devel mesa-libgbm-devel libepoxy-devel nettle-devel \
36 libinput-devel libxml++-devel libuuid-devel libxkbcommon-devel \
37 freetype-devel lttng-ust-devel libatomic qterminal qt5-qtwayland \
38 python3-pillow libevdev-devel umockdev-devel gtest-devel gmock-devel
39
40With these installed you can checkout Mir:
41
42 $ bzr branch lp:mir
43
12Building Mir44Building Mir
13------------45------------
1446
15These instructions assume that you’re using Ubuntu 16.04LTS or later, I’ve not
16earlier Ubuntu versions or other distributions.
17
18You’ll need a few development and utility packages installed, along with the
19Mir graphics drivers:
20
21 $ sudo apt install devscripts equivs bzr
22 $ sudo apt install mir-graphics-drivers-desktop
23
24If you’re working on a phone or tablet use mir-graphics-drivers-android in
25place of mir-graphics-drivers-desktop. (See \ref building_source_for_arm for
26more on this.)
27
28With these installed you can checkout and build Mir:
29
30 $ bzr branch lp:mir
31 $ sudo mk-build-deps -i
32 $ mkdir mir/build47 $ mkdir mir/build
33 $ cd mir/build48 $ cd mir/build
34 $ cmake ..49 $ cmake ..
3550
=== modified file 'examples/CMakeLists.txt'
--- examples/CMakeLists.txt 2017-09-07 05:58:13 +0000
+++ examples/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -3,10 +3,7 @@
33
4set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fno-strict-aliasing -Wextra")4set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fno-strict-aliasing -Wextra")
55
6add_library(eglapp STATIC6add_library(mirdraw STATIC graphics_utils.cpp)
7 eglapp.c
8 client_helpers.cpp
9)
107
11add_library(exampleserverconfig STATIC8add_library(exampleserverconfig STATIC
12 server_example_input_device_config.cpp9 server_example_input_device_config.cpp
@@ -20,150 +17,26 @@
2017
21target_link_libraries(exampleserverconfig mirserver)18target_link_libraries(exampleserverconfig mirserver)
2219
23target_link_libraries(eglapp20mir_add_wrapped_executable(mir_demo_client_basic basic.c)
24 mirclient21target_link_libraries (mir_demo_client_basic mirclient ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
25 ${EGL_LIBRARIES}
26 ${GLESv2_LIBRARIES}
27 )
28
29mir_add_wrapped_executable(mir_demo_client_animated_cursor
30 animated_cursor_demo_client.c
31)
32target_link_libraries(mir_demo_client_animated_cursor
33 eglapp
34)
35mir_add_wrapped_executable(mir_demo_client_eglflash
36 eglflash.c
37)
38target_link_libraries(mir_demo_client_eglflash
39 eglapp
40)
41mir_add_wrapped_executable(mir_demo_client_egltriangle
42 egltriangle.c
43)
44target_link_libraries(mir_demo_client_egltriangle
45 eglapp
46)
47mir_add_wrapped_executable(mir_demo_client_target
48 target.c
49)
50target_link_libraries(mir_demo_client_target
51 eglapp
52)
53mir_add_wrapped_executable(mir_demo_client_pointer_confinement
54 pointer_confinement.c
55)
56target_link_libraries(mir_demo_client_pointer_confinement
57 eglapp
58)
59mir_add_wrapped_executable(mir_demo_client_camera
60 camera.c
61)
62target_link_libraries(mir_demo_client_camera
63 eglapp
64)
65mir_add_wrapped_executable(mir_demo_client_eglcounter
66 eglcounter.cpp
67)
68target_link_libraries(mir_demo_client_eglcounter
69 eglapp
70)
71mir_add_wrapped_executable(mir_demo_client_eglplasma
72 eglplasma.c
73)
74target_link_libraries(mir_demo_client_eglplasma
75 eglapp
76)
77mir_add_wrapped_executable(mir_demo_client_cursors
78 cursors_demo_client.c
79)
80target_link_libraries(mir_demo_client_cursors
81 eglapp
82)
83mir_add_wrapped_executable(mir_demo_client_eglstateswitcher
84 eglstateswitcher.c
85)
86target_link_libraries(mir_demo_client_eglstateswitcher
87 eglapp
88)
89
90mir_add_wrapped_executable(mir_demo_client_tooltip
91 tooltip.c
92)
93target_link_libraries(mir_demo_client_tooltip
94 eglapp
95 )
96
97mir_add_wrapped_executable(mir_demo_client_touch_validator
98 client_touch_validator.cpp
99)
100target_link_libraries(mir_demo_client_touch_validator
101 eglapp
102)
103
104mir_add_wrapped_executable(mir_demo_client_basic
105 basic.c
106 )
107
108mir_add_wrapped_executable(mir_demo_client_input_shapes
109 input_shapes.cpp
110 )
111target_link_libraries(mir_demo_client_input_shapes eglapp)
112
113target_link_libraries(mir_demo_client_basic
114 mirclient
115
116 ${Boost_LIBRARIES}
117 ${CMAKE_THREAD_LIBS_INIT}
118)
11922
120mir_add_wrapped_executable(mir_demo_client_release_at_exit release_at_exit.c)23mir_add_wrapped_executable(mir_demo_client_release_at_exit release_at_exit.c)
121target_link_libraries(mir_demo_client_release_at_exit mirclient)24target_link_libraries (mir_demo_client_release_at_exit mirclient)
12225
123mir_add_wrapped_executable(mir_demo_client_multiwin multiwin.c)26mir_add_wrapped_executable(mir_demo_client_multiwin multiwin.c)
124target_link_libraries(mir_demo_client_multiwin mirclient)27target_link_libraries (mir_demo_client_multiwin mirclient)
12528
126mir_add_wrapped_executable(mir_demo_client_fingerpaint fingerpaint.c)29mir_add_wrapped_executable(mir_demo_client_fingerpaint fingerpaint.c)
127target_link_libraries(mir_demo_client_fingerpaint mirclient)30target_link_libraries (mir_demo_client_fingerpaint mirclient)
12831
129mir_add_wrapped_executable(mir_demo_client_progressbar progressbar.c)32mir_add_wrapped_executable(mir_demo_client_progressbar progressbar.c)
130target_link_libraries(mir_demo_client_progressbar mirclient)33target_link_libraries (mir_demo_client_progressbar mirclient)
13134
132mir_add_wrapped_executable(mir_demo_client_display_config demo_client_display_config.c)35mir_add_wrapped_executable(mir_demo_client_flicker flicker.c)
133target_link_libraries(mir_demo_client_display_config eglapp)36target_link_libraries (mir_demo_client_flicker mirclient ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
134
135mir_add_wrapped_executable(mir_demo_client_eglsquare eglsquare.cpp)
136target_link_libraries(mir_demo_client_eglsquare eglapp)
137
138if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
139 target_link_libraries(mir_demo_client_eglsquare atomic)
140endif()
141
142mir_add_wrapped_executable(mir_demo_client_flicker
143 flicker.c
144)
145
146target_link_libraries(mir_demo_client_flicker
147 mirclient
148
149 ${Boost_LIBRARIES}
150 ${CMAKE_THREAD_LIBS_INIT}
151)
152
153mir_add_wrapped_executable(mir_demo_client_scroll
154 scroll.cpp
155)
156
157target_link_libraries(mir_demo_client_scroll
158 eglapp
159 mirdraw
160 ${GLESv2_LIBRARIES}
161)
16237
163mir_add_wrapped_executable(mir_demo_client_prompt_session prompt_session.c)38mir_add_wrapped_executable(mir_demo_client_prompt_session prompt_session.c)
164target_link_libraries(mir_demo_client_prompt_session mirclient)39target_link_libraries (mir_demo_client_prompt_session mirclient)
165
166add_library(mirdraw STATIC graphics_utils.cpp)
16740
168include_directories(41include_directories(
169 ${PROJECT_SOURCE_DIR}/include/miral42 ${PROJECT_SOURCE_DIR}/include/miral
@@ -238,51 +111,91 @@
238 endif ()111 endif ()
239endif ()112endif ()
240113
241mir_add_wrapped_executable(mir_demo_client_multistream114mir_add_wrapped_executable(mir_demo_client_prerendered_frames prerendered_frames.c)
242 multi_stream.cpp115target_link_libraries (mir_demo_client_prerendered_frames mirclient m)
243)116
244117mir_add_wrapped_executable(mir_demo_client_chain_jumping_buffers chain_jumping_buffers.c)
245target_link_libraries(mir_demo_client_multistream118target_link_libraries (mir_demo_client_chain_jumping_buffers mirclient)
246 mirclient
247 eglapp
248 ${Boost_LIBRARIES}
249)
250
251mir_add_wrapped_executable(mir_demo_client_render_surface
252 render_surface.cpp
253)
254
255target_link_libraries(mir_demo_client_render_surface
256 mirclient
257 eglapp
258)
259
260mir_add_wrapped_executable(mir_demo_client_prerendered_frames
261 prerendered_frames.c
262)
263
264target_link_libraries(mir_demo_client_prerendered_frames
265 mirclient
266 m
267)
268
269mir_add_wrapped_executable(mir_demo_client_chain_jumping_buffers
270 chain_jumping_buffers.c
271)
272
273target_link_libraries(mir_demo_client_chain_jumping_buffers
274 mirclient
275)
276119
277include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})120include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})
278121
279mir_add_wrapped_executable(mir_demo_client_wayland wayland_client.c)122mir_add_wrapped_executable(mir_demo_client_wayland wayland_client.c)
280target_link_libraries(mir_demo_client_wayland123target_link_libraries (mir_demo_client_wayland ${WAYLAND_CLIENT_LDFLAGS} ${WAYLAND_CLIENT_LIBRARIES})
281
282 ${WAYLAND_CLIENT_LIBRARIES}
283)
284124
285mir_add_wrapped_executable(mir_demo_client_screencast screencast.cpp)125mir_add_wrapped_executable(mir_demo_client_screencast screencast.cpp)
286126target_link_libraries (mir_demo_client_screencast mirclient)
287target_link_libraries(mir_demo_client_screencast mirclient)127
288128
129# The remaining examples are dependent on Mir EGL being supported.
130if (MIR_EGL_SUPPORTED)
131
132 add_library(eglapp STATIC
133 eglapp.c
134 client_helpers.cpp
135 )
136
137 target_link_libraries(eglapp
138 mirclient
139 ${EGL_LIBRARIES}
140 ${GLESv2_LIBRARIES}
141 )
142
143 mir_add_wrapped_executable(mir_demo_client_animated_cursor animated_cursor_demo_client.c)
144 target_link_libraries (mir_demo_client_animated_cursor eglapp)
145
146 mir_add_wrapped_executable(mir_demo_client_eglflash eglflash.c)
147 target_link_libraries (mir_demo_client_eglflash eglapp)
148
149 mir_add_wrapped_executable(mir_demo_client_egltriangle egltriangle.c)
150 target_link_libraries (mir_demo_client_egltriangle eglapp)
151
152 mir_add_wrapped_executable(mir_demo_client_target target.c)
153 target_link_libraries (mir_demo_client_target eglapp)
154
155 mir_add_wrapped_executable(mir_demo_client_pointer_confinement pointer_confinement.c)
156 target_link_libraries (mir_demo_client_pointer_confinement eglapp)
157
158 mir_add_wrapped_executable(mir_demo_client_camera camera.c)
159 target_link_libraries (mir_demo_client_camera eglapp)
160
161 mir_add_wrapped_executable(mir_demo_client_eglcounter eglcounter.cpp)
162 target_link_libraries (mir_demo_client_eglcounter eglapp)
163
164 mir_add_wrapped_executable(mir_demo_client_eglplasma eglplasma.c)
165 target_link_libraries (mir_demo_client_eglplasma eglapp)
166
167 mir_add_wrapped_executable(mir_demo_client_cursors cursors_demo_client.c)
168 target_link_libraries (mir_demo_client_cursors eglapp)
169
170 mir_add_wrapped_executable(mir_demo_client_eglstateswitcher eglstateswitcher.c)
171 target_link_libraries (mir_demo_client_eglstateswitcher eglapp)
172
173 mir_add_wrapped_executable(mir_demo_client_tooltip tooltip.c)
174 target_link_libraries (mir_demo_client_tooltip eglapp)
175
176 mir_add_wrapped_executable(mir_demo_client_touch_validator client_touch_validator.cpp)
177 target_link_libraries (mir_demo_client_touch_validator eglapp)
178
179 mir_add_wrapped_executable(mir_demo_client_display_config demo_client_display_config.c)
180 target_link_libraries (mir_demo_client_display_config eglapp)
181
182 mir_add_wrapped_executable(mir_demo_client_eglsquare eglsquare.cpp)
183 target_link_libraries (mir_demo_client_eglsquare eglapp)
184
185 if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
186 target_link_libraries (mir_demo_client_eglsquare atomic)
187 endif()
188
189 mir_add_wrapped_executable(mir_demo_client_input_shapes input_shapes.cpp)
190 target_link_libraries (mir_demo_client_input_shapes eglapp)
191
192 mir_add_wrapped_executable(mir_demo_client_scroll scroll.cpp)
193 target_link_libraries (mir_demo_client_scroll eglapp mirdraw ${GLESv2_LIBRARIES})
194
195 mir_add_wrapped_executable(mir_demo_client_multistream multi_stream.cpp)
196 target_link_libraries (mir_demo_client_multistream mirclient eglapp ${Boost_LIBRARIES})
197
198 mir_add_wrapped_executable(mir_demo_client_render_surface render_surface.cpp)
199 target_link_libraries (mir_demo_client_render_surface mirclient eglapp)
200
201endif() # MIR_EGL_SUPPORTED
289202
=== modified file 'examples/miral-kiosk/CMakeLists.txt'
--- examples/miral-kiosk/CMakeLists.txt 2017-08-31 15:12:09 +0000
+++ examples/miral-kiosk/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -10,3 +10,8 @@
10)10)
1111
12target_link_libraries(miral-kiosk miral)12target_link_libraries(miral-kiosk miral)
13
14# I'm not sure why this is needed in a chroot, but it's not worth finding out
15if(DEFINED MIR_CHROOT)
16 target_link_libraries(miral-kiosk EGL ${GLESv2_LIBRARIES})
17endif()
1318
=== modified file 'examples/miral-shell/miral-app.sh'
--- examples/miral-shell/miral-app.sh 2017-09-25 17:59:37 +0000
+++ examples/miral-shell/miral-app.sh 2017-10-27 17:26:09 +0000
@@ -45,14 +45,20 @@
45if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi45if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
46if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi46if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
4747
48qt_qpa_platform=ubuntumirclient
48qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)49qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)
49if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi50if [ "${qtubuntu_desktop_installed}" == "0" ]
51then
52 echo "** Warning ** defaulting to Wayland backend for Qt"
53 echo "For the best experience install qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""
54 qt_qpa_platform=wayland
55fi
5056
51sh -c "${bindir}${miral_server} $* ${hostsocket} --file ${socket} --wayland-socket-name ${wayland_display} --desktop_file_hint=miral-shell.desktop"&57sh -c "${bindir}${miral_server} $* ${hostsocket} --file ${socket} --wayland-socket-name ${wayland_display} --desktop_file_hint=miral-shell.desktop"&
5258
53while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done59while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
5460
55unset QT_QPA_PLATFORMTHEME61unset QT_QPA_PLATFORMTHEME
56MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir WAYLAND_DISPLAY=${wayland_display} dbus-run-session -- ${launcher}62MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=${qt_qpa_platform} SDL_VIDEODRIVER=wayland WAYLAND_DISPLAY=${wayland_display} dbus-run-session -- ${launcher}
57killall ${bindir}${miral_server}63killall ${bindir}${miral_server}
5864
5965
=== modified file 'examples/miral-shell/miral-desktop.sh'
--- examples/miral-shell/miral-desktop.sh 2017-09-19 08:52:48 +0000
+++ examples/miral-shell/miral-desktop.sh 2017-10-27 17:26:09 +0000
@@ -37,8 +37,14 @@
37if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi37if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
38if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi38if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
3939
40qt_qpa_platform=ubuntumirclient
40qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)41qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)
41if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi42if [ "${qtubuntu_desktop_installed}" == "0" ]
43then
44 echo "** Warning ** defaulting to Wayland backend for Qt"
45 echo "For the best experience install qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""
46 qt_qpa_platform=wayland
47fi
4248
43sudo ls >> /dev/null49sudo ls >> /dev/null
44oldvt=$(sudo fgconsole)50oldvt=$(sudo fgconsole)
@@ -47,6 +53,6 @@
47while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done53while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
4854
49unset QT_QPA_PLATFORMTHEME55unset QT_QPA_PLATFORMTHEME
50MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir WAYLAND_DISPLAY=${wayland_display} dbus-run-session -- ${launcher}56MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=${qt_qpa_platform} SDL_VIDEODRIVER=wayland WAYLAND_DISPLAY=${wayland_display} dbus-run-session -- ${launcher}
51sudo killall ${bindir}${miral_server}57sudo killall ${bindir}${miral_server}
5258
5359
=== modified file 'examples/miral-shell/miral-run.sh'
--- examples/miral-shell/miral-run.sh 2017-08-21 15:58:34 +0000
+++ examples/miral-shell/miral-run.sh 2017-10-27 17:26:09 +0000
@@ -14,4 +14,15 @@
14then extras='--app-id com.canonical.miral.Terminal'14then extras='--app-id com.canonical.miral.Terminal'
15fi15fi
16unset QT_QPA_PLATFORMTHEME16unset QT_QPA_PLATFORMTHEME
17MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir "$@" ${extras}&17
18qt_qpa_platform=ubuntumirclient
19qtubuntu_desktop_installed=$(apt list qtubuntu-desktop
20 2>/dev/null | grep installed | wc -l)
21if [ "${qtubuntu_desktop_installed}" == "0" ]
22then
23 echo "** Warning ** defaulting to Wayland backend for Qt"
24 echo "For the best experience install qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""
25 qt_qpa_platform=wayland
26fi
27
28MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=${qt_qpa_platform} SDL_VIDEODRIVER=wayland "$@" ${extras}&
1829
=== modified file 'examples/miral-shell/miral-xrun.sh'
--- examples/miral-shell/miral-xrun.sh 2017-09-29 16:19:42 +0000
+++ examples/miral-shell/miral-xrun.sh 2017-10-27 17:26:09 +0000
@@ -41,7 +41,6 @@
41 else41 else
42 echo "Error: Cannot detect Mir endpoint"; exit 142 echo "Error: Cannot detect Mir endpoint"; exit 1
43 fi43 fi
44 MIR_SOCKET=${socket_value}
45 x11_server_args=-rootless44 x11_server_args=-rootless
46elif [ "${x11_server}" == "Xwayland" ];45elif [ "${x11_server}" == "Xwayland" ];
47then46then
@@ -51,10 +50,15 @@
51 if [ -e "${XDG_RUNTIME_DIR}/miral_wayland" ];50 if [ -e "${XDG_RUNTIME_DIR}/miral_wayland" ];
52 then51 then
53 socket_value=miral_wayland52 socket_value=miral_wayland
53 elif [ -e "${XDG_RUNTIME_DIR}/wayland-1" ]
54 then
55 socket_value=wayland-1
56 elif [ -e "${XDG_RUNTIME_DIR}/wayland-0" ]
57 then
58 socket_value=wayland-0
54 else59 else
55 echo "Error: Cannot detect Mir-Wayland endpoint"; exit 160 echo "Error: Cannot detect Mir-Wayland endpoint"; exit 1
56 fi61 fi
57 WAYLAND_DISPLAY=${socket_value}
58 x11_server_args=62 x11_server_args=
59fi63fi
6064
@@ -64,6 +68,7 @@
64 let port+=168 let port+=1
65done69done
6670
67${x11_server} ${x11_server_args} :${port} & pid=$!71MIR_SOCKET=${socket_value} WAYLAND_DISPLAY=${socket_value} ${x11_server} ${x11_server_args} :${port} & pid=$!
72while [ ! -e "/tmp/.X11-unix/X${port}" ]; do echo "waiting for DISPLAY=:${port}"; sleep 1 ;done
68DISPLAY=:${port} "$@"73DISPLAY=:${port} "$@"
69kill ${pid}74kill ${pid}
7075
=== modified file 'examples/miral-shell/shell_main.cpp'
--- examples/miral-shell/shell_main.cpp 2017-08-21 15:58:34 +0000
+++ examples/miral-shell/shell_main.cpp 2017-10-27 17:26:09 +0000
@@ -83,7 +83,7 @@
83 {83 {
84 CommandLineOption{[&](std::string const& ) { },84 CommandLineOption{[&](std::string const& ) { },
85 "desktop_file_hint", "Ignored for Unity8 compatibility", "miral-shell.desktop"},85 "desktop_file_hint", "Ignored for Unity8 compatibility", "miral-shell.desktop"},
86 CursorTheme{"DMZ-White"},86 CursorTheme{"default"},
87 window_managers,87 window_managers,
88 display_configuration_options,88 display_configuration_options,
89 launcher,89 launcher,
9090
=== modified file 'examples/miral-shell/spinner/eglspinner.cpp'
--- examples/miral-shell/spinner/eglspinner.cpp 2017-08-21 15:58:34 +0000
+++ examples/miral-shell/spinner/eglspinner.cpp 2017-10-27 17:26:09 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright © 2013-2015 Canonical Ltd.2 * Copyright © 2013-2017 Canonical Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify4 * This program is free software: you can redistribute it and/or modify
5 * under the terms of the GNU General Public License version 2 or 3 as as5 * under the terms of the GNU General Public License version 2 or 3 as as
@@ -19,6 +19,14 @@
19 * Kevin DuBois <kevin.dubois@canonical.com>19 * Kevin DuBois <kevin.dubois@canonical.com>
20 */20 */
2121
22// Ugly way to detect the Mir EGL patch to mesa
23// NB this has to be before any other includes
24#define MIR_EGL_PLATFORM
25#include <EGL/eglplatform.h>
26#ifndef MIR_CLIENT_API_VERSION
27#define MIR_EGL_UNAVAILABLE
28#endif
29
22#include "splash.h"30#include "splash.h"
2331
24#include <chrono>32#include <chrono>
@@ -143,7 +151,7 @@
143 //1.) 0.0 - 0.6: logo fades in fully151 //1.) 0.0 - 0.6: logo fades in fully
144 //2.) 0.0 - 6.0: logo does one full spin 360°152 //2.) 0.0 - 6.0: logo does one full spin 360°
145 //3.) 6.0 - 6.833: glow fades in fully, black-background fades out to 50%153 //3.) 6.0 - 6.833: glow fades in fully, black-background fades out to 50%
146 //4.) 6.833 - 7.666: glow fades out fully, black-background fades out to 0% 154 //4.) 6.833 - 7.666: glow fades out fully, black-background fades out to 0%
147 //5.) 7.666 - 8.266: logo fades out fully155 //5.) 7.666 - 8.266: logo fades out fully
148 //8.266..: now spinner can be closed as all its elements are faded out156 //8.266..: now spinner can be closed as all its elements are faded out
149157
@@ -221,11 +229,14 @@
221 "} \n";229 "} \n";
222230
223std::atomic<bool> dying{false};231std::atomic<bool> dying{false};
232
233#ifndef MIR_EGL_UNAVAILABLE
224void lifecycle_event_callback(MirConnection* /*connection*/, MirLifecycleState state, void* context)234void lifecycle_event_callback(MirConnection* /*connection*/, MirLifecycleState state, void* context)
225{235{
226 if (state == mir_lifecycle_connection_lost)236 if (state == mir_lifecycle_connection_lost)
227 static_cast<decltype(dying)*>(context)->store(true);237 static_cast<decltype(dying)*>(context)->store(true);
228}238}
239#endif
229}240}
230241
231struct SpinnerSplash::Self242struct SpinnerSplash::Self
@@ -254,6 +265,7 @@
254void SpinnerSplash::operator()(MirConnection* const connection)265void SpinnerSplash::operator()(MirConnection* const connection)
255try266try
256{267{
268#ifndef MIR_EGL_UNAVAILABLE
257 GLuint prog[2];269 GLuint prog[2];
258 GLuint texture[2];270 GLuint texture[2];
259 GLint vpos[2];271 GLint vpos[2];
@@ -365,6 +377,9 @@
365377
366 glDeleteTextures(2, texture);378 glDeleteTextures(2, texture);
367 g_timer_destroy (timer);379 g_timer_destroy (timer);
380#else
381 (void)connection;
382#endif
368}383}
369catch (std::exception const& x)384catch (std::exception const& x)
370{385{
371386
=== modified file 'examples/miral-shell/titlebar_config.cpp'
--- examples/miral-shell/titlebar_config.cpp 2017-08-21 15:58:34 +0000
+++ examples/miral-shell/titlebar_config.cpp 2017-10-27 17:26:09 +0000
@@ -17,12 +17,30 @@
17 */17 */
1818
19#include "titlebar_config.h"19#include "titlebar_config.h"
20#include <unistd.h>
20#include <mutex>21#include <mutex>
2122
22namespace23namespace
23{24{
25auto default_font() -> std::string
26{
27 for (std::string const file : { "Ubuntu-B.ttf", "FreeSansBold.ttf" })
28 {
29 for (auto const path : { "/usr/share/fonts/truetype/ubuntu-font-family/", // Ubuntu Ubuntu-B.ttf
30 "/usr/share/fonts/truetype/freefont/", // Debian FreeSansBold.ttf
31 "/usr/share/fonts/gnu-free/"}) // Fedora FreeSansBold.ttf
32 {
33 auto const full_path = path + file;
34 if (access(full_path.c_str(), R_OK) == 0)
35 return full_path;
36 }
37 }
38
39 return "/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf";
40}
41
24std::mutex mutex;42std::mutex mutex;
25std::string font_file{"/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf"};43std::string font_file{default_font()};
26}44}
2745
28void titlebar::font_file(std::string const& font_file)46void titlebar::font_file(std::string const& font_file)
2947
=== modified file 'include/core/mir/optional_value.h'
--- include/core/mir/optional_value.h 2017-07-28 17:00:43 +0000
+++ include/core/mir/optional_value.h 2017-10-27 17:26:09 +0000
@@ -59,6 +59,11 @@
59 return std::move(value_);59 return std::move(value_);
60 }60 }
6161
62 operator bool() const
63 {
64 return is_set();
65 }
66
62private:67private:
63 void die_if_unset() const68 void die_if_unset() const
64 {69 {
6570
=== modified file 'include/server/mir/server_action_queue.h'
--- include/server/mir/server_action_queue.h 2017-07-28 17:00:43 +0000
+++ include/server/mir/server_action_queue.h 2017-10-27 17:26:09 +0000
@@ -32,6 +32,16 @@
32 virtual ~ServerActionQueue() = default;32 virtual ~ServerActionQueue() = default;
3333
34 virtual void enqueue(void const* owner, ServerAction const& action) = 0;34 virtual void enqueue(void const* owner, ServerAction const& action) = 0;
35 /**
36 * Enqueue an action to be run, guaranteeing that it *will* be run.
37 *
38 * The action will be run even if the queue is not normally being drained
39 * (for example, if the main loop is suspended). If running on the queue is
40 * not possible, the action will be run on the caller's thread.
41 *
42 * \param [in] action Functor to invoke.
43 */
44 virtual void enqueue_with_guaranteed_execution(ServerAction const& action) = 0;
35 virtual void pause_processing_for(void const* owner) = 0;45 virtual void pause_processing_for(void const* owner) = 0;
36 virtual void resume_processing_for(void const* owner) = 0;46 virtual void resume_processing_for(void const* owner) = 0;
3747
3848
=== modified file 'include/server/mir/shell/persistent_surface_store.h'
--- include/server/mir/shell/persistent_surface_store.h 2017-07-28 17:00:43 +0000
+++ include/server/mir/shell/persistent_surface_store.h 2017-10-27 17:26:09 +0000
@@ -22,7 +22,7 @@
22#include <memory>22#include <memory>
23#include <vector>23#include <vector>
24#include <array>24#include <array>
25#include <uuid/uuid.h>25#include <uuid.h>
2626
2727
28namespace mir28namespace mir
2929
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2017-09-08 13:26:03 +0000
+++ src/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -18,7 +18,6 @@
18# Add the core and platform implementations before exposing any private APIs18# Add the core and platform implementations before exposing any private APIs
19add_subdirectory(core)19add_subdirectory(core)
20add_subdirectory(platforms/)20add_subdirectory(platforms/)
21add_subdirectory(miral/)
2221
23# the src/include/... directories should be private to the implementation22# the src/include/... directories should be private to the implementation
24include_directories(${PROJECT_SOURCE_DIR}/src/include/common)23include_directories(${PROJECT_SOURCE_DIR}/src/include/common)
@@ -31,6 +30,7 @@
3130
32add_subdirectory(platform/)31add_subdirectory(platform/)
33add_subdirectory(server/)32add_subdirectory(server/)
33add_subdirectory(miral/)
34add_subdirectory(client/)34add_subdirectory(client/)
35add_subdirectory(utils/)35add_subdirectory(utils/)
36add_subdirectory(renderer/)36add_subdirectory(renderer/)
@@ -54,6 +54,7 @@
54set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)54set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)
55set(MIR_CLIENT_PLATFORM_PATH ${MIR_CLIENT_PLATFORM_PATH} PARENT_SCOPE)55set(MIR_CLIENT_PLATFORM_PATH ${MIR_CLIENT_PLATFORM_PATH} PARENT_SCOPE)
56set(MIR_SERVER_PLATFORM_PATH ${MIR_SERVER_PLATFORM_PATH} PARENT_SCOPE)56set(MIR_SERVER_PLATFORM_PATH ${MIR_SERVER_PLATFORM_PATH} PARENT_SCOPE)
57set(MIRSERVER_INCLUDE_DIRS ${MIRSERVER_INCLUDE_DIRS} PARENT_SCOPE)
5758
58# We need the ABI versions in the tests59# We need the ABI versions in the tests
59set(MIR_SERVER_GRAPHICS_PLATFORM_ABI ${MIR_SERVER_GRAPHICS_PLATFORM_ABI} PARENT_SCOPE)60set(MIR_SERVER_GRAPHICS_PLATFORM_ABI ${MIR_SERVER_GRAPHICS_PLATFORM_ABI} PARENT_SCOPE)
6061
=== modified file 'src/capnproto/CMakeLists.txt'
--- src/capnproto/CMakeLists.txt 2017-07-28 17:00:43 +0000
+++ src/capnproto/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -20,7 +20,12 @@
20capnp_generate_cpp(CAPNPROTO_INPUT_CONFIG_SRC CAPNPROTO_INPUT_CONFIG_HDRS mir_input_config.capnp)20capnp_generate_cpp(CAPNPROTO_INPUT_CONFIG_SRC CAPNPROTO_INPUT_CONFIG_HDRS mir_input_config.capnp)
2121
22add_library(mircapnproto STATIC ${CAPNPROTO_EVENT_SRC} ${CAPNPROTO_INPUT_CONFIG_SRC})22add_library(mircapnproto STATIC ${CAPNPROTO_EVENT_SRC} ${CAPNPROTO_INPUT_CONFIG_SRC})
23target_link_libraries(mircapnproto ${CAPNP_LIBRARIES_LITE})23
24if (DEFINED CAPNP_LIBRARIES_LITE)
25 target_link_libraries(mircapnproto ${CAPNP_LIBRARIES_LITE})
26else()
27 target_link_libraries(mircapnproto $<TARGET_FILE:CapnProto::capnp> $<TARGET_FILE:CapnProto::kj>)
28endif()
2429
25list(APPEND MIR_GENERATED_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})30list(APPEND MIR_GENERATED_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
2631
2732
=== modified file 'src/include/server/mir/glib_main_loop.h'
--- src/include/server/mir/glib_main_loop.h 2017-07-28 17:00:43 +0000
+++ src/include/server/mir/glib_main_loop.h 2017-10-27 17:26:09 +0000
@@ -28,6 +28,7 @@
28#include <exception>28#include <exception>
2929
30#include <glib.h>30#include <glib.h>
31#include <deque>
3132
32namespace mir33namespace mir
33{34{
@@ -76,6 +77,8 @@
76 void unregister_fd_handler(void const* owner) override;77 void unregister_fd_handler(void const* owner) override;
7778
78 void enqueue(void const* owner, ServerAction const& action) override;79 void enqueue(void const* owner, ServerAction const& action) override;
80 void enqueue_with_guaranteed_execution(ServerAction const& action) override;
81
79 void pause_processing_for(void const* owner) override;82 void pause_processing_for(void const* owner) override;
80 void resume_processing_for(void const* owner) override;83 void resume_processing_for(void const* owner) override;
8184
@@ -100,6 +103,8 @@
100 detail::SignalSources signal_sources;103 detail::SignalSources signal_sources;
101 std::mutex do_not_process_mutex;104 std::mutex do_not_process_mutex;
102 std::vector<void const*> do_not_process;105 std::vector<void const*> do_not_process;
106 std::mutex run_on_halt_mutex;
107 std::deque<ServerAction> run_on_halt_queue;
103 std::function<void()> before_iteration_hook;108 std::function<void()> before_iteration_hook;
104 std::exception_ptr main_loop_exception;109 std::exception_ptr main_loop_exception;
105};110};
106111
=== modified file 'src/miral/CMakeLists.txt'
--- src/miral/CMakeLists.txt 2017-09-15 09:43:35 +0000
+++ src/miral/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -96,13 +96,18 @@
9696
97# clang generates slightly different symbols (but we don't care)97# clang generates slightly different symbols (but we don't care)
98if (CMAKE_COMPILER_IS_GNUCXX)98if (CMAKE_COMPILER_IS_GNUCXX)
99 add_custom_target(check-miral-symbols ALL99 # Using dpkg-gensymbols only makes sense on Debian based distros
100 DEPENDS miral ${PROJECT_SOURCE_DIR}/debian/libmiral${MIRAL_ABI}.symbols100 if (EXISTS /etc/debian_version)
101 COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/libmiral${MIRAL_ABI}.symbols101 find_program(MIR_DPKG_GENSYMBOLS dpkg-gensymbols)
102 COMMAND dpkg-gensymbols -e${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmiral.so.${MIRAL_ABI} -plibmiral${MIRAL_ABI} -v${MIRAL_VERSION} -O${CMAKE_CURRENT_BINARY_DIR}/libmiral${MIRAL_ABI}.symbols102 if (MIR_DPKG_GENSYMBOLS)
103 WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"103 add_custom_target(check-miral-symbols ALL
104 VERBATIM104 DEPENDS miral ${PROJECT_SOURCE_DIR}/debian/libmiral${MIRAL_ABI}.symbols
105 )105 COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/libmiral${MIRAL_ABI}.symbols
106 COMMAND dpkg-gensymbols -e${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmiral.so.${MIRAL_ABI} -plibmiral${MIRAL_ABI} -v${MIRAL_VERSION} -O${CMAKE_CURRENT_BINARY_DIR}/libmiral${MIRAL_ABI}.symbols
107 WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
108 VERBATIM)
109 endif()
110 endif()
106endif()111endif()
107112
108set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")113set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
109114
=== modified file 'src/miral/runner.cpp'
--- src/miral/runner.cpp 2017-08-21 14:18:55 +0000
+++ src/miral/runner.cpp 2017-10-27 17:26:09 +0000
@@ -48,7 +48,7 @@
48 int const argc;48 int const argc;
49 char const** const argv;49 char const** const argv;
50 std::string const config_file;50 std::string const config_file;
51 51
52 std::mutex mutex;52 std::mutex mutex;
53 std::function<void()> start_callback{[]{}};53 std::function<void()> start_callback{[]{}};
54 std::function<void()> stop_callback{[this]{ join_client_threads(weak_server.lock().get()); }};54 std::function<void()> stop_callback{[this]{ join_client_threads(weak_server.lock().get()); }};
@@ -103,7 +103,7 @@
103 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir103 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir
104 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir104 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir
105 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme105 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme
106 setenv("SDL_VIDEODRIVER", "mir", true); // configure SDL to use Mir106 setenv("SDL_VIDEODRIVER", "wayland", true); // configure SDL to use Wayland
107107
108 // gnome-terminal is the (only known) special case108 // gnome-terminal is the (only known) special case
109 char const* exec_args[] = { "gnome-terminal", "--app-id", "com.canonical.miral.Terminal", nullptr };109 char const* exec_args[] = { "gnome-terminal", "--app-id", "com.canonical.miral.Terminal", nullptr };
110110
=== modified file 'src/platforms/eglstream-kms/server/display.cpp'
--- src/platforms/eglstream-kms/server/display.cpp 2017-07-28 17:00:43 +0000
+++ src/platforms/eglstream-kms/server/display.cpp 2017-10-27 17:26:09 +0000
@@ -34,7 +34,6 @@
34#include "mir/renderer/gl/render_target.h"34#include "mir/renderer/gl/render_target.h"
35#include "mir/renderer/gl/context.h"35#include "mir/renderer/gl/context.h"
3636
37#include <drm/drm.h>
38#include <xf86drmMode.h>37#include <xf86drmMode.h>
39#include <sys/ioctl.h>38#include <sys/ioctl.h>
40#include <system_error>39#include <system_error>
4140
=== modified file 'src/platforms/eglstream-kms/server/egl_output.cpp'
--- src/platforms/eglstream-kms/server/egl_output.cpp 2017-07-28 17:00:43 +0000
+++ src/platforms/eglstream-kms/server/egl_output.cpp 2017-10-27 17:26:09 +0000
@@ -23,7 +23,7 @@
23#include "kms-utils/kms_connector.h"23#include "kms-utils/kms_connector.h"
2424
25#include <cstring>25#include <cstring>
26#include <drm/drm.h>26#include <drm.h>
27#include <sys/ioctl.h>27#include <sys/ioctl.h>
28#include <vector>28#include <vector>
29#include <boost/throw_exception.hpp>29#include <boost/throw_exception.hpp>
3030
=== modified file 'src/platforms/mesa/server/buffer_allocator.cpp'
--- src/platforms/mesa/server/buffer_allocator.cpp 2017-09-27 20:44:14 +0000
+++ src/platforms/mesa/server/buffer_allocator.cpp 2017-10-27 17:26:09 +0000
@@ -421,8 +421,6 @@
421421
422 if (egl_image == EGL_NO_IMAGE_KHR)422 if (egl_image == EGL_NO_IMAGE_KHR)
423 BOOST_THROW_EXCEPTION(mg::egl_error("Failed to create EGLImage"));423 BOOST_THROW_EXCEPTION(mg::egl_error("Failed to create EGLImage"));
424
425 on_consumed();
426 }424 }
427 lock.unlock();425 lock.unlock();
428426
@@ -436,6 +434,7 @@
436434
437 void secure_for_render() override435 void secure_for_render() override
438 {436 {
437 on_consumed();
439 }438 }
440439
441 std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const override440 std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const override
@@ -537,7 +536,7 @@
537536
538 std::shared_ptr<mg::EGLExtensions> const extensions;537 std::shared_ptr<mg::EGLExtensions> const extensions;
539538
540 std::function<void()> on_consumed;539 std::function<void()> const on_consumed;
541};540};
542}541}
543542
544543
=== modified file 'src/platforms/mesa/server/kms/cursor.cpp'
--- src/platforms/mesa/server/kms/cursor.cpp 2017-07-31 08:58:34 +0000
+++ src/platforms/mesa/server/kms/cursor.cpp 2017-10-27 17:26:09 +0000
@@ -25,7 +25,6 @@
25#include "mir/graphics/cursor_image.h"25#include "mir/graphics/cursor_image.h"
2626
27#include <xf86drm.h>27#include <xf86drm.h>
28#include <drm/drm.h>
2928
30#include <boost/exception/errinfo_errno.hpp>29#include <boost/exception/errinfo_errno.hpp>
3130
3231
=== modified file 'src/platforms/mesa/server/kms/display_buffer.cpp'
--- src/platforms/mesa/server/kms/display_buffer.cpp 2017-07-28 17:00:43 +0000
+++ src/platforms/mesa/server/kms/display_buffer.cpp 2017-10-27 17:26:09 +0000
@@ -32,7 +32,7 @@
32#include <EGL/eglext.h>32#include <EGL/eglext.h>
33#include MIR_SERVER_GL_H33#include MIR_SERVER_GL_H
34#include <GLES2/gl2ext.h>34#include <GLES2/gl2ext.h>
35#include <drm/drm_fourcc.h>35#include <drm_fourcc.h>
3636
37#include <sstream>37#include <sstream>
38#include <stdexcept>38#include <stdexcept>
@@ -504,7 +504,7 @@
504 make_current();504 make_current();
505505
506 listener->report_successful_egl_make_current_on_construction();506 listener->report_successful_egl_make_current_on_construction();
507 507
508 glClear(GL_COLOR_BUFFER_BIT);508 glClear(GL_COLOR_BUFFER_BIT);
509509
510 surface.swap_buffers();510 surface.swap_buffers();
@@ -591,9 +591,7 @@
591 {591 {
592 auto bypass_buffer = (*bypass_it)->buffer();592 auto bypass_buffer = (*bypass_it)->buffer();
593 auto native = std::dynamic_pointer_cast<mgm::NativeBuffer>(bypass_buffer->native_buffer_handle());593 auto native = std::dynamic_pointer_cast<mgm::NativeBuffer>(bypass_buffer->native_buffer_handle());
594 if (!native)594 if (native && native->flags & mir_buffer_flag_can_scanout &&
595 BOOST_THROW_EXCEPTION(std::invalid_argument("could not convert NativeBuffer"));
596 if (native->flags & mir_buffer_flag_can_scanout &&
597 bypass_buffer->size() == surface.size() &&595 bypass_buffer->size() == surface.size() &&
598 !needs_bounce_buffer(*outputs.front(), native->bo))596 !needs_bounce_buffer(*outputs.front(), native->bo))
599 {597 {
@@ -776,7 +774,7 @@
776774
777 visible_bypass_frame = scheduled_bypass_frame;775 visible_bypass_frame = scheduled_bypass_frame;
778 scheduled_bypass_frame = nullptr;776 scheduled_bypass_frame = nullptr;
779 777
780 visible_composite_frame = std::move(scheduled_composite_frame);778 visible_composite_frame = std::move(scheduled_composite_frame);
781 scheduled_composite_frame = nullptr;779 scheduled_composite_frame = nullptr;
782 }780 }
783781
=== modified file 'src/protobuf/symbols.map'
--- src/protobuf/symbols.map 2017-05-25 08:58:03 +0000
+++ src/protobuf/symbols.map 2017-10-27 17:26:09 +0000
@@ -1158,3 +1158,27 @@
1158 vtable?for?mir::protobuf::RequestWithAuthority;1158 vtable?for?mir::protobuf::RequestWithAuthority;
1159 };1159 };
1160} MIR_PROTOBUF_0.26;1160} MIR_PROTOBUF_0.26;
1161
1162# When building with the Fedora 26 toolchain these are needed
1163MIR_PROTOBUF_FEDORA {
1164 global:
1165 extern "C++" {
1166 mir::protobuf::_Buffer_default_instance_;
1167 mir::protobuf::_BufferRequest_default_instance_;
1168 mir::protobuf::_BufferStream_default_instance_;
1169 mir::protobuf::_BufferStreamId_default_instance_;
1170 mir::protobuf::_Cookie_default_instance_;
1171 mir::protobuf::_DisplayConfiguration_default_instance_;
1172 mir::protobuf::_LifecycleEvent_default_instance_;
1173 mir::protobuf::_ModuleProperties_default_instance_;
1174 mir::protobuf::_PersistentSurfaceId_default_instance_;
1175 mir::protobuf::_PingEvent_default_instance_;
1176 mir::protobuf::_Platform_default_instance_;
1177 mir::protobuf::_ScreencastId_default_instance_;
1178 mir::protobuf::_StructuredError_default_instance_;
1179 mir::protobuf::_SurfaceAspectRatio_default_instance_;
1180 mir::protobuf::_SurfaceId_default_instance_;
1181 mir::protobuf::_SurfaceSpecification_default_instance_;
1182 mir::protobuf::_Rectangle_default_instance_;
1183 };
1184} MIR_PROTOBUF_0.27;
11611185
=== modified file 'src/server/CMakeLists.txt'
--- src/server/CMakeLists.txt 2017-09-25 22:34:08 +0000
+++ src/server/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -125,6 +125,13 @@
125 atomic125 atomic
126)126)
127127
128target_include_directories(mirshell
129 PUBLIC
130 ${UUID_INCLUDE_DIRS}
131)
132
133set(MIRSERVER_INCLUDE_DIRS ${UUID_INCLUDE_DIRS} PARENT_SCOPE)
134
128install(TARGETS mirserver135install(TARGETS mirserver
129 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}136 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
130)137)
131138
=== modified file 'src/server/frontend/wayland/wayland_connector.cpp'
--- src/server/frontend/wayland/wayland_connector.cpp 2017-10-08 02:12:58 +0000
+++ src/server/frontend/wayland/wayland_connector.cpp 2017-10-27 17:26:09 +0000
@@ -43,6 +43,11 @@
4343
44#include "mir/client/event.h"44#include "mir/client/event.h"
4545
46#include "mir/input/device.h"
47#include "mir/input/mir_keyboard_config.h"
48#include "mir/input/input_device_hub.h"
49#include "mir/input/input_device_observer.h"
50
46#include <system_error>51#include <system_error>
47#include <sys/eventfd.h>52#include <sys/eventfd.h>
48#include <wayland-server-core.h>53#include <wayland-server-core.h>
@@ -75,6 +80,7 @@
75namespace ms = mir::scene;80namespace ms = mir::scene;
76namespace geom = mir::geometry;81namespace geom = mir::geometry;
77namespace mcl = mir::client;82namespace mcl = mir::client;
83namespace mi = mir::input;
7884
79namespace mir85namespace mir
80{86{
@@ -798,6 +804,7 @@
798 wl_client* client,804 wl_client* client,
799 wl_resource* parent,805 wl_resource* parent,
800 uint32_t id,806 uint32_t id,
807 mir::input::Keymap const& initial_keymap,
801 std::function<void(WlKeyboard*)> const& on_destroy,808 std::function<void(WlKeyboard*)> const& on_destroy,
802 std::shared_ptr<mir::Executor> const& executor)809 std::shared_ptr<mir::Executor> const& executor)
803 : Keyboard(client, parent, id),810 : Keyboard(client, parent, id),
@@ -811,19 +818,14 @@
811 // TODO: We should really grab the keymap for the focused surface when818 // TODO: We should really grab the keymap for the focused surface when
812 // we receive focus.819 // we receive focus.
813820
814 xkb_rule_names default_rules;821 // TODO: Maintain per-device keymaps, and send the appropriate map before
815 memset(&default_rules, 0, sizeof(default_rules));822 // sending an event from a keyboard with a different map.
816823
817 keymap = decltype(keymap){824 /* The wayland::Keyboard constructor has already run, creating the keyboard
818 xkb_keymap_new_from_names(825 * resource. It is thus safe to send a keymap event to it; the client will receive
819 context.get(),826 * the keyboard object before this event.
820 &default_rules,827 */
821 XKB_KEYMAP_COMPILE_NO_FLAGS),828 set_keymap(initial_keymap);
822 &xkb_keymap_unref};
823
824 state = decltype(state){
825 xkb_state_new(keymap.get()),
826 &xkb_state_unref};
827 }829 }
828830
829 ~WlKeyboard()831 ~WlKeyboard()
@@ -966,6 +968,38 @@
966 state = decltype(state)(xkb_state_new(keymap.get()), &xkb_state_unref);968 state = decltype(state)(xkb_state_new(keymap.get()), &xkb_state_unref);
967 }969 }
968970
971 void set_keymap(mir::input::Keymap const& new_keymap)
972 {
973 xkb_rule_names const names = {
974 "evdev",
975 new_keymap.model.c_str(),
976 new_keymap.layout.c_str(),
977 new_keymap.variant.c_str(),
978 new_keymap.options.c_str()
979 };
980 keymap = decltype(keymap){
981 xkb_keymap_new_from_names(
982 context.get(),
983 &names,
984 XKB_KEYMAP_COMPILE_NO_FLAGS),
985 &xkb_keymap_unref};
986
987 // TODO: We might need to copy across the existing depressed keys?
988 state = decltype(state)(xkb_state_new(keymap.get()), &xkb_state_unref);
989
990 auto buffer = xkb_keymap_get_as_string(keymap.get(), XKB_KEYMAP_FORMAT_TEXT_V1);
991 auto length = strlen(buffer);
992
993 mir::AnonymousShmFile shm_buffer{length};
994 memcpy(shm_buffer.base_ptr(), buffer, length);
995
996 wl_keyboard_send_keymap(
997 resource,
998 WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
999 shm_buffer.fd(),
1000 length);
1001 }
1002
969private:1003private:
970 std::unique_ptr<xkb_keymap, decltype(&xkb_keymap_unref)> keymap;1004 std::unique_ptr<xkb_keymap, decltype(&xkb_keymap_unref)> keymap;
971 std::unique_ptr<xkb_state, decltype(&xkb_state_unref)> state;1005 std::unique_ptr<xkb_state, decltype(&xkb_state_unref)> state;
@@ -1320,8 +1354,20 @@
1320class WlSeat1354class WlSeat
1321{1355{
1322public:1356public:
1323 WlSeat(wl_display* display, std::shared_ptr<mir::Executor> const& executor)1357 WlSeat(
1324 : executor{executor},1358 wl_display* display,
1359 std::shared_ptr<mi::InputDeviceHub> const& input_hub,
1360 std::shared_ptr<mir::Executor> const& executor)
1361 : config_observer{
1362 std::make_shared<ConfigObserver>(
1363 keymap,
1364 [this](mir::input::Keymap const& new_keymap)
1365 {
1366 keymap = new_keymap;
1367
1368 })},
1369 input_hub{input_hub},
1370 executor{executor},
1325 global{wl_global_create(1371 global{wl_global_create(
1326 display,1372 display,
1327 &wl_seat_interface,1373 &wl_seat_interface,
@@ -1333,10 +1379,12 @@
1333 {1379 {
1334 BOOST_THROW_EXCEPTION(std::runtime_error("Failed to export wl_seat interface"));1380 BOOST_THROW_EXCEPTION(std::runtime_error("Failed to export wl_seat interface"));
1335 }1381 }
1382 input_hub->add_observer(config_observer);
1336 }1383 }
13371384
1338 ~WlSeat()1385 ~WlSeat()
1339 {1386 {
1387 input_hub->remove_observer(config_observer);
1340 wl_global_destroy(global);1388 wl_global_destroy(global);
1341 }1389 }
13421390
@@ -1350,9 +1398,38 @@
1350 }1398 }
13511399
1352private:1400private:
1401 class ConfigObserver : public mi::InputDeviceObserver
1402 {
1403 public:
1404 ConfigObserver(
1405 mir::input::Keymap const& keymap,
1406 std::function<void(mir::input::Keymap const&)> const& on_keymap_commit)
1407 : current_keymap{keymap},
1408 on_keymap_commit{on_keymap_commit}
1409 {
1410 }
1411
1412 void device_added(std::shared_ptr<input::Device> const& device) override;
1413 void device_changed(std::shared_ptr<input::Device> const& device) override;
1414 void device_removed(std::shared_ptr<input::Device> const& device) override;
1415 void changes_complete() override;
1416
1417 private:
1418 mir::input::Keymap const& current_keymap;
1419 mir::input::Keymap pending_keymap;
1420 std::function<void(mir::input::Keymap const&)> const on_keymap_commit;
1421 };
1422
1423 mir::input::Keymap keymap;
1424 std::shared_ptr<ConfigObserver> const config_observer;
1425
1353 std::unordered_map<wl_client*, InputCtx<WlPointer>> mutable pointer;1426 std::unordered_map<wl_client*, InputCtx<WlPointer>> mutable pointer;
1354 std::unordered_map<wl_client*, InputCtx<WlKeyboard>> mutable keyboard;1427 std::unordered_map<wl_client*, InputCtx<WlKeyboard>> mutable keyboard;
1355 std::unordered_map<wl_client*, InputCtx<WlTouch>> mutable touch;1428 std::unordered_map<wl_client*, InputCtx<WlTouch>> mutable touch;
1429
1430 std::shared_ptr<mi::InputDeviceHub> const input_hub;
1431
1432
1356 std::shared_ptr<mir::Executor> const executor;1433 std::shared_ptr<mir::Executor> const executor;
13571434
1358 static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id)1435 static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id)
@@ -1413,6 +1490,7 @@
1413 client,1490 client,
1414 resource,1491 resource,
1415 id,1492 id,
1493 me->keymap,
1416 [&input_ctx](WlKeyboard* listener)1494 [&input_ctx](WlKeyboard* listener)
1417 {1495 {
1418 input_ctx.unregister_listener(listener);1496 input_ctx.unregister_listener(listener);
@@ -1435,8 +1513,10 @@
1435 },1513 },
1436 me->executor});1514 me->executor});
1437 }1515 }
1438 static void release(struct wl_client* /*client*/, struct wl_resource* /*resource*/) {}1516 static void release(struct wl_client* /*client*/, struct wl_resource* us)
14391517 {
1518 wl_resource_destroy(us);
1519 }
14401520
1441 wl_global* const global;1521 wl_global* const global;
1442 static struct wl_seat_interface const vtable;1522 static struct wl_seat_interface const vtable;
@@ -1464,6 +1544,37 @@
1464 return touch[client];1544 return touch[client];
1465}1545}
14661546
1547void WlSeat::ConfigObserver::device_added(std::shared_ptr<input::Device> const& device)
1548{
1549 if (auto keyboard_config = device->keyboard_configuration())
1550 {
1551 if (current_keymap != keyboard_config.value().device_keymap())
1552 {
1553 pending_keymap = keyboard_config.value().device_keymap();
1554 }
1555 }
1556}
1557
1558void WlSeat::ConfigObserver::device_changed(std::shared_ptr<input::Device> const& device)
1559{
1560 if (auto keyboard_config = device->keyboard_configuration())
1561 {
1562 if (current_keymap != keyboard_config.value().device_keymap())
1563 {
1564 pending_keymap = keyboard_config.value().device_keymap();
1565 }
1566 }
1567}
1568
1569void WlSeat::ConfigObserver::device_removed(std::shared_ptr<input::Device> const& /*device*/)
1570{
1571}
1572
1573void WlSeat::ConfigObserver::changes_complete()
1574{
1575 on_keymap_commit(pending_keymap);
1576}
1577
1467void WaylandEventSink::send_buffer(BufferStreamId /*id*/, graphics::Buffer& /*buffer*/, graphics::BufferIpcMsgType)1578void WaylandEventSink::send_buffer(BufferStreamId /*id*/, graphics::Buffer& /*buffer*/, graphics::BufferIpcMsgType)
1468{1579{
1469}1580}
@@ -2055,6 +2166,7 @@
2055 optional_value<std::string> const& display_name,2166 optional_value<std::string> const& display_name,
2056 std::shared_ptr<mf::Shell> const& shell,2167 std::shared_ptr<mf::Shell> const& shell,
2057 DisplayChanger& display_config,2168 DisplayChanger& display_config,
2169 std::shared_ptr<mi::InputDeviceHub> const& input_hub,
2058 std::shared_ptr<mg::GraphicBufferAllocator> const& allocator,2170 std::shared_ptr<mg::GraphicBufferAllocator> const& allocator,
2059 bool arw_socket)2171 bool arw_socket)
2060 : display{wl_display_create(), &cleanup_display},2172 : display{wl_display_create(), &cleanup_display},
@@ -2089,7 +2201,7 @@
2089 display.get(),2201 display.get(),
2090 executor,2202 executor,
2091 this->allocator);2203 this->allocator);
2092 seat_global = std::make_unique<mf::WlSeat>(display.get(), executor);2204 seat_global = std::make_unique<mf::WlSeat>(display.get(), input_hub, executor);
2093 output_manager = std::make_unique<mf::OutputManager>(2205 output_manager = std::make_unique<mf::OutputManager>(
2094 display.get(),2206 display.get(),
2095 display_config);2207 display_config);
20962208
=== modified file 'src/server/frontend/wayland/wayland_connector.h'
--- src/server/frontend/wayland/wayland_connector.h 2017-09-15 16:34:13 +0000
+++ src/server/frontend/wayland/wayland_connector.h 2017-10-27 17:26:09 +0000
@@ -29,7 +29,10 @@
29namespace mir29namespace mir
30{30{
3131
3232namespace input
33{
34class InputDeviceHub;
35}
33namespace graphics36namespace graphics
34{37{
35class GraphicBufferAllocator;38class GraphicBufferAllocator;
@@ -54,6 +57,7 @@
54 optional_value<std::string> const& display_name,57 optional_value<std::string> const& display_name,
55 std::shared_ptr<Shell> const& shell,58 std::shared_ptr<Shell> const& shell,
56 DisplayChanger& display_config,59 DisplayChanger& display_config,
60 std::shared_ptr<input::InputDeviceHub> const& input_hub,
57 std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,61 std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,
58 bool arw_socket);62 bool arw_socket);
5963
6064
=== modified file 'src/server/frontend/wayland/wayland_default_configuration.cpp'
--- src/server/frontend/wayland/wayland_default_configuration.cpp 2017-09-15 16:34:13 +0000
+++ src/server/frontend/wayland/wayland_default_configuration.cpp 2017-10-27 17:26:09 +0000
@@ -42,6 +42,7 @@
42 display_name,42 display_name,
43 the_frontend_shell(),43 the_frontend_shell(),
44 *the_frontend_display_changer(),44 *the_frontend_display_changer(),
45 the_input_device_hub(),
45 the_buffer_allocator(),46 the_buffer_allocator(),
46 arw_socket);47 arw_socket);
47 });48 });
4849
=== modified file 'src/server/glib_main_loop.cpp'
--- src/server/glib_main_loop.cpp 2017-07-28 17:00:43 +0000
+++ src/server/glib_main_loop.cpp 2017-10-27 17:26:09 +0000
@@ -154,7 +154,19 @@
154 detail::add_idle_gsource(main_context, G_PRIORITY_HIGH,154 detail::add_idle_gsource(main_context, G_PRIORITY_HIGH,
155 [this]155 [this]
156 {156 {
157 running = false;157 {
158 std::lock_guard<std::mutex> lock{run_on_halt_mutex};
159 running = false;
160 }
161 // We know any other thread sees running == false here, so don't need
162 // to lock run_on_halt_queue.
163 for (auto& action : run_on_halt_queue)
164 {
165 try { action(); }
166 catch (...) { handle_exception(std::current_exception()); }
167 }
168 run_on_halt_queue.clear();
169
158 g_main_context_wakeup(main_context);170 g_main_context_wakeup(main_context);
159 });171 });
160}172}
@@ -246,6 +258,48 @@
246 });258 });
247}259}
248260
261
262void mir::GLibMainLoop::enqueue_with_guaranteed_execution(mir::ServerAction const& action)
263{
264 auto const action_with_exception_handling =
265 [this]
266 {
267 try
268 {
269 mir::ServerAction action;
270 {
271 std::lock_guard<std::mutex> lock{run_on_halt_mutex};
272 action = run_on_halt_queue.front();
273 run_on_halt_queue.pop_front();
274 }
275 action();
276 }
277 catch (...)
278 {
279 handle_exception(std::current_exception());
280 }
281 };
282
283 {
284 std::lock_guard<std::mutex> lock{run_on_halt_mutex};
285
286 if (!running)
287 {
288 action();
289 return;
290 }
291 else
292 {
293 run_on_halt_queue.push_back(action);
294 }
295 }
296
297 detail::add_idle_gsource(
298 main_context,
299 G_PRIORITY_DEFAULT,
300 action_with_exception_handling);
301}
302
249void mir::GLibMainLoop::pause_processing_for(void const* owner)303void mir::GLibMainLoop::pause_processing_for(void const* owner)
250{304{
251 std::lock_guard<std::mutex> lock{do_not_process_mutex};305 std::lock_guard<std::mutex> lock{do_not_process_mutex};
252306
=== modified file 'src/server/input/default_input_device_hub.cpp'
--- src/server/input/default_input_device_hub.cpp 2017-07-28 17:00:43 +0000
+++ src/server/input/default_input_device_hub.cpp 2017-10-27 17:26:09 +0000
@@ -88,25 +88,26 @@
88 auto observer = obs.lock();88 auto observer = obs.lock();
89 if (observer)89 if (observer)
90 {90 {
91 std::mutex mutex;
92 std::condition_variable cv;91 std::condition_variable cv;
93 std::unique_lock<decltype(mutex)> lock{mutex};92 std::atomic<bool> removed{false};
94 bool removed{false};
9593
96 data->observer_queue->enqueue(94 data->observer_queue->enqueue_with_guaranteed_execution(
97 data.get(),
98 [&,this]95 [&,this]
99 {96 {
100 // Unless remove() is on the same thread as add() external synchronization would be needed97 // Unless remove() is on the same thread as add() external synchronization would be needed
101 data->observers.remove(observer);98 data->observers.remove(observer);
10299
103 std::lock_guard<decltype(mutex)> lock{mutex};100 // We do *not* take a lock and instead rely on removed being atomic,
101 // as enqueue_with_guaranteed_execution may run on our stack.
104 removed = true;102 removed = true;
105 cv.notify_one();103 cv.notify_one();
106 });104 });
107105
106 std::mutex mutex;
107 std::unique_lock<decltype(mutex)> lock{mutex};
108
108 // Before returning wait for the remove - otherwise notifications can still happen109 // Before returning wait for the remove - otherwise notifications can still happen
109 cv.wait(lock, [&] { return removed; });110 cv.wait(lock, [&] { return removed.load(); });
110 }111 }
111}112}
112113
113114
=== modified file 'src/server/shell/default_persistent_surface_store.cpp'
--- src/server/shell/default_persistent_surface_store.cpp 2017-08-14 02:48:54 +0000
+++ src/server/shell/default_persistent_surface_store.cpp 2017-10-27 17:26:09 +0000
@@ -17,7 +17,7 @@
17 */17 */
1818
19#include "default_persistent_surface_store.h"19#include "default_persistent_surface_store.h"
20#include <uuid/uuid.h>20#include <uuid.h>
21#include <algorithm>21#include <algorithm>
22#include <unordered_map>22#include <unordered_map>
23#include <boost/throw_exception.hpp>23#include <boost/throw_exception.hpp>
2424
=== modified file 'src/utils/CMakeLists.txt'
--- src/utils/CMakeLists.txt 2017-05-08 03:04:26 +0000
+++ src/utils/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -10,9 +10,11 @@
10mir_add_wrapped_executable(mirout out.c)10mir_add_wrapped_executable(mirout out.c)
11target_link_libraries(mirout mirclient m)11target_link_libraries(mirout mirclient m)
1212
13if (MIR_EGL_SUPPORTED)
13mir_add_wrapped_executable(mirvanity vanity.c)14mir_add_wrapped_executable(mirvanity vanity.c)
14target_include_directories(mirvanity PRIVATE ${PROJECT_SOURCE_DIR}/examples)15target_include_directories(mirvanity PRIVATE ${PROJECT_SOURCE_DIR}/examples)
15target_link_libraries(mirvanity eglapp)16target_link_libraries(mirvanity eglapp)
17endif()
1618
17mir_add_wrapped_executable(mirin in.cpp)19mir_add_wrapped_executable(mirin in.cpp)
18target_link_libraries(mirin mirclient)20target_link_libraries(mirin mirclient)
1921
=== modified file 'src/utils/run.cpp'
--- src/utils/run.cpp 2017-07-28 17:00:43 +0000
+++ src/utils/run.cpp 2017-10-27 17:26:09 +0000
@@ -85,7 +85,7 @@
85 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir85 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir
86 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir86 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir
87 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme87 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme
88 setenv("SDL_VIDEODRIVER", "mir", true); // configure SDL to use Mir88 setenv("SDL_VIDEODRIVER", "wayland", true); // configure SDL to use Wayland
8989
90 if (auto const client_platform = getenv("MIR_CLIENT_PLATFORM_PATH"))90 if (auto const client_platform = getenv("MIR_CLIENT_PLATFORM_PATH"))
91 setenv("MIR_CLIENT_PLATFORM_PATH", canonicalize(client_platform).c_str(), true);91 setenv("MIR_CLIENT_PLATFORM_PATH", canonicalize(client_platform).c_str(), true);
9292
=== modified file 'tests/CMakeLists.txt'
--- tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
+++ tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -45,6 +45,7 @@
45 ${PROJECT_SOURCE_DIR}/include/platform45 ${PROJECT_SOURCE_DIR}/include/platform
46 ${PROJECT_SOURCE_DIR}/include/miral46 ${PROJECT_SOURCE_DIR}/include/miral
47 ${PROJECT_SOURCE_DIR}/include/server47 ${PROJECT_SOURCE_DIR}/include/server
48 ${MIRSERVER_INCLUDE_DIRS}
48 ${PROJECT_SOURCE_DIR}/include/client49 ${PROJECT_SOURCE_DIR}/include/client
49 ${PROJECT_SOURCE_DIR}/include/common50 ${PROJECT_SOURCE_DIR}/include/common
50 ${PROJECT_SOURCE_DIR}/include/test51 ${PROJECT_SOURCE_DIR}/include/test
@@ -109,9 +110,9 @@
109 mir-test-doubles-platform-static110 mir-test-doubles-platform-static
110 ${Boost_LIBRARIES}111 ${Boost_LIBRARIES}
111 ${GTEST_BOTH_LIBRARIES}112 ${GTEST_BOTH_LIBRARIES}
112 ${GMOCK_LIBRARY}
113PRIVATE113PRIVATE
114 ${GMOCK_MAIN_LIBRARY}114 ${GMOCK_MAIN_LIBRARY}
115 ${GMOCK_LIBRARIES}
115 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.116 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
116)117)
117118
118119
=== modified file 'tests/include/mir/test/doubles/triggered_main_loop.h'
--- tests/include/mir/test/doubles/triggered_main_loop.h 2017-07-28 17:00:43 +0000
+++ tests/include/mir/test/doubles/triggered_main_loop.h 2017-10-27 17:26:09 +0000
@@ -41,6 +41,7 @@
41 void unregister_fd_handler(void const* owner) override;41 void unregister_fd_handler(void const* owner) override;
42 std::unique_ptr<mir::time::Alarm> create_alarm(callback const& call) override;42 std::unique_ptr<mir::time::Alarm> create_alarm(callback const& call) override;
43 void enqueue(void const* owner, ServerAction const& action) override;43 void enqueue(void const* owner, ServerAction const& action) override;
44 void enqueue_with_guaranteed_execution(ServerAction const& action) override;
4445
45 void spawn(std::function<void()>&& work) override;46 void spawn(std::function<void()>&& work) override;
4647
4748
=== modified file 'tests/integration-tests/CMakeLists.txt'
--- tests/integration-tests/CMakeLists.txt 2017-08-25 06:41:20 +0000
+++ tests/integration-tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -69,8 +69,7 @@
6969
70 ${Boost_LIBRARIES}70 ${Boost_LIBRARIES}
71 ${GTEST_BOTH_LIBRARIES}71 ${GTEST_BOTH_LIBRARIES}
72 ${GMOCK_LIBRARY}72 ${GMOCK_LIBRARIES}
73 ${GMOCK_MAIN_LIBRARY}
74 # Mesa platform dependencies73 # Mesa platform dependencies
75 ${DRM_LDFLAGS} ${DRM_LIBRARIES}74 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
76 ${GBM_LDFLAGS} ${GBM_LIBRARIES}75 ${GBM_LDFLAGS} ${GBM_LIBRARIES}
7776
=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
--- tests/mir_test_doubles/CMakeLists.txt 2017-08-25 06:41:20 +0000
+++ tests/mir_test_doubles/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -86,7 +86,7 @@
86 mirserver86 mirserver
8787
88 ${Boost_LIBRARIES}88 ${Boost_LIBRARIES}
89 ${GMOCK_LIBRARY}89 ${GMOCK_LIBRARIES}
90 ${GMOCK_MAIN_LIBRARY}90 ${GMOCK_MAIN_LIBRARY}
91 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.91 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
92)92)
@@ -104,7 +104,7 @@
104 mir-test-doubles-platform-static104 mir-test-doubles-platform-static
105105
106 -ldl106 -ldl
107 ${GMOCK_LIBRARY}107 ${GMOCK_LIBRARIES}
108 ${GMOCK_MAIN_LIBRARY}108 ${GMOCK_MAIN_LIBRARY}
109 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.109 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
110)110)
111111
=== modified file 'tests/mir_test_doubles/triggered_main_loop.cpp'
--- tests/mir_test_doubles/triggered_main_loop.cpp 2017-07-28 17:00:43 +0000
+++ tests/mir_test_doubles/triggered_main_loop.cpp 2017-10-27 17:26:09 +0000
@@ -81,6 +81,12 @@
81 actions.push_back(action);81 actions.push_back(action);
82}82}
8383
84void mtd::TriggeredMainLoop::enqueue_with_guaranteed_execution(ServerAction const& action)
85{
86 base::enqueue(nullptr, action);
87 actions.push_back(action);
88}
89
84void mtd::TriggeredMainLoop::trigger_server_actions()90void mtd::TriggeredMainLoop::trigger_server_actions()
85{91{
86 for (auto const& action : actions)92 for (auto const& action : actions)
8793
=== modified file 'tests/mir_test_framework/CMakeLists.txt'
--- tests/mir_test_framework/CMakeLists.txt 2017-09-25 13:39:41 +0000
+++ tests/mir_test_framework/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -85,11 +85,11 @@
8585
86target_link_libraries(mir-test-framework-static86target_link_libraries(mir-test-framework-static
8787
88 mirserver
88 mirclient89 mirclient
89 ${Boost_LIBRARIES}90 ${Boost_LIBRARIES}
90 ${GTEST_BOTH_LIBRARIES}91 ${GTEST_BOTH_LIBRARIES}
91 ${GMOCK_LIBRARY}92 ${GMOCK_LIBRARIES}
92 ${GMOCK_MAIN_LIBRARY}
93 ${UMOCKDEV_LIBRARIES}93 ${UMOCKDEV_LIBRARIES}
94 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.94 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
95)95)
9696
=== modified file 'tests/mir_test_framework/canonical_window_manager.cpp'
--- tests/mir_test_framework/canonical_window_manager.cpp 2017-08-30 11:59:08 +0000
+++ tests/mir_test_framework/canonical_window_manager.cpp 2017-10-27 17:26:09 +0000
@@ -24,7 +24,7 @@
24#include "mir/shell/surface_ready_observer.h"24#include "mir/shell/surface_ready_observer.h"
25#include "mir/shell/display_layout.h"25#include "mir/shell/display_layout.h"
2626
27#include <uuid/uuid.h>27#include <uuid.h>
28#include <linux/input.h>28#include <linux/input.h>
29#include <csignal>29#include <csignal>
3030
3131
=== modified file 'tests/miral/drag_and_drop.cpp'
--- tests/miral/drag_and_drop.cpp 2017-08-23 16:15:03 +0000
+++ tests/miral/drag_and_drop.cpp 2017-10-27 17:26:09 +0000
@@ -41,7 +41,7 @@
41#include <gtest/gtest.h>41#include <gtest/gtest.h>
4242
43#include <linux/input.h>43#include <linux/input.h>
44#include <uuid/uuid.h>44#include <uuid.h>
4545
46#include <boost/throw_exception.hpp>46#include <boost/throw_exception.hpp>
47#include <atomic>47#include <atomic>
4848
=== modified file 'tests/performance-tests/CMakeLists.txt'
--- tests/performance-tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
+++ tests/performance-tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -28,8 +28,8 @@
28 test_compositor.cpp28 test_compositor.cpp
29)29)
30target_link_libraries(mir_compositor_performance_test30target_link_libraries(mir_compositor_performance_test
31 mir_system_performance_test
31 ${GTEST_BOTH_LIBRARIES}32 ${GTEST_BOTH_LIBRARIES}
32 mir_system_performance_test
33)33)
3434
35mir_add_wrapped_executable(mir_client_startup_performance_test35mir_add_wrapped_executable(mir_client_startup_performance_test
3636
=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt 2017-09-07 05:58:13 +0000
+++ tests/unit-tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
@@ -136,8 +136,7 @@
136136
137 ${PROTOBUF_LITE_LIBRARIES}137 ${PROTOBUF_LITE_LIBRARIES}
138 ${GTEST_BOTH_LIBRARIES}138 ${GTEST_BOTH_LIBRARIES}
139 ${GMOCK_LIBRARY}139 ${GMOCK_LIBRARIES}
140 ${GMOCK_MAIN_LIBRARY}
141 ${Boost_LIBRARIES}140 ${Boost_LIBRARIES}
142 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.141 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
143)142)
@@ -176,8 +175,7 @@
176175
177 ${PROTOBUF_LITE_LIBRARIES}176 ${PROTOBUF_LITE_LIBRARIES}
178 ${GTEST_BOTH_LIBRARIES}177 ${GTEST_BOTH_LIBRARIES}
179 ${GMOCK_LIBRARY}178 ${GMOCK_LIBRARIES}
180 ${GMOCK_MAIN_LIBRARY}
181 ${Boost_LIBRARIES}179 ${Boost_LIBRARIES}
182 ${UMOCKDEV_LIBRARIES}180 ${UMOCKDEV_LIBRARIES}
183 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.181 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
184182
=== modified file 'tests/unit-tests/platforms/mesa/kms/test_cursor.cpp'
--- tests/unit-tests/platforms/mesa/kms/test_cursor.cpp 2017-07-31 08:58:34 +0000
+++ tests/unit-tests/platforms/mesa/kms/test_cursor.cpp 2017-10-27 17:26:09 +0000
@@ -24,7 +24,6 @@
24#include "mir/graphics/cursor_image.h"24#include "mir/graphics/cursor_image.h"
2525
26#include <xf86drm.h>26#include <xf86drm.h>
27#include <drm/drm.h>
2827
29#include "mir/test/doubles/mock_gbm.h"28#include "mir/test/doubles/mock_gbm.h"
30#include "mir/test/doubles/mock_drm.h"29#include "mir/test/doubles/mock_drm.h"
@@ -265,7 +264,7 @@
265 {264 {
266 return geom::Size{geom::Width{64}, geom::Height{64}};265 return geom::Size{geom::Width{64}, geom::Height{64}};
267 }266 }
268 geom::Displacement hotspot() const 267 geom::Displacement hotspot() const
269 {268 {
270 return geom::Displacement{0, 0};269 return geom::Displacement{0, 0};
271 }270 }
@@ -425,7 +424,7 @@
425 if (pixels[i] != 0x0)424 if (pixels[i] != 0x0)
426 return false;425 return false;
427 }426 }
428 return true; 427 return true;
429}428}
430429
431TEST_F(MesaCursorTest, show_cursor_pads_missing_data)430TEST_F(MesaCursorTest, show_cursor_pads_missing_data)
@@ -680,7 +679,7 @@
680679
681 cursor.hide();680 cursor.hide();
682 cursor.move_to({17, 29});681 cursor.move_to({17, 29});
683 682
684 output_container.verify_and_clear_expectations();683 output_container.verify_and_clear_expectations();
685}684}
686685
@@ -772,7 +771,7 @@
772 cursor.show(stub_image); // ensures initial_cursor_location771 cursor.show(stub_image); // ensures initial_cursor_location
773772
774 static geom::Displacement hotspot_displacement{10, 10};773 static geom::Displacement hotspot_displacement{10, 10};
775 774
776 static geom::Point const775 static geom::Point const
777 initial_cursor_location = {0, 0},776 initial_cursor_location = {0, 0},
778 cursor_location_1 = {20, 20},777 cursor_location_1 = {20, 20},
@@ -788,8 +787,8 @@
788 return hotspot_displacement;787 return hotspot_displacement;
789 }788 }
790 };789 };
791 790
792 791
793 EXPECT_CALL(mock_gbm, gbm_bo_write(_, _, _)).Times(AnyNumber());792 EXPECT_CALL(mock_gbm, gbm_bo_write(_, _, _)).Times(AnyNumber());
794 EXPECT_CALL(*output_container.outputs[0], set_cursor(_)).Times(AnyNumber());793 EXPECT_CALL(*output_container.outputs[0], set_cursor(_)).Times(AnyNumber());
795794
796795
=== modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp'
--- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-08-25 06:41:20 +0000
+++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-10-27 17:26:09 +0000
@@ -155,7 +155,7 @@
155 auto edid_size = mir_output_get_edid_size(output);155 auto edid_size = mir_output_get_edid_size(output);
156156
157 ASSERT_NE(nullptr, edid_start);157 ASSERT_NE(nullptr, edid_start);
158 ASSERT_NE(0, edid_size);158 ASSERT_NE(0u, edid_size);
159159
160 std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size);160 std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size);
161161
162162
=== modified file 'tests/unit-tests/scene/test_mediating_display_changer.cpp'
--- tests/unit-tests/scene/test_mediating_display_changer.cpp 2017-08-09 11:30:59 +0000
+++ tests/unit-tests/scene/test_mediating_display_changer.cpp 2017-10-27 17:26:09 +0000
@@ -100,6 +100,10 @@
100 {100 {
101 action();101 action();
102 }102 }
103 void enqueue_with_guaranteed_execution(mir::ServerAction const& action) override
104 {
105 action();
106 }
103107
104 void pause_processing_for(void const* /*owner*/) override {}108 void pause_processing_for(void const* /*owner*/) override {}
105 void resume_processing_for(void const* /*owner*/) override {}109 void resume_processing_for(void const* /*owner*/) override {}
@@ -110,8 +114,10 @@
110 MockServerActionQueue()114 MockServerActionQueue()
111 {115 {
112 ON_CALL(*this, enqueue(_, _)).WillByDefault(InvokeArgument<1>());116 ON_CALL(*this, enqueue(_, _)).WillByDefault(InvokeArgument<1>());
117 ON_CALL(*this, enqueue_with_guaranteed_execution(_)).WillByDefault(InvokeArgument<0>());
113 }118 }
114 MOCK_METHOD2(enqueue, void(void const*, mir::ServerAction const&));119 MOCK_METHOD2(enqueue, void(void const*, mir::ServerAction const&));
120 MOCK_METHOD1(enqueue_with_guaranteed_execution, void(mir::ServerAction const&));
115 MOCK_METHOD1(pause_processing_for, void(void const*));121 MOCK_METHOD1(pause_processing_for, void(void const*));
116 MOCK_METHOD1(resume_processing_for, void(void const*));122 MOCK_METHOD1(resume_processing_for, void(void const*));
117};123};
118124
=== modified file 'tests/unit-tests/test_glib_main_loop.cpp'
--- tests/unit-tests/test_glib_main_loop.cpp 2017-07-28 17:00:43 +0000
+++ tests/unit-tests/test_glib_main_loop.cpp 2017-10-27 17:26:09 +0000
@@ -833,6 +833,76 @@
833 destroy_glib_main_loop);833 destroy_glib_main_loop);
834}834}
835835
836TEST_F(GLibMainLoopTest, enqueue_with_guaranteed_execution_executes_before_run)
837{
838 using namespace testing;
839
840 int num_actions{0};
841
842 ml.enqueue_with_guaranteed_execution(
843 [&num_actions]
844 {
845 ++num_actions;
846 });
847
848 EXPECT_THAT(num_actions, Eq(1));
849}
850
851TEST_F(GLibMainLoopTest, enqueue_with_guaranteed_execution_executes_after_stop)
852{
853 using namespace testing;
854
855 int num_actions{0};
856
857 ml.enqueue(
858 nullptr,
859 [this]()
860 {
861 ml.stop();
862 });
863
864 ml.run();
865
866 ml.enqueue_with_guaranteed_execution(
867 [&num_actions]
868 {
869 ++num_actions;
870 });
871
872 EXPECT_THAT(num_actions, Eq(1));
873}
874
875TEST_F(GLibMainLoopTest, enqueue_with_guaranteed_execution_executes_on_mainloop)
876{
877 using namespace testing;
878
879 mt::Signal loop_running;
880 mt::Signal loop_finished;
881
882 ml.enqueue(
883 nullptr,
884 [&loop_running]() { loop_running.raise(); });
885
886 mt::AutoJoinThread t{
887 [&]
888 {
889 ml.run();
890 loop_finished.raise();
891 }};
892
893 ASSERT_TRUE(loop_running.wait_for(std::chrono::seconds{5}));
894
895 ml.enqueue_with_guaranteed_execution(
896 [main_thread = std::this_thread::get_id()]()
897 {
898 EXPECT_THAT(std::this_thread::get_id(), Ne(main_thread));
899 });
900
901 ml.stop();
902
903 EXPECT_TRUE(loop_finished.wait_for(std::chrono::seconds{30}));
904}
905
836namespace906namespace
837{907{
838908
839909
=== modified file 'tests/unit-tests/test_raii.cpp'
--- tests/unit-tests/test_raii.cpp 2017-07-28 17:00:43 +0000
+++ tests/unit-tests/test_raii.cpp 2017-10-27 17:26:09 +0000
@@ -21,6 +21,8 @@
21#include <gtest/gtest.h>21#include <gtest/gtest.h>
22#include <gmock/gmock.h>22#include <gmock/gmock.h>
2323
24#include <functional>
25
24namespace26namespace
25{27{
26struct RaiiTest : public ::testing::Test28struct RaiiTest : public ::testing::Test
2729
=== removed file 'tools/abi_check.sh'
--- tools/abi_check.sh 2017-05-08 03:04:26 +0000
+++ tools/abi_check.sh 1970-01-01 00:00:00 +0000
@@ -1,315 +0,0 @@
1#!/bin/bash
2
3set -e
4
5declare -A abi_var_for=(\
6 ["mircore"]="MIRCORE_ABI" \
7 ["mirclient"]="MIRCLIENT_ABI" \
8 ["mircommon"]="MIRCOMMON_ABI" \
9 ["mirplatform"]="MIRPLATFORM_ABI" \
10 ["mirserver"]="MIRSERVER_ABI" \
11 ["mircookie"]="MIRCOOKIE_ABI" \
12 ["mirclientplatformmesa"]="MIR_CLIENT_PLATFORM_ABI" \
13 ["mirplatformgraphicsmesakms"]="MIR_SERVER_GRAPHICS_PLATFORM_ABI" \
14 ["mirplatforminputevdev"]="MIR_SERVER_INPUT_PLATFORM_ABI" )
15
16declare -A libtype=(\
17 ["mirclientplatformmesa"]="plugin-client" \
18 ["mirplatformgraphicsmesakms"]="plugin" \
19 ["mirplatforminputevdev"]="plugin" )
20
21declare -A package_name=(\
22 ["mirclientplatformmesa"]="mir-client-platform-mesa" \
23 ["mirplatformgraphicsmesakms"]="mir-platform-graphics-mesa-kms" \
24 ["mirplatforminputevdev"]="mir-platform-input-evdev" )
25
26declare -A libsoname=(\
27 ["mirclientplatformmesa"]="mir/client-platform/mesa" \
28 ["mirplatformgraphicsmesakms"]="mir/server-platform/graphics-mesa-kms" \
29 ["mirplatforminputevdev"]="mir/server-platform/input-evdev" )
30
31declare -A headers_for=(\
32 ["mirclientplatformmesa"]="src/include/client/mir/client_platform_factory.h" \
33 ["mirplatformgraphicsmesakms"]="mirplatform/mir/graphics/platform.h" \
34 ["mirplatforminputevdev"]="mirplatform/mir/input" )
35
36declare -A exclusions_for=(\
37 ["mirplatform"]="mir/input" \
38 ["mirserver"]="mir/input/input_device_hub.h" )
39
40function print_help_and_exit()
41{
42 local prog=$(basename $0)
43
44 local all_libs=${!abi_var_for[@]}
45 local all_libs=${all_libs// /|}
46 echo "Usage: $prog <libname> <abi_dump_dir> <source_dir>"
47 echo "Runs a full ABI check on the given library."
48 echo ""
49 echo " libname=[${all_libs}]"
50 exit 0
51}
52
53function get_abi_number()
54{
55 local abi_var=${1}
56 local search_dir=${2}
57 grep -hR --include=CMakeLists.txt "set($abi_var [[:digit:]]\+)" ${search_dir}/src | grep -o '[[:digit:]]\+'
58}
59
60function is_plugin()
61{
62 local name=${1}
63 if [[ ${libtype[${name}]} == "plugin"* ]];
64 then
65 return 0
66 else
67 return 1
68 fi
69}
70
71function package_abi_for()
72{
73 local name=${1}
74 local pkg_name=lib${name}
75
76 if is_plugin ${name};
77 then
78 pkg_name=${package_name[${name}]}
79 fi
80
81 apt-cache show ${pkg_name}* | grep Package: | grep -o '[[:digit:]]\+' | sort -n -r | head -n 1
82}
83
84function needs_abi_check()
85{
86 local name=${1}
87 local source_dir=${2}
88 local abi_var=${abi_var_for[${name}]}
89
90 local old_abi=$(package_abi_for ${name})
91 local new_abi=$(get_abi_number ${abi_var} ${source_dir})
92 if [ -z "${old_abi}" ];
93 then
94 echo "Failed to find old ${abi_var}" >&2
95 exit 1
96 fi
97
98 if [ -z "${new_abi}" ];
99 then
100 echo "Failed to find new ${abi_var}" >&2
101 exit 1
102 fi
103 echo "Detected ${abi_var}_new=${new_abi}"
104 echo "Detected ${abi_var}_old=${old_abi}"
105
106 if [ "${old_abi}" == "${new_abi}" ];
107 then
108 return 0
109 else
110 return 1
111 fi
112}
113
114function prepare_pkg_dir()
115{
116 local pkg_dir=${1}
117
118 # "partial" is required by apt-get
119 mkdir -p ${pkg_dir}/partial
120}
121
122function package_name_for()
123{
124 local name=${1}
125 local pkg_name=lib${name}
126
127 if is_plugin ${name};
128 then
129 pkg_name=${package_name[${name}]}
130 fi
131
132 local abi_number=$(package_abi_for ${name})
133 echo ${pkg_name}${abi_number}
134}
135
136function header_packages_for()
137{
138 local name=${1}
139 local pkg=lib${name}-dev
140
141 if is_plugin ${name};
142 then
143 # Some plugin headers are defined in this package
144 pkg="libmirplatform-dev"
145 fi
146
147 # Only interested in other mir dev package deps
148 local dev_deps=$(apt-cache depends ${pkg} | grep Depends: | grep -o "\<libmir.*-dev\>"| tr '\n' ' ')
149
150 # Workaround missing dependency
151 if [ ${name} == "mirserver" ] || [ ${name} == "mirplatforminputevdev" ];
152 then
153 dev_deps="${dev_deps} libmirclient-dev"
154 fi
155
156 echo "${pkg} ${dev_deps}"
157}
158
159function soname_for()
160{
161 local name=${1}
162 local pkg_dir=${2}
163 local arch=$(gcc -dumpmachine)
164 local abi_number=$(package_abi_for ${name})
165 local so_name=lib${name}
166
167 if is_plugin ${name};
168 then
169 so_name=${libsoname[${name}]}
170 fi
171
172 echo ${pkg_dir}/usr/lib/${arch}/${so_name}.so.${abi_number}
173}
174
175function download_packages()
176{
177 local name=${1}
178 local pkg_dir=${2}
179 local pkg_name=$(package_name_for ${name})
180 local header_pkgs=$(header_packages_for ${name})
181
182 echo "Downloading: ${pkg_name} ${header_pkgs} for ${name}"
183 apt-get -d -o Dir::Cache=${pkg_dir} -o Debug::NoLocking=1 install --reinstall -y ${pkg_name} ${header_pkgs}
184}
185
186function download_mir_source_into()
187{
188 local pkg_dir=${1}
189 pushd ${pkg_dir} > /dev/null
190
191 apt-get source --download-only mir
192 mkdir -p mirsource
193
194 local src_pkg=$(apt-cache showsrc mir | grep -o "mir.*orig.tar.gz" | head -n 1)
195 tar xf ${src_pkg} -C mirsource --strip-components 1
196
197 popd > /dev/null
198}
199
200function unpack_debs()
201{
202 local pkg_dir=${1}
203
204 for deb in ${pkg_dir}/archives/* ;
205 do
206 if [ ! -d ${deb} ] ; then
207 echo "unpacking: ${deb}"
208 dpkg -x ${deb} ${pkg_dir}
209 fi
210 done
211}
212
213function make_lib_descriptor()
214{
215 local name=${1}
216 local pkg_dir=${2}
217 local descriptor_file=${3}
218
219 local abi_number=$(package_abi_for ${name})
220 local lib=$(soname_for ${name} ${pkg_dir})
221
222 local lib_includes=
223 for path in $(ls ${pkg_dir}/usr/include);
224 do
225 lib_includes=${lib_includes}${pkg_dir}/usr/include/${path}"\n"
226 done
227
228 local lib_headers=${pkg_dir}/usr/include/${name}
229 local lib_skip_headers=
230 for path in ${exclusions_for[${name}]};
231 do
232 lib_skip_headers=${lib_excludes}${pkg_dir}/usr/include/${name}/${path}"\n"
233 done
234
235 if [ "${libtype[${name}]}" == "plugin-client" ];
236 then
237 download_mir_source_into ${pkg_dir}
238 lib_headers=${pkg_dir}/mirsource/${headers_for[${name}]}
239 elif [ "${libtype[${name}]}" == "plugin" ];
240 then
241 lib_headers=${pkg_dir}/usr/include/${headers_for[${name}]}
242 fi
243
244 cp ${SOURCE_DIR}/tools/lib_descriptor.xml.skel ${descriptor_file}
245 sed -i 's@${LIB_DESC_LIBS}@'${lib}'@g' ${descriptor_file}
246 sed -i 's@${LIB_DESC_HEADERS}@'${lib_headers}'@g' ${descriptor_file}
247 sed -i 's@${LIB_DESC_INCLUDE_PATHS}@'${lib_includes}'@g' ${descriptor_file}
248 sed -i 's/${LIB_DESC_GCC_OPTS}/-std=c++14/g' ${descriptor_file}
249 sed -i 's@${LIB_DESC_SKIP_HEADERS}@'${lib_skip_headers}'@g' ${descriptor_file}
250 sed -i 's/${LIB_DESC_DEFINES}//g' ${descriptor_file}
251}
252
253function dump_abi_for_prev_release()
254{
255 local name=${1}
256 local abi_dump_dir=${2}
257 local abi_dump=${3}
258 local pkg_dir=${abi_dump_dir}/prev-release-pkgs
259
260 if [ ! -s "${abi_dump}" ];
261 then
262 echo "Generating ${abi_dump}"
263 prepare_pkg_dir ${pkg_dir}
264 download_packages ${name} ${pkg_dir}
265 unpack_debs ${pkg_dir}
266
267 local descriptor_file=${pkg_dir}/${name}_desc.xml
268 make_lib_descriptor ${name} ${pkg_dir} ${descriptor_file}
269
270 abi-compliance-checker -gcc-path g++ -l ${name} -v1 previous -dump-path ${abi_dump} -dump-abi ${descriptor_file}
271 fi
272
273 if [ ! -s "${abi_dump}" ];
274 then
275 echo "Error: failed to generate abi dump for ${name}"
276 exit 1;
277 fi
278}
279
280function run_abi_check()
281{
282 local name=${1}
283 local old_dump=${2}
284 local new_dump=${3}
285 local skip_symbols_file=${4}
286
287 if [ -f ${skip_symbols_file} ];
288 then
289 local skip_symbols_opt="-skip-symbols ${skip_symbols_file}"
290 fi
291
292 echo "Running abi-compliance-checker for ${name}"
293 abi-compliance-checker -l ${NAME} -old "${old_dump}" -new "${new_dump}" ${skip_symbols_opt}
294}
295
296if [ $# -ne 3 ];
297then
298 print_help_and_exit
299fi
300
301NAME=${1}
302ABI_DUMP_DIR=${2}
303SOURCE_DIR=${3}
304
305OLD_ABI_DUMP_FILE=${ABI_DUMP_DIR}/${NAME}_prev.abi.tar.gz
306NEW_ABI_DUMP_FILE=${ABI_DUMP_DIR}/${NAME}_next.abi.tar.gz
307SKIP_SYMBOLS_FILE=${SOURCE_DIR}/tools/abi-check-${NAME}-skip-symbols
308
309if needs_abi_check ${NAME} ${SOURCE_DIR};
310then
311 dump_abi_for_prev_release ${NAME} ${ABI_DUMP_DIR} ${OLD_ABI_DUMP_FILE}
312 run_abi_check ${NAME} ${OLD_ABI_DUMP_FILE} ${NEW_ABI_DUMP_FILE} ${SKIP_SYMBOLS_FILE}
313else
314 echo "No need for abi-compliance-checker, ABI has already been bumped for ${NAME}"
315fi
3160
=== modified file 'tools/setup-partial-armhf-chroot.sh'
--- tools/setup-partial-armhf-chroot.sh 2017-05-08 03:04:26 +0000
+++ tools/setup-partial-armhf-chroot.sh 2017-10-27 17:26:09 +0000
@@ -10,9 +10,9 @@
10usage() {10usage() {
11 echo "Usage: ${name} [options] mychroot-dir"11 echo "Usage: ${name} [options] mychroot-dir"
12 echo "options:"12 echo "options:"
13 echo " -a arch Select architecture, i.e. armhf, arm64, ppc... Default is armhf"13 echo " -a arch Select architecture, i.e. armhf, arm64, ppc... Default is armhf"
14 echo " -d dist Select distribution, i.e. vivid, wily. Default is vivid"14 echo " -d dist Select distribution, i.e. vivid, wily. Default is vivid"
15 echo " -r rep Select an additional repository for bootstrap. Default is none"15 echo " -r rep Select an additional repository for bootstrap. Default is none"
16 echo16 echo
17 echo "please supply at least a directory to create partial chroot in. (eg, ./setup-partial-armhf-chroot.sh mychroot-dir)"17 echo "please supply at least a directory to create partial chroot in. (eg, ./setup-partial-armhf-chroot.sh mychroot-dir)"
18}18}
@@ -39,7 +39,7 @@
39 sources="$sources source$sourceid"39 sources="$sources source$sourceid"
40 ;;40 ;;
41 :)41 :)
42 echo "Option -$OPTARG requires an argument" 42 echo "Option -$OPTARG requires an argument"
43 usage43 usage
44 exit 144 exit 1
45 ;;45 ;;
@@ -48,7 +48,7 @@
48 exit 048 exit 0
49 ;;49 ;;
50 \?)50 \?)
51 echo "Invalid option: -$OPTARG" 51 echo "Invalid option: -$OPTARG"
52 usage52 usage
53 exit 153 exit 1
54 ;;54 ;;
@@ -66,7 +66,7 @@
66echo "creating phablet-compatible $arch partial chroot for mir compilation in directory ${directory}"66echo "creating phablet-compatible $arch partial chroot for mir compilation in directory ${directory}"
6767
68if [ ! -d ${directory} ]; then68if [ ! -d ${directory} ]; then
69 mkdir -p ${directory} 69 mkdir -p ${directory}
70fi70fi
7171
72DEBCONTROL=$(pwd)/../debian/control72DEBCONTROL=$(pwd)/../debian/control
@@ -83,7 +83,7 @@
83# dpkg-checkbuilddeps returns non-zero when dependencies are not met and the list is sent to stderr83# dpkg-checkbuilddeps returns non-zero when dependencies are not met and the list is sent to stderr
84builddeps=$(dpkg-checkbuilddeps -a ${arch} --admindir=. ${DEBCONTROL} 2>&1 )84builddeps=$(dpkg-checkbuilddeps -a ${arch} --admindir=. ${DEBCONTROL} 2>&1 )
85if [ $? -eq 0 ] ; then85if [ $? -eq 0 ] ; then
86 exit 0 86 exit 0
87fi87fi
88echo "${builddeps}"88echo "${builddeps}"
8989
@@ -97,7 +97,6 @@
97 -e 's/Unmet build dependencies://g' \97 -e 's/Unmet build dependencies://g' \
98 -e 's/build-essential:native//g')98 -e 's/build-essential:native//g')
99builddeps=$(echo ${builddeps} | sed 's/([^)]*)//g')99builddeps=$(echo ${builddeps} | sed 's/([^)]*)//g')
100builddeps=$(echo ${builddeps} | sed -e 's/abi-compliance-checker//g')
101builddeps=$(echo ${builddeps} | sed -e 's/multistrap//g')100builddeps=$(echo ${builddeps} | sed -e 's/multistrap//g')
102101
103case ${arch} in102case ${arch} in
@@ -143,7 +142,7 @@
143done142done
144143
145# Fakeroot is required to stop the apt update command giving up144# Fakeroot is required to stop the apt update command giving up
146fakeroot multistrap -f mstrap.conf 145fakeroot multistrap -f mstrap.conf
147146
148rm -f var/cache/apt/archives/lock147rm -f var/cache/apt/archives/lock
149148
@@ -163,4 +162,4 @@
163 ln -sf $(pwd)$(readlink ${broken_symlink}) ${broken_symlink}162 ln -sf $(pwd)$(readlink ${broken_symlink}) ${broken_symlink}
164done163done
165164
166popd > /dev/null 165popd > /dev/null

Subscribers

People subscribed via source and target branches