Mir

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

Proposed by Alan Griffiths on 2017-10-26
Status: Merged
Approved by: Alan Griffiths on 2017-10-30
Approved revision: 1311
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 on 2017-10-30
Mir CI Bot continuous-integration 2017-10-26 Approve on 2017-10-27
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.
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)
1309. By Alan Griffiths on 2017-10-27

Make frame_uniformity_test_client link command what it actually used to be

1310. By Alan Griffiths on 2017-10-27

Remove unused mir-test-assist library

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)
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
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)
1311. By Alan Griffiths on 2017-10-27

Try to find default font at runtime, not build time

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)
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
Alan Griffiths (alan-griffiths) wrote :

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

review: Needs Fixing
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.)

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
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
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2017-10-11 15:00:09 +0000
3+++ CMakeLists.txt 2017-10-27 17:26:09 +0000
4@@ -1,4 +1,4 @@
5-# Copyright © 2012 Canonical Ltd.
6+# Copyright © 2012-2017 Canonical Ltd.
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2 or 3 as
10@@ -29,7 +29,7 @@
11
12 set(MIR_VERSION_MAJOR 0)
13 set(MIR_VERSION_MINOR 28)
14-set(MIR_VERSION_PATCH 0)
15+set(MIR_VERSION_PATCH 1)
16
17 add_definitions(-DMIR_VERSION_MAJOR=${MIR_VERSION_MAJOR})
18 add_definitions(-DMIR_VERSION_MINOR=${MIR_VERSION_MINOR})
19@@ -275,6 +275,16 @@
20 pkg_check_modules(DRM REQUIRED libdrm)
21 endif()
22
23+# This incantation gets the MIR_EGL_SUPPORTED default right for Mesa
24+execute_process(COMMAND grep mir_toolkit /usr/include/EGL/eglplatform.h
25+ OUTPUT_VARIABLE MIR_EGL_SUPPORTED_OUT)
26+
27+if (MIR_EGL_SUPPORTED_OUT STREQUAL "")
28+ option(MIR_EGL_SUPPORTED "Build examples that depend on Mir EGL." OFF)
29+else()
30+ option(MIR_EGL_SUPPORTED "Build examples that depend on Mir EGL." ON)
31+endif()
32+
33 set(MIR_TRACEPOINT_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/mir/tools)
34
35 set(MIR_GENERATED_INCLUDE_DIRECTORIES)
36@@ -288,9 +298,10 @@
37 add_definitions(-DMIR_LIBINPUT_HAS_ACCEL_PROFILE=1)
38 endif ()
39
40-add_subdirectory(benchmarks/)
41 add_subdirectory(examples/)
42-add_subdirectory(playground/)
43+if (MIR_EGL_SUPPORTED)
44+ add_subdirectory(playground/)
45+endif()
46 add_subdirectory(guides/)
47 add_subdirectory(cmake/)
48
49@@ -299,6 +310,7 @@
50 pkg_check_modules(LIBEVDEV REQUIRED libevdev)
51 include_directories(${GMOCK_INCLUDE_DIR} ${GTEST_INCLUDE_DIR})
52 add_subdirectory(tests/)
53+ add_subdirectory(benchmarks/)
54
55 # There's no nice way to format this. Thanks CMake.
56 mir_add_test(NAME LGPL-required
57@@ -313,7 +325,6 @@
58 endif ()
59
60 enable_coverage_report(mirserver)
61-include (cmake/ABICheck.cmake)
62
63 add_custom_target(ptest
64 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"
65
66=== modified file 'benchmarks/frame-uniformity/CMakeLists.txt'
67--- benchmarks/frame-uniformity/CMakeLists.txt 2017-08-25 06:41:20 +0000
68+++ benchmarks/frame-uniformity/CMakeLists.txt 2017-10-27 17:26:09 +0000
69@@ -28,8 +28,6 @@
70 mirserver
71 mirclient
72 mirplatform
73-
74- mir-test-assist
75
76 # needed for fake_event_hub_server_configuration.h (which relies on private APIs)
77 mir-test-framework-static
78@@ -37,9 +35,5 @@
79 # needed for vsync_simulating_graphics_platform.cpp
80 mir-test-doubles-static
81
82- ${Boost_LIBRARIES}
83- ${GTEST_BOTH_LIBRARIES}
84- ${GMOCK_LIBRARY}
85- ${GMOCK_MAIN_LIBRARY}
86 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
87 )
88
89=== removed file 'cmake/ABICheck.cmake'
90--- cmake/ABICheck.cmake 2017-05-08 03:04:26 +0000
91+++ cmake/ABICheck.cmake 1970-01-01 00:00:00 +0000
92@@ -1,114 +0,0 @@
93-cmake_minimum_required (VERSION 2.6)
94-
95-find_program(ABI_COMPLIANCE_CHECKER abi-compliance-checker)
96-if (NOT ABI_COMPLIANCE_CHECKER)
97- message(WARNING "no ABI checks possible: abi-compliance-checker was not found")
98- return()
99-endif()
100-
101-set(ENABLE_ABI_CHECK_TEST $ENV{MIR_ENABLE_ABI_CHECK_TEST})
102-execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE ABI_CHECK_TARGET_MACH OUTPUT_STRIP_TRAILING_WHITESPACE)
103-
104-set(ABI_DUMPS_DIR "${CMAKE_BINARY_DIR}/abi_dumps/${ABI_CHECK_TARGET_MACH}")
105-
106-# Given a list of key value pairs such as "key1 value1 key2 value2...keyN valueN"
107-# extract the value corresponding to the given key
108-function(get_value_for_key a_list key value)
109- list(FIND a_list ${key} idx)
110- if (idx GREATER -1)
111- math(EXPR idx "${idx} + 1")
112- list(GET a_list ${idx} tmp_value)
113- set(${value} "${tmp_value}" PARENT_SCOPE)
114- endif()
115-endfunction()
116-
117-# Makes a one-entry per line list of all include paths used
118-# to compile the given library target
119-function(get_includes libname output)
120- get_property(lib_includes TARGET ${libname} PROPERTY INCLUDE_DIRECTORIES)
121- list(REMOVE_DUPLICATES lib_includes)
122- string(REPLACE ";" "\n " tmp_out "${lib_includes}")
123- set(${output} "${tmp_out}" PARENT_SCOPE)
124-endfunction()
125-
126-# Creates the XML descriptor file that describes the given library target
127-# suitable for abi-compliance-checker
128-function(make_lib_descriptor name)
129- set(libname "mir${name}")
130-
131- # Optional argument LIBRARY_HEADER - use the given header to describe
132- # the binary library instead of assuming its described by include/<name>
133- get_value_for_key("${ARGN}" "LIBRARY_HEADER" library_header)
134- if ("${library_header}" STREQUAL "")
135- set(LIB_DESC_HEADERS "${CMAKE_SOURCE_DIR}/include/${name}\n ${private_headers}")
136- else()
137- set(LIB_DESC_HEADERS ${library_header})
138- endif()
139-
140- # FIXME: Property "LOCATION" is now deprecated
141- if (NOT ${CMAKE_MAJOR_VERSION} LESS 3)
142- cmake_policy(SET CMP0026 OLD)
143- endif()
144- get_property(LIB_DESC_LIBS TARGET ${libname} PROPERTY LOCATION)
145-
146- get_includes(${libname} LIB_DESC_INCLUDE_PATHS)
147- set(LIB_DESC_GCC_OPTS "${CMAKE_CXX_FLAGS}")
148-
149- # Optional EXCLUDE_HEADERS - a list
150- # while attempting an abi dump
151- get_value_for_key("${ARGN}" "EXCLUDE_HEADERS" LIB_DESC_SKIP_HEADERS)
152-
153- configure_file(${CMAKE_SOURCE_DIR}/tools/lib_descriptor.xml.skel ${libname}_desc.xml)
154-endfunction()
155-
156-#These headers are not part of the libmirplatform ABI
157-set(mirplatform-exclude-headers "${CMAKE_SOURCE_DIR}/include/platform/mir/input")
158-
159-make_lib_descriptor(core)
160-make_lib_descriptor(client)
161-make_lib_descriptor(server)
162-make_lib_descriptor(common)
163-make_lib_descriptor(cookie)
164-make_lib_descriptor(platform EXCLUDE_HEADERS ${mirplatform-exclude-headers})
165-if(MIR_BUILD_PLATFORM_MESA_KMS)
166-make_lib_descriptor(clientplatformmesa LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/src/include/client/mir/client_platform_factory.h)
167-make_lib_descriptor(platformgraphicsmesakms LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/graphics/platform.h)
168-endif()
169-make_lib_descriptor(platforminputevdev LIBRARY_HEADER ${CMAKE_SOURCE_DIR}/include/platform/mir/input/)
170-
171-
172-macro(_define_abi_dump_for libname)
173- set(ABI_DUMP_NAME ${ABI_DUMPS_DIR}/${libname}_next.abi.tar.gz)
174-
175- add_custom_command(OUTPUT ${ABI_DUMP_NAME}
176- COMMAND abi-compliance-checker -gcc-path ${CMAKE_CXX_COMPILER} -l ${libname} -v1 next -dump-path ${ABI_DUMP_NAME} -dump-abi ${libname}_desc.xml
177- DEPENDS ${libname}
178- )
179- add_custom_target(abi-dump-${libname} DEPENDS ${ABI_DUMP_NAME})
180-endmacro(_define_abi_dump_for)
181-
182-macro(_define_abi_check_for libname)
183- add_custom_target(abi-check-${libname}
184- COMMAND /bin/bash -c '${CMAKE_SOURCE_DIR}/tools/abi_check.sh ${libname} ${ABI_DUMPS_DIR} ${CMAKE_SOURCE_DIR}'
185- DEPENDS abi-dump-${libname}
186- )
187-endmacro(_define_abi_check_for)
188-
189-set(the_libs mircore mirserver mirclient mircommon mirplatform mircookie mirplatforminputevdev)
190-if(MIR_BUILD_PLATFORM_MESA_KMS)
191- set(the_libs ${the_libs} mirclientplatformmesa mirplatformgraphicsmesakms)
192-endif()
193-
194-foreach(libname ${the_libs})
195- _define_abi_dump_for(${libname})
196- _define_abi_check_for(${libname})
197- list(APPEND abi-dump-list abi-dump-${libname})
198- list(APPEND abi-check-list abi-check-${libname})
199-endforeach(libname)
200-
201-add_custom_target(abi-dump DEPENDS ${abi-dump-list})
202-add_custom_target(abi-check DEPENDS ${abi-check-list})
203-
204-if (MIR_ENABLE_TESTS AND ENABLE_ABI_CHECK_TEST)
205- add_test(abi-compliance-check make abi-check)
206-endif()
207
208=== modified file 'cmake/FindGtestGmock.cmake'
209--- cmake/FindGtestGmock.cmake 2017-09-07 05:58:13 +0000
210+++ cmake/FindGtestGmock.cmake 2017-10-27 17:26:09 +0000
211@@ -1,96 +1,60 @@
212-include(ExternalProject)
213 include(FindPackageHandleStandardArgs)
214
215-#
216-# When cross compiling MIR_CHROOT points to our chroot.
217-# When not cross compiling, it should be blank to use the host system.
218-#
219-set(usr ${MIR_CHROOT}/usr)
220-
221-if (EXISTS ${usr}/src/googletest)
222- set (USING_GOOGLETEST_1_8 TRUE)
223- set (GTEST_INSTALL_DIR ${usr}/src/googletest/googletest/include)
224-else()
225- set (GTEST_INSTALL_DIR ${usr}/src/gmock/gtest/include)
226-endif()
227-
228-#gtest
229-find_path(
230- GTEST_INCLUDE_DIR gtest/gtest.h
231- HINTS ${GTEST_INSTALL_DIR}
232-)
233-
234-#gmock
235-find_path(
236- GMOCK_INSTALL_DIR CMakeLists.txt
237- HINTS ${usr}/src/googletest ${usr}/src/gmock)
238-if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
239- message(FATAL_ERROR "google-mock package not found")
240-endif()
241+find_package(GTest)
242+
243+if (NOT GTEST_FOUND)
244+ include(ExternalProject)
245+
246+ find_path(GTEST_ROOT
247+ NAMES CMakeLists.txt
248+ PATHS /usr/src/gtest /usr/src/googletest/googletest/
249+ DOC "Path to GTest CMake project")
250+
251+ ExternalProject_Add(GTest PREFIX ./gtest
252+ SOURCE_DIR ${GTEST_ROOT}
253+ CMAKE_ARGS
254+ -DCMAKE_CXX_COMPILER_WORKS=1
255+ -DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'
256+ -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
257+ INSTALL_COMMAND true)
258+
259+ ExternalProject_Get_Property(GTest binary_dir)
260+
261+ add_library(gtest UNKNOWN IMPORTED)
262+ set_target_properties(gtest PROPERTIES IMPORTED_LOCATION ${binary_dir}/libgtest.a)
263+ add_dependencies(gtest GTest)
264+ set(GTEST_LIBRARY "gtest")
265+
266+ add_library(gtest_main UNKNOWN IMPORTED)
267+ set_target_properties(gtest_main PROPERTIES IMPORTED_LOCATION ${binary_dir}/libgtest_main.a)
268+ add_dependencies(gtest_main GTest)
269+ set(GTEST_MAIN_LIBRARY "gtest_main")
270+
271+ set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
272+ find_path(GTEST_INCLUDE_DIRS NAMES gtest/gtest.h)
273+ find_package_handle_standard_args(GTest GTEST_LIBRARY GTEST_BOTH_LIBRARIES GTEST_INCLUDE_DIRS)
274+endif()
275+
276+find_file(GMOCK_SOURCE
277+ NAMES gmock-all.cc
278+ DOC "GMock source"
279+ PATHS /usr/src/googletest/googlemock/src/ /usr/src/gmock/ /usr/src/gmock/src)
280+
281+message(STATUS "GMOCK_SOURCE=${GMOCK_SOURCE}")
282
283 find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
284
285-if (USING_GOOGLETEST_1_8)
286- set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
287- set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR}/googlemock)
288- set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
289-else()
290- set(GMOCK_BASE_BINARY_DIR ${CMAKE_BINARY_DIR}/gmock/libs)
291- set(GMOCK_BINARY_DIR ${GMOCK_BASE_BINARY_DIR})
292- set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
293-endif()
294-
295-set(GTEST_CXX_FLAGS "-fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64")
296-if (cmake_build_type_lower MATCHES "threadsanitizer")
297- set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=thread")
298-elseif (cmake_build_type_lower MATCHES "ubsanitizer")
299- set(GTEST_CXX_FLAGS "${GTEST_CXX_FLAGS} -fsanitize=undefined")
300-endif()
301-
302-set(GTEST_CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${GTEST_CXX_FLAGS}")
303-list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
304-list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
305-
306-if (USING_GOOGLETEST_1_8)
307- list(APPEND GTEST_CMAKE_ARGS -DBUILD_GTEST=ON)
308-endif()
309-
310-if (cmake_build_type_lower MATCHES "threadsanitizer")
311- #Skip compiler check, since if GCC is the compiler, we need to link against -ltsan
312- #explicitly; specifying additional linker flags doesn't seem possible for external projects
313- list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER_WORKS=1)
314-endif()
315-if (${CMAKE_CROSSCOMPILING})
316- if(DEFINED MIR_CHROOT)
317- list(APPEND GTEST_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
318- else()
319- list(APPEND GTEST_CMAKE_ARGS -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
320- list(APPEND GTEST_CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER})
321- endif()
322-endif()
323-
324-ExternalProject_Add(
325- GMock
326- #where to build in source tree
327- PREFIX ${GMOCK_PREFIX}
328- #where the source is external to the project
329- SOURCE_DIR ${GMOCK_INSTALL_DIR}
330- #forward the compilers to the subproject so cross-arch builds work
331- CMAKE_ARGS ${GTEST_CMAKE_ARGS}
332- BINARY_DIR ${GMOCK_BASE_BINARY_DIR}
333-
334- #we don't need to install, so skip
335- INSTALL_COMMAND ""
336-)
337-
338-set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
339-set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
340-set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
341-set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
342-set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
343-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
344-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
345-
346-find_package_handle_standard_args(GTest DEFAULT_MSG
347- GMOCK_INCLUDE_DIR
348- GTEST_INCLUDE_DIR)
349+add_library(GMock STATIC ${GMOCK_SOURCE})
350+
351+if (EXISTS /usr/src/googletest/googlemock/src)
352+ set_source_files_properties(${GMOCK_SOURCE} PROPERTIES COMPILE_FLAGS "-I/usr/src/googletest/googlemock")
353+endif()
354+
355+if (EXISTS /usr/src/gmock/src)
356+ set_source_files_properties(${GMOCK_SOURCE} PROPERTIES COMPILE_FLAGS "-I/usr/src/gmock")
357+endif()
358+
359+find_package_handle_standard_args(GMock DEFAULT_MSG GMOCK_INCLUDE_DIR)
360+
361+set(GMOCK_LIBRARY GMock)
362+set(GMOCK_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_LIBRARY})
363
364=== modified file 'debian/changelog'
365--- debian/changelog 2017-10-11 15:06:23 +0000
366+++ debian/changelog 2017-10-27 17:26:09 +0000
367@@ -1,3 +1,32 @@
368+mir (0.28.1) UNRELEASED; urgency=medium
369+
370+ * New upstream release 0.28.1(https://launchpad.net/mir/+milestone/0.28.1)
371+ - ABI summary:
372+ . mirclient ABI unchanged at 9
373+ . miral ABI unchanged at 2
374+ . mirserver ABI unchanged to 45
375+ . mircommon ABI unchanged at 7
376+ . mirplatform ABI unchanged at 61
377+ . mirprotobuf ABI unchanged at 3
378+ . mirplatformgraphics ABI unchanged at 13
379+ . mirclientplatform ABI unchanged at 5
380+ . mirinputplatform ABI unchanged at 7
381+ . mircore ABI unchanged at 1
382+ - Enhancements:
383+ . Fix build (and add instructions) for Fedora
384+ . Wayland support for keymaps
385+ . Don't use Mir EGL if it isn't available.
386+ . [miral-app, miral-desktop] Default to using SDL's Wayland support.
387+ . Use system GMock detection (unless cross-compiling)
388+ - Bugs fixed:
389+ . Wayland demo client doesn't cross-compile. (LP: #1723971)
390+ . mir fails to find drm.h. (LP: #1722147)
391+ . Don't treat failing to bypass buffers as a fatal error. (LP: #1723235)
392+ . Build process depends on Debian toolchain. (LP: #1724202)
393+ . XWayland clients updates not causing redraw (LP: #1720223)
394+
395+ -- Alan Griffiths <alan@Octopull-desktop> Tue, 17 Oct 2017 14:14:37 +0100
396+
397 mir (0.28.0+17.10.20171011.1-0ubuntu1) artful; urgency=medium
398
399 * New upstream release 0.28.0(https://launchpad.net/mir/+milestone/0.28.0)
400
401=== modified file 'debian/control'
402--- debian/control 2017-10-08 14:03:45 +0000
403+++ debian/control 2017-10-27 17:26:09 +0000
404@@ -22,7 +22,6 @@
405 libgbm-dev,
406 libglm-dev,
407 libprotobuf-dev,
408- pkg-config,
409 libgoogle-glog-dev,
410 liblttng-ust-dev,
411 libxkbcommon-dev (>= 0.5),
412@@ -36,7 +35,6 @@
413 valgrind [amd64 i386 armhf arm64],
414 libglib2.0-dev,
415 libfreetype6-dev,
416- abi-compliance-checker,
417 libevdev-dev,
418 libinput-dev (>= 0.21),
419 uuid-dev,
420
421=== removed file 'doc/abi_compatibility_tools.md'
422--- doc/abi_compatibility_tools.md 2017-05-08 03:04:26 +0000
423+++ doc/abi_compatibility_tools.md 1970-01-01 00:00:00 +0000
424@@ -1,26 +0,0 @@
425-Tracking ABI compatibility {#abi_compatibility_tools}
426-================================
427-
428-A few make targets exist to help us track ABI compatibility across
429-different Mir versions and ensure we increase the ABI version properly.
430-These targets invoke the abi-compliance-checker tool for the actual ABI check.
431-
432-The targets are:
433-
434-* **make abi-check**
435-
436- Compiles all the public libraries in the current tree and checks their ABI against the latest released archive version
437-
438-* **make abi-check-\<library>**
439-
440- Compiles only the specified library in the current tree and checks its ABI against the latest released archive version
441-
442- - *library* can be any of the public library targets such as mirclient, mirserver, mirplatform, mircommon, etc.
443-
444-Sample usage
445-------------
446-
447- $ bzr branch lp:mir && cd mir
448- $ debian/rules override_dh_auto_configure
449- $ cd <build-dir>
450- $ make abi-check
451
452=== modified file 'doc/getting_and_using_mir.md'
453--- doc/getting_and_using_mir.md 2017-09-07 09:53:20 +0000
454+++ doc/getting_and_using_mir.md 2017-10-27 17:26:09 +0000
455@@ -4,7 +4,10 @@
456 Getting Mir examples
457 --------------------
458
459-You can install the Mir examples as follows:
460+These instructions assume that you’re using Ubuntu 17.10 later. For
461+earlier releases of Ubuntu or other distributions see \ref getting_involved_in_mir.
462+
463+You can install the Mir examples along with the Mir graphics drivers as follows:
464
465 $ sudo apt install mir-demos qterminal
466 $ sudo apt install mir-graphics-drivers-desktop qtubuntu-desktop
467
468=== modified file 'doc/getting_involved_in_mir.md'
469--- doc/getting_involved_in_mir.md 2017-09-07 09:53:20 +0000
470+++ doc/getting_involved_in_mir.md 2017-10-27 17:26:09 +0000
471@@ -9,26 +9,41 @@
472
473 The Mir project is hosted on Launchpad: https://launchpad.net/mir
474
475+
476+Getting Mir source & dependencies
477+---------------------------------
478+### On Ubuntu
479+
480+These instructions assume that you’re using Ubuntu 16.04LTS or later.
481+
482+You’ll need a few development tools installed:
483+
484+ $ sudo apt install devscripts equivs bzr
485+
486+With these installed you can checkout Mir and get the remaining dependencies:
487+
488+ $ bzr branch lp:mir
489+ $ sudo mk-build-deps -i
490+
491+### On Fedora
492+
493+You’ll need some development tools and packages installed:
494+
495+ $ sudo dnf install bzr cmake gcc-c++ boost-devel mesa-libEGL-devel \
496+ mesa-libGLES-devel glm-devel protobuf-lite-devel protobuf-compiler \
497+ capnproto-devel capnproto glog-devel gflags-devel systemd-devel \
498+ glib2-devel wayland-devel mesa-libgbm-devel libepoxy-devel nettle-devel \
499+ libinput-devel libxml++-devel libuuid-devel libxkbcommon-devel \
500+ freetype-devel lttng-ust-devel libatomic qterminal qt5-qtwayland \
501+ python3-pillow libevdev-devel umockdev-devel gtest-devel gmock-devel
502+
503+With these installed you can checkout Mir:
504+
505+ $ bzr branch lp:mir
506+
507 Building Mir
508 ------------
509
510-These instructions assume that you’re using Ubuntu 16.04LTS or later, I’ve not
511-earlier Ubuntu versions or other distributions.
512-
513-You’ll need a few development and utility packages installed, along with the
514-Mir graphics drivers:
515-
516- $ sudo apt install devscripts equivs bzr
517- $ sudo apt install mir-graphics-drivers-desktop
518-
519-If you’re working on a phone or tablet use mir-graphics-drivers-android in
520-place of mir-graphics-drivers-desktop. (See \ref building_source_for_arm for
521-more on this.)
522-
523-With these installed you can checkout and build Mir:
524-
525- $ bzr branch lp:mir
526- $ sudo mk-build-deps -i
527 $ mkdir mir/build
528 $ cd mir/build
529 $ cmake ..
530
531=== modified file 'examples/CMakeLists.txt'
532--- examples/CMakeLists.txt 2017-09-07 05:58:13 +0000
533+++ examples/CMakeLists.txt 2017-10-27 17:26:09 +0000
534@@ -3,10 +3,7 @@
535
536 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -fno-strict-aliasing -Wextra")
537
538-add_library(eglapp STATIC
539- eglapp.c
540- client_helpers.cpp
541-)
542+add_library(mirdraw STATIC graphics_utils.cpp)
543
544 add_library(exampleserverconfig STATIC
545 server_example_input_device_config.cpp
546@@ -20,150 +17,26 @@
547
548 target_link_libraries(exampleserverconfig mirserver)
549
550-target_link_libraries(eglapp
551- mirclient
552- ${EGL_LIBRARIES}
553- ${GLESv2_LIBRARIES}
554- )
555-
556-mir_add_wrapped_executable(mir_demo_client_animated_cursor
557- animated_cursor_demo_client.c
558-)
559-target_link_libraries(mir_demo_client_animated_cursor
560- eglapp
561-)
562-mir_add_wrapped_executable(mir_demo_client_eglflash
563- eglflash.c
564-)
565-target_link_libraries(mir_demo_client_eglflash
566- eglapp
567-)
568-mir_add_wrapped_executable(mir_demo_client_egltriangle
569- egltriangle.c
570-)
571-target_link_libraries(mir_demo_client_egltriangle
572- eglapp
573-)
574-mir_add_wrapped_executable(mir_demo_client_target
575- target.c
576-)
577-target_link_libraries(mir_demo_client_target
578- eglapp
579-)
580-mir_add_wrapped_executable(mir_demo_client_pointer_confinement
581- pointer_confinement.c
582-)
583-target_link_libraries(mir_demo_client_pointer_confinement
584- eglapp
585-)
586-mir_add_wrapped_executable(mir_demo_client_camera
587- camera.c
588-)
589-target_link_libraries(mir_demo_client_camera
590- eglapp
591-)
592-mir_add_wrapped_executable(mir_demo_client_eglcounter
593- eglcounter.cpp
594-)
595-target_link_libraries(mir_demo_client_eglcounter
596- eglapp
597-)
598-mir_add_wrapped_executable(mir_demo_client_eglplasma
599- eglplasma.c
600-)
601-target_link_libraries(mir_demo_client_eglplasma
602- eglapp
603-)
604-mir_add_wrapped_executable(mir_demo_client_cursors
605- cursors_demo_client.c
606-)
607-target_link_libraries(mir_demo_client_cursors
608- eglapp
609-)
610-mir_add_wrapped_executable(mir_demo_client_eglstateswitcher
611- eglstateswitcher.c
612-)
613-target_link_libraries(mir_demo_client_eglstateswitcher
614- eglapp
615-)
616-
617-mir_add_wrapped_executable(mir_demo_client_tooltip
618- tooltip.c
619-)
620-target_link_libraries(mir_demo_client_tooltip
621- eglapp
622- )
623-
624-mir_add_wrapped_executable(mir_demo_client_touch_validator
625- client_touch_validator.cpp
626-)
627-target_link_libraries(mir_demo_client_touch_validator
628- eglapp
629-)
630-
631-mir_add_wrapped_executable(mir_demo_client_basic
632- basic.c
633- )
634-
635-mir_add_wrapped_executable(mir_demo_client_input_shapes
636- input_shapes.cpp
637- )
638-target_link_libraries(mir_demo_client_input_shapes eglapp)
639-
640-target_link_libraries(mir_demo_client_basic
641- mirclient
642-
643- ${Boost_LIBRARIES}
644- ${CMAKE_THREAD_LIBS_INIT}
645-)
646+mir_add_wrapped_executable(mir_demo_client_basic basic.c)
647+target_link_libraries (mir_demo_client_basic mirclient ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
648
649 mir_add_wrapped_executable(mir_demo_client_release_at_exit release_at_exit.c)
650-target_link_libraries(mir_demo_client_release_at_exit mirclient)
651+target_link_libraries (mir_demo_client_release_at_exit mirclient)
652
653 mir_add_wrapped_executable(mir_demo_client_multiwin multiwin.c)
654-target_link_libraries(mir_demo_client_multiwin mirclient)
655+target_link_libraries (mir_demo_client_multiwin mirclient)
656
657 mir_add_wrapped_executable(mir_demo_client_fingerpaint fingerpaint.c)
658-target_link_libraries(mir_demo_client_fingerpaint mirclient)
659+target_link_libraries (mir_demo_client_fingerpaint mirclient)
660
661 mir_add_wrapped_executable(mir_demo_client_progressbar progressbar.c)
662-target_link_libraries(mir_demo_client_progressbar mirclient)
663-
664-mir_add_wrapped_executable(mir_demo_client_display_config demo_client_display_config.c)
665-target_link_libraries(mir_demo_client_display_config eglapp)
666-
667-mir_add_wrapped_executable(mir_demo_client_eglsquare eglsquare.cpp)
668-target_link_libraries(mir_demo_client_eglsquare eglapp)
669-
670-if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
671- target_link_libraries(mir_demo_client_eglsquare atomic)
672-endif()
673-
674-mir_add_wrapped_executable(mir_demo_client_flicker
675- flicker.c
676-)
677-
678-target_link_libraries(mir_demo_client_flicker
679- mirclient
680-
681- ${Boost_LIBRARIES}
682- ${CMAKE_THREAD_LIBS_INIT}
683-)
684-
685-mir_add_wrapped_executable(mir_demo_client_scroll
686- scroll.cpp
687-)
688-
689-target_link_libraries(mir_demo_client_scroll
690- eglapp
691- mirdraw
692- ${GLESv2_LIBRARIES}
693-)
694+target_link_libraries (mir_demo_client_progressbar mirclient)
695+
696+mir_add_wrapped_executable(mir_demo_client_flicker flicker.c)
697+target_link_libraries (mir_demo_client_flicker mirclient ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
698
699 mir_add_wrapped_executable(mir_demo_client_prompt_session prompt_session.c)
700-target_link_libraries(mir_demo_client_prompt_session mirclient)
701-
702-add_library(mirdraw STATIC graphics_utils.cpp)
703+target_link_libraries (mir_demo_client_prompt_session mirclient)
704
705 include_directories(
706 ${PROJECT_SOURCE_DIR}/include/miral
707@@ -238,51 +111,91 @@
708 endif ()
709 endif ()
710
711-mir_add_wrapped_executable(mir_demo_client_multistream
712- multi_stream.cpp
713-)
714-
715-target_link_libraries(mir_demo_client_multistream
716- mirclient
717- eglapp
718- ${Boost_LIBRARIES}
719-)
720-
721-mir_add_wrapped_executable(mir_demo_client_render_surface
722- render_surface.cpp
723-)
724-
725-target_link_libraries(mir_demo_client_render_surface
726- mirclient
727- eglapp
728-)
729-
730-mir_add_wrapped_executable(mir_demo_client_prerendered_frames
731- prerendered_frames.c
732-)
733-
734-target_link_libraries(mir_demo_client_prerendered_frames
735- mirclient
736- m
737-)
738-
739-mir_add_wrapped_executable(mir_demo_client_chain_jumping_buffers
740- chain_jumping_buffers.c
741-)
742-
743-target_link_libraries(mir_demo_client_chain_jumping_buffers
744- mirclient
745-)
746+mir_add_wrapped_executable(mir_demo_client_prerendered_frames prerendered_frames.c)
747+target_link_libraries (mir_demo_client_prerendered_frames mirclient m)
748+
749+mir_add_wrapped_executable(mir_demo_client_chain_jumping_buffers chain_jumping_buffers.c)
750+target_link_libraries (mir_demo_client_chain_jumping_buffers mirclient)
751
752 include_directories(${MIR_GENERATED_INCLUDE_DIRECTORIES})
753
754 mir_add_wrapped_executable(mir_demo_client_wayland wayland_client.c)
755-target_link_libraries(mir_demo_client_wayland
756-
757- ${WAYLAND_CLIENT_LIBRARIES}
758-)
759+target_link_libraries (mir_demo_client_wayland ${WAYLAND_CLIENT_LDFLAGS} ${WAYLAND_CLIENT_LIBRARIES})
760
761 mir_add_wrapped_executable(mir_demo_client_screencast screencast.cpp)
762-
763-target_link_libraries(mir_demo_client_screencast mirclient)
764-
765+target_link_libraries (mir_demo_client_screencast mirclient)
766+
767+
768+# The remaining examples are dependent on Mir EGL being supported.
769+if (MIR_EGL_SUPPORTED)
770+
771+ add_library(eglapp STATIC
772+ eglapp.c
773+ client_helpers.cpp
774+ )
775+
776+ target_link_libraries(eglapp
777+ mirclient
778+ ${EGL_LIBRARIES}
779+ ${GLESv2_LIBRARIES}
780+ )
781+
782+ mir_add_wrapped_executable(mir_demo_client_animated_cursor animated_cursor_demo_client.c)
783+ target_link_libraries (mir_demo_client_animated_cursor eglapp)
784+
785+ mir_add_wrapped_executable(mir_demo_client_eglflash eglflash.c)
786+ target_link_libraries (mir_demo_client_eglflash eglapp)
787+
788+ mir_add_wrapped_executable(mir_demo_client_egltriangle egltriangle.c)
789+ target_link_libraries (mir_demo_client_egltriangle eglapp)
790+
791+ mir_add_wrapped_executable(mir_demo_client_target target.c)
792+ target_link_libraries (mir_demo_client_target eglapp)
793+
794+ mir_add_wrapped_executable(mir_demo_client_pointer_confinement pointer_confinement.c)
795+ target_link_libraries (mir_demo_client_pointer_confinement eglapp)
796+
797+ mir_add_wrapped_executable(mir_demo_client_camera camera.c)
798+ target_link_libraries (mir_demo_client_camera eglapp)
799+
800+ mir_add_wrapped_executable(mir_demo_client_eglcounter eglcounter.cpp)
801+ target_link_libraries (mir_demo_client_eglcounter eglapp)
802+
803+ mir_add_wrapped_executable(mir_demo_client_eglplasma eglplasma.c)
804+ target_link_libraries (mir_demo_client_eglplasma eglapp)
805+
806+ mir_add_wrapped_executable(mir_demo_client_cursors cursors_demo_client.c)
807+ target_link_libraries (mir_demo_client_cursors eglapp)
808+
809+ mir_add_wrapped_executable(mir_demo_client_eglstateswitcher eglstateswitcher.c)
810+ target_link_libraries (mir_demo_client_eglstateswitcher eglapp)
811+
812+ mir_add_wrapped_executable(mir_demo_client_tooltip tooltip.c)
813+ target_link_libraries (mir_demo_client_tooltip eglapp)
814+
815+ mir_add_wrapped_executable(mir_demo_client_touch_validator client_touch_validator.cpp)
816+ target_link_libraries (mir_demo_client_touch_validator eglapp)
817+
818+ mir_add_wrapped_executable(mir_demo_client_display_config demo_client_display_config.c)
819+ target_link_libraries (mir_demo_client_display_config eglapp)
820+
821+ mir_add_wrapped_executable(mir_demo_client_eglsquare eglsquare.cpp)
822+ target_link_libraries (mir_demo_client_eglsquare eglapp)
823+
824+ if ("${CMAKE_CXX_COMPILER}" MATCHES "clang")
825+ target_link_libraries (mir_demo_client_eglsquare atomic)
826+ endif()
827+
828+ mir_add_wrapped_executable(mir_demo_client_input_shapes input_shapes.cpp)
829+ target_link_libraries (mir_demo_client_input_shapes eglapp)
830+
831+ mir_add_wrapped_executable(mir_demo_client_scroll scroll.cpp)
832+ target_link_libraries (mir_demo_client_scroll eglapp mirdraw ${GLESv2_LIBRARIES})
833+
834+ mir_add_wrapped_executable(mir_demo_client_multistream multi_stream.cpp)
835+ target_link_libraries (mir_demo_client_multistream mirclient eglapp ${Boost_LIBRARIES})
836+
837+ mir_add_wrapped_executable(mir_demo_client_render_surface render_surface.cpp)
838+ target_link_libraries (mir_demo_client_render_surface mirclient eglapp)
839+
840+endif() # MIR_EGL_SUPPORTED
841
842=== modified file 'examples/miral-kiosk/CMakeLists.txt'
843--- examples/miral-kiosk/CMakeLists.txt 2017-08-31 15:12:09 +0000
844+++ examples/miral-kiosk/CMakeLists.txt 2017-10-27 17:26:09 +0000
845@@ -10,3 +10,8 @@
846 )
847
848 target_link_libraries(miral-kiosk miral)
849+
850+# I'm not sure why this is needed in a chroot, but it's not worth finding out
851+if(DEFINED MIR_CHROOT)
852+ target_link_libraries(miral-kiosk EGL ${GLESv2_LIBRARIES})
853+endif()
854
855=== modified file 'examples/miral-shell/miral-app.sh'
856--- examples/miral-shell/miral-app.sh 2017-09-25 17:59:37 +0000
857+++ examples/miral-shell/miral-app.sh 2017-10-27 17:26:09 +0000
858@@ -45,14 +45,20 @@
859 if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
860 if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
861
862+qt_qpa_platform=ubuntumirclient
863 qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)
864-if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi
865+if [ "${qtubuntu_desktop_installed}" == "0" ]
866+then
867+ echo "** Warning ** defaulting to Wayland backend for Qt"
868+ echo "For the best experience install qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""
869+ qt_qpa_platform=wayland
870+fi
871
872 sh -c "${bindir}${miral_server} $* ${hostsocket} --file ${socket} --wayland-socket-name ${wayland_display} --desktop_file_hint=miral-shell.desktop"&
873
874 while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
875
876 unset QT_QPA_PLATFORMTHEME
877-MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir WAYLAND_DISPLAY=${wayland_display} dbus-run-session -- ${launcher}
878+MIR_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}
879 killall ${bindir}${miral_server}
880
881
882=== modified file 'examples/miral-shell/miral-desktop.sh'
883--- examples/miral-shell/miral-desktop.sh 2017-09-19 08:52:48 +0000
884+++ examples/miral-shell/miral-desktop.sh 2017-10-27 17:26:09 +0000
885@@ -37,8 +37,14 @@
886 if [ -e "${socket}" ]; then echo "Error: session endpoint '${socket}' already exists"; exit 1 ;fi
887 if [ -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; then echo "Error: wayland endpoint '${wayland_display}' already exists"; exit 1 ;fi
888
889+qt_qpa_platform=ubuntumirclient
890 qtubuntu_desktop_installed=$(apt list qtubuntu-desktop 2>/dev/null | grep installed | wc -l)
891-if [ "${qtubuntu_desktop_installed}" == "0" ]; then echo "Need qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""; exit 1 ;fi
892+if [ "${qtubuntu_desktop_installed}" == "0" ]
893+then
894+ echo "** Warning ** defaulting to Wayland backend for Qt"
895+ echo "For the best experience install qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""
896+ qt_qpa_platform=wayland
897+fi
898
899 sudo ls >> /dev/null
900 oldvt=$(sudo fgconsole)
901@@ -47,6 +53,6 @@
902 while [ ! -e "${socket}" ]; do echo "waiting for ${socket}"; sleep 1 ;done
903
904 unset QT_QPA_PLATFORMTHEME
905-MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir WAYLAND_DISPLAY=${wayland_display} dbus-run-session -- ${launcher}
906+MIR_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}
907 sudo killall ${bindir}${miral_server}
908
909
910=== modified file 'examples/miral-shell/miral-run.sh'
911--- examples/miral-shell/miral-run.sh 2017-08-21 15:58:34 +0000
912+++ examples/miral-shell/miral-run.sh 2017-10-27 17:26:09 +0000
913@@ -14,4 +14,15 @@
914 then extras='--app-id com.canonical.miral.Terminal'
915 fi
916 unset QT_QPA_PLATFORMTHEME
917-MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=ubuntumirclient SDL_VIDEODRIVER=mir "$@" ${extras}&
918+
919+qt_qpa_platform=ubuntumirclient
920+qtubuntu_desktop_installed=$(apt list qtubuntu-desktop
921+ 2>/dev/null | grep installed | wc -l)
922+if [ "${qtubuntu_desktop_installed}" == "0" ]
923+then
924+ echo "** Warning ** defaulting to Wayland backend for Qt"
925+ echo "For the best experience install qtubuntu-desktop - run \"sudo apt install qtubuntu-desktop\""
926+ qt_qpa_platform=wayland
927+fi
928+
929+MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=mir QT_QPA_PLATFORM=${qt_qpa_platform} SDL_VIDEODRIVER=wayland "$@" ${extras}&
930
931=== modified file 'examples/miral-shell/miral-xrun.sh'
932--- examples/miral-shell/miral-xrun.sh 2017-09-29 16:19:42 +0000
933+++ examples/miral-shell/miral-xrun.sh 2017-10-27 17:26:09 +0000
934@@ -41,7 +41,6 @@
935 else
936 echo "Error: Cannot detect Mir endpoint"; exit 1
937 fi
938- MIR_SOCKET=${socket_value}
939 x11_server_args=-rootless
940 elif [ "${x11_server}" == "Xwayland" ];
941 then
942@@ -51,10 +50,15 @@
943 if [ -e "${XDG_RUNTIME_DIR}/miral_wayland" ];
944 then
945 socket_value=miral_wayland
946+ elif [ -e "${XDG_RUNTIME_DIR}/wayland-1" ]
947+ then
948+ socket_value=wayland-1
949+ elif [ -e "${XDG_RUNTIME_DIR}/wayland-0" ]
950+ then
951+ socket_value=wayland-0
952 else
953 echo "Error: Cannot detect Mir-Wayland endpoint"; exit 1
954 fi
955- WAYLAND_DISPLAY=${socket_value}
956 x11_server_args=
957 fi
958
959@@ -64,6 +68,7 @@
960 let port+=1
961 done
962
963-${x11_server} ${x11_server_args} :${port} & pid=$!
964+MIR_SOCKET=${socket_value} WAYLAND_DISPLAY=${socket_value} ${x11_server} ${x11_server_args} :${port} & pid=$!
965+while [ ! -e "/tmp/.X11-unix/X${port}" ]; do echo "waiting for DISPLAY=:${port}"; sleep 1 ;done
966 DISPLAY=:${port} "$@"
967 kill ${pid}
968
969=== modified file 'examples/miral-shell/shell_main.cpp'
970--- examples/miral-shell/shell_main.cpp 2017-08-21 15:58:34 +0000
971+++ examples/miral-shell/shell_main.cpp 2017-10-27 17:26:09 +0000
972@@ -83,7 +83,7 @@
973 {
974 CommandLineOption{[&](std::string const& ) { },
975 "desktop_file_hint", "Ignored for Unity8 compatibility", "miral-shell.desktop"},
976- CursorTheme{"DMZ-White"},
977+ CursorTheme{"default"},
978 window_managers,
979 display_configuration_options,
980 launcher,
981
982=== modified file 'examples/miral-shell/spinner/eglspinner.cpp'
983--- examples/miral-shell/spinner/eglspinner.cpp 2017-08-21 15:58:34 +0000
984+++ examples/miral-shell/spinner/eglspinner.cpp 2017-10-27 17:26:09 +0000
985@@ -1,5 +1,5 @@
986 /*
987- * Copyright © 2013-2015 Canonical Ltd.
988+ * Copyright © 2013-2017 Canonical Ltd.
989 *
990 * This program is free software: you can redistribute it and/or modify
991 * under the terms of the GNU General Public License version 2 or 3 as as
992@@ -19,6 +19,14 @@
993 * Kevin DuBois <kevin.dubois@canonical.com>
994 */
995
996+// Ugly way to detect the Mir EGL patch to mesa
997+// NB this has to be before any other includes
998+#define MIR_EGL_PLATFORM
999+#include <EGL/eglplatform.h>
1000+#ifndef MIR_CLIENT_API_VERSION
1001+#define MIR_EGL_UNAVAILABLE
1002+#endif
1003+
1004 #include "splash.h"
1005
1006 #include <chrono>
1007@@ -143,7 +151,7 @@
1008 //1.) 0.0 - 0.6: logo fades in fully
1009 //2.) 0.0 - 6.0: logo does one full spin 360°
1010 //3.) 6.0 - 6.833: glow fades in fully, black-background fades out to 50%
1011- //4.) 6.833 - 7.666: glow fades out fully, black-background fades out to 0%
1012+ //4.) 6.833 - 7.666: glow fades out fully, black-background fades out to 0%
1013 //5.) 7.666 - 8.266: logo fades out fully
1014 //8.266..: now spinner can be closed as all its elements are faded out
1015
1016@@ -221,11 +229,14 @@
1017 "} \n";
1018
1019 std::atomic<bool> dying{false};
1020+
1021+#ifndef MIR_EGL_UNAVAILABLE
1022 void lifecycle_event_callback(MirConnection* /*connection*/, MirLifecycleState state, void* context)
1023 {
1024 if (state == mir_lifecycle_connection_lost)
1025 static_cast<decltype(dying)*>(context)->store(true);
1026 }
1027+#endif
1028 }
1029
1030 struct SpinnerSplash::Self
1031@@ -254,6 +265,7 @@
1032 void SpinnerSplash::operator()(MirConnection* const connection)
1033 try
1034 {
1035+#ifndef MIR_EGL_UNAVAILABLE
1036 GLuint prog[2];
1037 GLuint texture[2];
1038 GLint vpos[2];
1039@@ -365,6 +377,9 @@
1040
1041 glDeleteTextures(2, texture);
1042 g_timer_destroy (timer);
1043+#else
1044+ (void)connection;
1045+#endif
1046 }
1047 catch (std::exception const& x)
1048 {
1049
1050=== modified file 'examples/miral-shell/titlebar_config.cpp'
1051--- examples/miral-shell/titlebar_config.cpp 2017-08-21 15:58:34 +0000
1052+++ examples/miral-shell/titlebar_config.cpp 2017-10-27 17:26:09 +0000
1053@@ -17,12 +17,30 @@
1054 */
1055
1056 #include "titlebar_config.h"
1057+#include <unistd.h>
1058 #include <mutex>
1059
1060 namespace
1061 {
1062+auto default_font() -> std::string
1063+{
1064+ for (std::string const file : { "Ubuntu-B.ttf", "FreeSansBold.ttf" })
1065+ {
1066+ for (auto const path : { "/usr/share/fonts/truetype/ubuntu-font-family/", // Ubuntu Ubuntu-B.ttf
1067+ "/usr/share/fonts/truetype/freefont/", // Debian FreeSansBold.ttf
1068+ "/usr/share/fonts/gnu-free/"}) // Fedora FreeSansBold.ttf
1069+ {
1070+ auto const full_path = path + file;
1071+ if (access(full_path.c_str(), R_OK) == 0)
1072+ return full_path;
1073+ }
1074+ }
1075+
1076+ return "/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf";
1077+}
1078+
1079 std::mutex mutex;
1080-std::string font_file{"/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-B.ttf"};
1081+std::string font_file{default_font()};
1082 }
1083
1084 void titlebar::font_file(std::string const& font_file)
1085
1086=== modified file 'include/core/mir/optional_value.h'
1087--- include/core/mir/optional_value.h 2017-07-28 17:00:43 +0000
1088+++ include/core/mir/optional_value.h 2017-10-27 17:26:09 +0000
1089@@ -59,6 +59,11 @@
1090 return std::move(value_);
1091 }
1092
1093+ operator bool() const
1094+ {
1095+ return is_set();
1096+ }
1097+
1098 private:
1099 void die_if_unset() const
1100 {
1101
1102=== modified file 'include/server/mir/server_action_queue.h'
1103--- include/server/mir/server_action_queue.h 2017-07-28 17:00:43 +0000
1104+++ include/server/mir/server_action_queue.h 2017-10-27 17:26:09 +0000
1105@@ -32,6 +32,16 @@
1106 virtual ~ServerActionQueue() = default;
1107
1108 virtual void enqueue(void const* owner, ServerAction const& action) = 0;
1109+ /**
1110+ * Enqueue an action to be run, guaranteeing that it *will* be run.
1111+ *
1112+ * The action will be run even if the queue is not normally being drained
1113+ * (for example, if the main loop is suspended). If running on the queue is
1114+ * not possible, the action will be run on the caller's thread.
1115+ *
1116+ * \param [in] action Functor to invoke.
1117+ */
1118+ virtual void enqueue_with_guaranteed_execution(ServerAction const& action) = 0;
1119 virtual void pause_processing_for(void const* owner) = 0;
1120 virtual void resume_processing_for(void const* owner) = 0;
1121
1122
1123=== modified file 'include/server/mir/shell/persistent_surface_store.h'
1124--- include/server/mir/shell/persistent_surface_store.h 2017-07-28 17:00:43 +0000
1125+++ include/server/mir/shell/persistent_surface_store.h 2017-10-27 17:26:09 +0000
1126@@ -22,7 +22,7 @@
1127 #include <memory>
1128 #include <vector>
1129 #include <array>
1130-#include <uuid/uuid.h>
1131+#include <uuid.h>
1132
1133
1134 namespace mir
1135
1136=== modified file 'src/CMakeLists.txt'
1137--- src/CMakeLists.txt 2017-09-08 13:26:03 +0000
1138+++ src/CMakeLists.txt 2017-10-27 17:26:09 +0000
1139@@ -18,7 +18,6 @@
1140 # Add the core and platform implementations before exposing any private APIs
1141 add_subdirectory(core)
1142 add_subdirectory(platforms/)
1143-add_subdirectory(miral/)
1144
1145 # the src/include/... directories should be private to the implementation
1146 include_directories(${PROJECT_SOURCE_DIR}/src/include/common)
1147@@ -31,6 +30,7 @@
1148
1149 add_subdirectory(platform/)
1150 add_subdirectory(server/)
1151+add_subdirectory(miral/)
1152 add_subdirectory(client/)
1153 add_subdirectory(utils/)
1154 add_subdirectory(renderer/)
1155@@ -54,6 +54,7 @@
1156 set(MIR_PLATFORM_REFERENCES ${MIR_PLATFORM_REFERENCES} PARENT_SCOPE)
1157 set(MIR_CLIENT_PLATFORM_PATH ${MIR_CLIENT_PLATFORM_PATH} PARENT_SCOPE)
1158 set(MIR_SERVER_PLATFORM_PATH ${MIR_SERVER_PLATFORM_PATH} PARENT_SCOPE)
1159+set(MIRSERVER_INCLUDE_DIRS ${MIRSERVER_INCLUDE_DIRS} PARENT_SCOPE)
1160
1161 # We need the ABI versions in the tests
1162 set(MIR_SERVER_GRAPHICS_PLATFORM_ABI ${MIR_SERVER_GRAPHICS_PLATFORM_ABI} PARENT_SCOPE)
1163
1164=== modified file 'src/capnproto/CMakeLists.txt'
1165--- src/capnproto/CMakeLists.txt 2017-07-28 17:00:43 +0000
1166+++ src/capnproto/CMakeLists.txt 2017-10-27 17:26:09 +0000
1167@@ -20,7 +20,12 @@
1168 capnp_generate_cpp(CAPNPROTO_INPUT_CONFIG_SRC CAPNPROTO_INPUT_CONFIG_HDRS mir_input_config.capnp)
1169
1170 add_library(mircapnproto STATIC ${CAPNPROTO_EVENT_SRC} ${CAPNPROTO_INPUT_CONFIG_SRC})
1171-target_link_libraries(mircapnproto ${CAPNP_LIBRARIES_LITE})
1172+
1173+if (DEFINED CAPNP_LIBRARIES_LITE)
1174+ target_link_libraries(mircapnproto ${CAPNP_LIBRARIES_LITE})
1175+else()
1176+ target_link_libraries(mircapnproto $<TARGET_FILE:CapnProto::capnp> $<TARGET_FILE:CapnProto::kj>)
1177+endif()
1178
1179 list(APPEND MIR_GENERATED_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
1180
1181
1182=== modified file 'src/include/server/mir/glib_main_loop.h'
1183--- src/include/server/mir/glib_main_loop.h 2017-07-28 17:00:43 +0000
1184+++ src/include/server/mir/glib_main_loop.h 2017-10-27 17:26:09 +0000
1185@@ -28,6 +28,7 @@
1186 #include <exception>
1187
1188 #include <glib.h>
1189+#include <deque>
1190
1191 namespace mir
1192 {
1193@@ -76,6 +77,8 @@
1194 void unregister_fd_handler(void const* owner) override;
1195
1196 void enqueue(void const* owner, ServerAction const& action) override;
1197+ void enqueue_with_guaranteed_execution(ServerAction const& action) override;
1198+
1199 void pause_processing_for(void const* owner) override;
1200 void resume_processing_for(void const* owner) override;
1201
1202@@ -100,6 +103,8 @@
1203 detail::SignalSources signal_sources;
1204 std::mutex do_not_process_mutex;
1205 std::vector<void const*> do_not_process;
1206+ std::mutex run_on_halt_mutex;
1207+ std::deque<ServerAction> run_on_halt_queue;
1208 std::function<void()> before_iteration_hook;
1209 std::exception_ptr main_loop_exception;
1210 };
1211
1212=== modified file 'src/miral/CMakeLists.txt'
1213--- src/miral/CMakeLists.txt 2017-09-15 09:43:35 +0000
1214+++ src/miral/CMakeLists.txt 2017-10-27 17:26:09 +0000
1215@@ -96,13 +96,18 @@
1216
1217 # clang generates slightly different symbols (but we don't care)
1218 if (CMAKE_COMPILER_IS_GNUCXX)
1219- add_custom_target(check-miral-symbols ALL
1220- DEPENDS miral ${PROJECT_SOURCE_DIR}/debian/libmiral${MIRAL_ABI}.symbols
1221- COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/libmiral${MIRAL_ABI}.symbols
1222- 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
1223- WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
1224- VERBATIM
1225- )
1226+ # Using dpkg-gensymbols only makes sense on Debian based distros
1227+ if (EXISTS /etc/debian_version)
1228+ find_program(MIR_DPKG_GENSYMBOLS dpkg-gensymbols)
1229+ if (MIR_DPKG_GENSYMBOLS)
1230+ add_custom_target(check-miral-symbols ALL
1231+ DEPENDS miral ${PROJECT_SOURCE_DIR}/debian/libmiral${MIRAL_ABI}.symbols
1232+ COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/libmiral${MIRAL_ABI}.symbols
1233+ 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
1234+ WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
1235+ VERBATIM)
1236+ endif()
1237+ endif()
1238 endif()
1239
1240 set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
1241
1242=== modified file 'src/miral/runner.cpp'
1243--- src/miral/runner.cpp 2017-08-21 14:18:55 +0000
1244+++ src/miral/runner.cpp 2017-10-27 17:26:09 +0000
1245@@ -48,7 +48,7 @@
1246 int const argc;
1247 char const** const argv;
1248 std::string const config_file;
1249-
1250+
1251 std::mutex mutex;
1252 std::function<void()> start_callback{[]{}};
1253 std::function<void()> stop_callback{[this]{ join_client_threads(weak_server.lock().get()); }};
1254@@ -103,7 +103,7 @@
1255 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir
1256 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir
1257 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme
1258- setenv("SDL_VIDEODRIVER", "mir", true); // configure SDL to use Mir
1259+ setenv("SDL_VIDEODRIVER", "wayland", true); // configure SDL to use Wayland
1260
1261 // gnome-terminal is the (only known) special case
1262 char const* exec_args[] = { "gnome-terminal", "--app-id", "com.canonical.miral.Terminal", nullptr };
1263
1264=== modified file 'src/platforms/eglstream-kms/server/display.cpp'
1265--- src/platforms/eglstream-kms/server/display.cpp 2017-07-28 17:00:43 +0000
1266+++ src/platforms/eglstream-kms/server/display.cpp 2017-10-27 17:26:09 +0000
1267@@ -34,7 +34,6 @@
1268 #include "mir/renderer/gl/render_target.h"
1269 #include "mir/renderer/gl/context.h"
1270
1271-#include <drm/drm.h>
1272 #include <xf86drmMode.h>
1273 #include <sys/ioctl.h>
1274 #include <system_error>
1275
1276=== modified file 'src/platforms/eglstream-kms/server/egl_output.cpp'
1277--- src/platforms/eglstream-kms/server/egl_output.cpp 2017-07-28 17:00:43 +0000
1278+++ src/platforms/eglstream-kms/server/egl_output.cpp 2017-10-27 17:26:09 +0000
1279@@ -23,7 +23,7 @@
1280 #include "kms-utils/kms_connector.h"
1281
1282 #include <cstring>
1283-#include <drm/drm.h>
1284+#include <drm.h>
1285 #include <sys/ioctl.h>
1286 #include <vector>
1287 #include <boost/throw_exception.hpp>
1288
1289=== modified file 'src/platforms/mesa/server/buffer_allocator.cpp'
1290--- src/platforms/mesa/server/buffer_allocator.cpp 2017-09-27 20:44:14 +0000
1291+++ src/platforms/mesa/server/buffer_allocator.cpp 2017-10-27 17:26:09 +0000
1292@@ -421,8 +421,6 @@
1293
1294 if (egl_image == EGL_NO_IMAGE_KHR)
1295 BOOST_THROW_EXCEPTION(mg::egl_error("Failed to create EGLImage"));
1296-
1297- on_consumed();
1298 }
1299 lock.unlock();
1300
1301@@ -436,6 +434,7 @@
1302
1303 void secure_for_render() override
1304 {
1305+ on_consumed();
1306 }
1307
1308 std::shared_ptr<mir::graphics::NativeBuffer> native_buffer_handle() const override
1309@@ -537,7 +536,7 @@
1310
1311 std::shared_ptr<mg::EGLExtensions> const extensions;
1312
1313- std::function<void()> on_consumed;
1314+ std::function<void()> const on_consumed;
1315 };
1316 }
1317
1318
1319=== modified file 'src/platforms/mesa/server/kms/cursor.cpp'
1320--- src/platforms/mesa/server/kms/cursor.cpp 2017-07-31 08:58:34 +0000
1321+++ src/platforms/mesa/server/kms/cursor.cpp 2017-10-27 17:26:09 +0000
1322@@ -25,7 +25,6 @@
1323 #include "mir/graphics/cursor_image.h"
1324
1325 #include <xf86drm.h>
1326-#include <drm/drm.h>
1327
1328 #include <boost/exception/errinfo_errno.hpp>
1329
1330
1331=== modified file 'src/platforms/mesa/server/kms/display_buffer.cpp'
1332--- src/platforms/mesa/server/kms/display_buffer.cpp 2017-07-28 17:00:43 +0000
1333+++ src/platforms/mesa/server/kms/display_buffer.cpp 2017-10-27 17:26:09 +0000
1334@@ -32,7 +32,7 @@
1335 #include <EGL/eglext.h>
1336 #include MIR_SERVER_GL_H
1337 #include <GLES2/gl2ext.h>
1338-#include <drm/drm_fourcc.h>
1339+#include <drm_fourcc.h>
1340
1341 #include <sstream>
1342 #include <stdexcept>
1343@@ -504,7 +504,7 @@
1344 make_current();
1345
1346 listener->report_successful_egl_make_current_on_construction();
1347-
1348+
1349 glClear(GL_COLOR_BUFFER_BIT);
1350
1351 surface.swap_buffers();
1352@@ -591,9 +591,7 @@
1353 {
1354 auto bypass_buffer = (*bypass_it)->buffer();
1355 auto native = std::dynamic_pointer_cast<mgm::NativeBuffer>(bypass_buffer->native_buffer_handle());
1356- if (!native)
1357- BOOST_THROW_EXCEPTION(std::invalid_argument("could not convert NativeBuffer"));
1358- if (native->flags & mir_buffer_flag_can_scanout &&
1359+ if (native && native->flags & mir_buffer_flag_can_scanout &&
1360 bypass_buffer->size() == surface.size() &&
1361 !needs_bounce_buffer(*outputs.front(), native->bo))
1362 {
1363@@ -776,7 +774,7 @@
1364
1365 visible_bypass_frame = scheduled_bypass_frame;
1366 scheduled_bypass_frame = nullptr;
1367-
1368+
1369 visible_composite_frame = std::move(scheduled_composite_frame);
1370 scheduled_composite_frame = nullptr;
1371 }
1372
1373=== modified file 'src/protobuf/symbols.map'
1374--- src/protobuf/symbols.map 2017-05-25 08:58:03 +0000
1375+++ src/protobuf/symbols.map 2017-10-27 17:26:09 +0000
1376@@ -1158,3 +1158,27 @@
1377 vtable?for?mir::protobuf::RequestWithAuthority;
1378 };
1379 } MIR_PROTOBUF_0.26;
1380+
1381+# When building with the Fedora 26 toolchain these are needed
1382+MIR_PROTOBUF_FEDORA {
1383+ global:
1384+ extern "C++" {
1385+ mir::protobuf::_Buffer_default_instance_;
1386+ mir::protobuf::_BufferRequest_default_instance_;
1387+ mir::protobuf::_BufferStream_default_instance_;
1388+ mir::protobuf::_BufferStreamId_default_instance_;
1389+ mir::protobuf::_Cookie_default_instance_;
1390+ mir::protobuf::_DisplayConfiguration_default_instance_;
1391+ mir::protobuf::_LifecycleEvent_default_instance_;
1392+ mir::protobuf::_ModuleProperties_default_instance_;
1393+ mir::protobuf::_PersistentSurfaceId_default_instance_;
1394+ mir::protobuf::_PingEvent_default_instance_;
1395+ mir::protobuf::_Platform_default_instance_;
1396+ mir::protobuf::_ScreencastId_default_instance_;
1397+ mir::protobuf::_StructuredError_default_instance_;
1398+ mir::protobuf::_SurfaceAspectRatio_default_instance_;
1399+ mir::protobuf::_SurfaceId_default_instance_;
1400+ mir::protobuf::_SurfaceSpecification_default_instance_;
1401+ mir::protobuf::_Rectangle_default_instance_;
1402+ };
1403+} MIR_PROTOBUF_0.27;
1404
1405=== modified file 'src/server/CMakeLists.txt'
1406--- src/server/CMakeLists.txt 2017-09-25 22:34:08 +0000
1407+++ src/server/CMakeLists.txt 2017-10-27 17:26:09 +0000
1408@@ -125,6 +125,13 @@
1409 atomic
1410 )
1411
1412+target_include_directories(mirshell
1413+ PUBLIC
1414+ ${UUID_INCLUDE_DIRS}
1415+)
1416+
1417+set(MIRSERVER_INCLUDE_DIRS ${UUID_INCLUDE_DIRS} PARENT_SCOPE)
1418+
1419 install(TARGETS mirserver
1420 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
1421 )
1422
1423=== modified file 'src/server/frontend/wayland/wayland_connector.cpp'
1424--- src/server/frontend/wayland/wayland_connector.cpp 2017-10-08 02:12:58 +0000
1425+++ src/server/frontend/wayland/wayland_connector.cpp 2017-10-27 17:26:09 +0000
1426@@ -43,6 +43,11 @@
1427
1428 #include "mir/client/event.h"
1429
1430+#include "mir/input/device.h"
1431+#include "mir/input/mir_keyboard_config.h"
1432+#include "mir/input/input_device_hub.h"
1433+#include "mir/input/input_device_observer.h"
1434+
1435 #include <system_error>
1436 #include <sys/eventfd.h>
1437 #include <wayland-server-core.h>
1438@@ -75,6 +80,7 @@
1439 namespace ms = mir::scene;
1440 namespace geom = mir::geometry;
1441 namespace mcl = mir::client;
1442+namespace mi = mir::input;
1443
1444 namespace mir
1445 {
1446@@ -798,6 +804,7 @@
1447 wl_client* client,
1448 wl_resource* parent,
1449 uint32_t id,
1450+ mir::input::Keymap const& initial_keymap,
1451 std::function<void(WlKeyboard*)> const& on_destroy,
1452 std::shared_ptr<mir::Executor> const& executor)
1453 : Keyboard(client, parent, id),
1454@@ -811,19 +818,14 @@
1455 // TODO: We should really grab the keymap for the focused surface when
1456 // we receive focus.
1457
1458- xkb_rule_names default_rules;
1459- memset(&default_rules, 0, sizeof(default_rules));
1460-
1461- keymap = decltype(keymap){
1462- xkb_keymap_new_from_names(
1463- context.get(),
1464- &default_rules,
1465- XKB_KEYMAP_COMPILE_NO_FLAGS),
1466- &xkb_keymap_unref};
1467-
1468- state = decltype(state){
1469- xkb_state_new(keymap.get()),
1470- &xkb_state_unref};
1471+ // TODO: Maintain per-device keymaps, and send the appropriate map before
1472+ // sending an event from a keyboard with a different map.
1473+
1474+ /* The wayland::Keyboard constructor has already run, creating the keyboard
1475+ * resource. It is thus safe to send a keymap event to it; the client will receive
1476+ * the keyboard object before this event.
1477+ */
1478+ set_keymap(initial_keymap);
1479 }
1480
1481 ~WlKeyboard()
1482@@ -966,6 +968,38 @@
1483 state = decltype(state)(xkb_state_new(keymap.get()), &xkb_state_unref);
1484 }
1485
1486+ void set_keymap(mir::input::Keymap const& new_keymap)
1487+ {
1488+ xkb_rule_names const names = {
1489+ "evdev",
1490+ new_keymap.model.c_str(),
1491+ new_keymap.layout.c_str(),
1492+ new_keymap.variant.c_str(),
1493+ new_keymap.options.c_str()
1494+ };
1495+ keymap = decltype(keymap){
1496+ xkb_keymap_new_from_names(
1497+ context.get(),
1498+ &names,
1499+ XKB_KEYMAP_COMPILE_NO_FLAGS),
1500+ &xkb_keymap_unref};
1501+
1502+ // TODO: We might need to copy across the existing depressed keys?
1503+ state = decltype(state)(xkb_state_new(keymap.get()), &xkb_state_unref);
1504+
1505+ auto buffer = xkb_keymap_get_as_string(keymap.get(), XKB_KEYMAP_FORMAT_TEXT_V1);
1506+ auto length = strlen(buffer);
1507+
1508+ mir::AnonymousShmFile shm_buffer{length};
1509+ memcpy(shm_buffer.base_ptr(), buffer, length);
1510+
1511+ wl_keyboard_send_keymap(
1512+ resource,
1513+ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1,
1514+ shm_buffer.fd(),
1515+ length);
1516+ }
1517+
1518 private:
1519 std::unique_ptr<xkb_keymap, decltype(&xkb_keymap_unref)> keymap;
1520 std::unique_ptr<xkb_state, decltype(&xkb_state_unref)> state;
1521@@ -1320,8 +1354,20 @@
1522 class WlSeat
1523 {
1524 public:
1525- WlSeat(wl_display* display, std::shared_ptr<mir::Executor> const& executor)
1526- : executor{executor},
1527+ WlSeat(
1528+ wl_display* display,
1529+ std::shared_ptr<mi::InputDeviceHub> const& input_hub,
1530+ std::shared_ptr<mir::Executor> const& executor)
1531+ : config_observer{
1532+ std::make_shared<ConfigObserver>(
1533+ keymap,
1534+ [this](mir::input::Keymap const& new_keymap)
1535+ {
1536+ keymap = new_keymap;
1537+
1538+ })},
1539+ input_hub{input_hub},
1540+ executor{executor},
1541 global{wl_global_create(
1542 display,
1543 &wl_seat_interface,
1544@@ -1333,10 +1379,12 @@
1545 {
1546 BOOST_THROW_EXCEPTION(std::runtime_error("Failed to export wl_seat interface"));
1547 }
1548+ input_hub->add_observer(config_observer);
1549 }
1550
1551 ~WlSeat()
1552 {
1553+ input_hub->remove_observer(config_observer);
1554 wl_global_destroy(global);
1555 }
1556
1557@@ -1350,9 +1398,38 @@
1558 }
1559
1560 private:
1561+ class ConfigObserver : public mi::InputDeviceObserver
1562+ {
1563+ public:
1564+ ConfigObserver(
1565+ mir::input::Keymap const& keymap,
1566+ std::function<void(mir::input::Keymap const&)> const& on_keymap_commit)
1567+ : current_keymap{keymap},
1568+ on_keymap_commit{on_keymap_commit}
1569+ {
1570+ }
1571+
1572+ void device_added(std::shared_ptr<input::Device> const& device) override;
1573+ void device_changed(std::shared_ptr<input::Device> const& device) override;
1574+ void device_removed(std::shared_ptr<input::Device> const& device) override;
1575+ void changes_complete() override;
1576+
1577+ private:
1578+ mir::input::Keymap const& current_keymap;
1579+ mir::input::Keymap pending_keymap;
1580+ std::function<void(mir::input::Keymap const&)> const on_keymap_commit;
1581+ };
1582+
1583+ mir::input::Keymap keymap;
1584+ std::shared_ptr<ConfigObserver> const config_observer;
1585+
1586 std::unordered_map<wl_client*, InputCtx<WlPointer>> mutable pointer;
1587 std::unordered_map<wl_client*, InputCtx<WlKeyboard>> mutable keyboard;
1588 std::unordered_map<wl_client*, InputCtx<WlTouch>> mutable touch;
1589+
1590+ std::shared_ptr<mi::InputDeviceHub> const input_hub;
1591+
1592+
1593 std::shared_ptr<mir::Executor> const executor;
1594
1595 static void bind(struct wl_client* client, void* data, uint32_t version, uint32_t id)
1596@@ -1413,6 +1490,7 @@
1597 client,
1598 resource,
1599 id,
1600+ me->keymap,
1601 [&input_ctx](WlKeyboard* listener)
1602 {
1603 input_ctx.unregister_listener(listener);
1604@@ -1435,8 +1513,10 @@
1605 },
1606 me->executor});
1607 }
1608- static void release(struct wl_client* /*client*/, struct wl_resource* /*resource*/) {}
1609-
1610+ static void release(struct wl_client* /*client*/, struct wl_resource* us)
1611+ {
1612+ wl_resource_destroy(us);
1613+ }
1614
1615 wl_global* const global;
1616 static struct wl_seat_interface const vtable;
1617@@ -1464,6 +1544,37 @@
1618 return touch[client];
1619 }
1620
1621+void WlSeat::ConfigObserver::device_added(std::shared_ptr<input::Device> const& device)
1622+{
1623+ if (auto keyboard_config = device->keyboard_configuration())
1624+ {
1625+ if (current_keymap != keyboard_config.value().device_keymap())
1626+ {
1627+ pending_keymap = keyboard_config.value().device_keymap();
1628+ }
1629+ }
1630+}
1631+
1632+void WlSeat::ConfigObserver::device_changed(std::shared_ptr<input::Device> const& device)
1633+{
1634+ if (auto keyboard_config = device->keyboard_configuration())
1635+ {
1636+ if (current_keymap != keyboard_config.value().device_keymap())
1637+ {
1638+ pending_keymap = keyboard_config.value().device_keymap();
1639+ }
1640+ }
1641+}
1642+
1643+void WlSeat::ConfigObserver::device_removed(std::shared_ptr<input::Device> const& /*device*/)
1644+{
1645+}
1646+
1647+void WlSeat::ConfigObserver::changes_complete()
1648+{
1649+ on_keymap_commit(pending_keymap);
1650+}
1651+
1652 void WaylandEventSink::send_buffer(BufferStreamId /*id*/, graphics::Buffer& /*buffer*/, graphics::BufferIpcMsgType)
1653 {
1654 }
1655@@ -2055,6 +2166,7 @@
1656 optional_value<std::string> const& display_name,
1657 std::shared_ptr<mf::Shell> const& shell,
1658 DisplayChanger& display_config,
1659+ std::shared_ptr<mi::InputDeviceHub> const& input_hub,
1660 std::shared_ptr<mg::GraphicBufferAllocator> const& allocator,
1661 bool arw_socket)
1662 : display{wl_display_create(), &cleanup_display},
1663@@ -2089,7 +2201,7 @@
1664 display.get(),
1665 executor,
1666 this->allocator);
1667- seat_global = std::make_unique<mf::WlSeat>(display.get(), executor);
1668+ seat_global = std::make_unique<mf::WlSeat>(display.get(), input_hub, executor);
1669 output_manager = std::make_unique<mf::OutputManager>(
1670 display.get(),
1671 display_config);
1672
1673=== modified file 'src/server/frontend/wayland/wayland_connector.h'
1674--- src/server/frontend/wayland/wayland_connector.h 2017-09-15 16:34:13 +0000
1675+++ src/server/frontend/wayland/wayland_connector.h 2017-10-27 17:26:09 +0000
1676@@ -29,7 +29,10 @@
1677 namespace mir
1678 {
1679
1680-
1681+namespace input
1682+{
1683+class InputDeviceHub;
1684+}
1685 namespace graphics
1686 {
1687 class GraphicBufferAllocator;
1688@@ -54,6 +57,7 @@
1689 optional_value<std::string> const& display_name,
1690 std::shared_ptr<Shell> const& shell,
1691 DisplayChanger& display_config,
1692+ std::shared_ptr<input::InputDeviceHub> const& input_hub,
1693 std::shared_ptr<graphics::GraphicBufferAllocator> const& allocator,
1694 bool arw_socket);
1695
1696
1697=== modified file 'src/server/frontend/wayland/wayland_default_configuration.cpp'
1698--- src/server/frontend/wayland/wayland_default_configuration.cpp 2017-09-15 16:34:13 +0000
1699+++ src/server/frontend/wayland/wayland_default_configuration.cpp 2017-10-27 17:26:09 +0000
1700@@ -42,6 +42,7 @@
1701 display_name,
1702 the_frontend_shell(),
1703 *the_frontend_display_changer(),
1704+ the_input_device_hub(),
1705 the_buffer_allocator(),
1706 arw_socket);
1707 });
1708
1709=== modified file 'src/server/glib_main_loop.cpp'
1710--- src/server/glib_main_loop.cpp 2017-07-28 17:00:43 +0000
1711+++ src/server/glib_main_loop.cpp 2017-10-27 17:26:09 +0000
1712@@ -154,7 +154,19 @@
1713 detail::add_idle_gsource(main_context, G_PRIORITY_HIGH,
1714 [this]
1715 {
1716- running = false;
1717+ {
1718+ std::lock_guard<std::mutex> lock{run_on_halt_mutex};
1719+ running = false;
1720+ }
1721+ // We know any other thread sees running == false here, so don't need
1722+ // to lock run_on_halt_queue.
1723+ for (auto& action : run_on_halt_queue)
1724+ {
1725+ try { action(); }
1726+ catch (...) { handle_exception(std::current_exception()); }
1727+ }
1728+ run_on_halt_queue.clear();
1729+
1730 g_main_context_wakeup(main_context);
1731 });
1732 }
1733@@ -246,6 +258,48 @@
1734 });
1735 }
1736
1737+
1738+void mir::GLibMainLoop::enqueue_with_guaranteed_execution(mir::ServerAction const& action)
1739+{
1740+ auto const action_with_exception_handling =
1741+ [this]
1742+ {
1743+ try
1744+ {
1745+ mir::ServerAction action;
1746+ {
1747+ std::lock_guard<std::mutex> lock{run_on_halt_mutex};
1748+ action = run_on_halt_queue.front();
1749+ run_on_halt_queue.pop_front();
1750+ }
1751+ action();
1752+ }
1753+ catch (...)
1754+ {
1755+ handle_exception(std::current_exception());
1756+ }
1757+ };
1758+
1759+ {
1760+ std::lock_guard<std::mutex> lock{run_on_halt_mutex};
1761+
1762+ if (!running)
1763+ {
1764+ action();
1765+ return;
1766+ }
1767+ else
1768+ {
1769+ run_on_halt_queue.push_back(action);
1770+ }
1771+ }
1772+
1773+ detail::add_idle_gsource(
1774+ main_context,
1775+ G_PRIORITY_DEFAULT,
1776+ action_with_exception_handling);
1777+}
1778+
1779 void mir::GLibMainLoop::pause_processing_for(void const* owner)
1780 {
1781 std::lock_guard<std::mutex> lock{do_not_process_mutex};
1782
1783=== modified file 'src/server/input/default_input_device_hub.cpp'
1784--- src/server/input/default_input_device_hub.cpp 2017-07-28 17:00:43 +0000
1785+++ src/server/input/default_input_device_hub.cpp 2017-10-27 17:26:09 +0000
1786@@ -88,25 +88,26 @@
1787 auto observer = obs.lock();
1788 if (observer)
1789 {
1790- std::mutex mutex;
1791 std::condition_variable cv;
1792- std::unique_lock<decltype(mutex)> lock{mutex};
1793- bool removed{false};
1794+ std::atomic<bool> removed{false};
1795
1796- data->observer_queue->enqueue(
1797- data.get(),
1798+ data->observer_queue->enqueue_with_guaranteed_execution(
1799 [&,this]
1800 {
1801 // Unless remove() is on the same thread as add() external synchronization would be needed
1802 data->observers.remove(observer);
1803
1804- std::lock_guard<decltype(mutex)> lock{mutex};
1805+ // We do *not* take a lock and instead rely on removed being atomic,
1806+ // as enqueue_with_guaranteed_execution may run on our stack.
1807 removed = true;
1808 cv.notify_one();
1809 });
1810
1811+ std::mutex mutex;
1812+ std::unique_lock<decltype(mutex)> lock{mutex};
1813+
1814 // Before returning wait for the remove - otherwise notifications can still happen
1815- cv.wait(lock, [&] { return removed; });
1816+ cv.wait(lock, [&] { return removed.load(); });
1817 }
1818 }
1819
1820
1821=== modified file 'src/server/shell/default_persistent_surface_store.cpp'
1822--- src/server/shell/default_persistent_surface_store.cpp 2017-08-14 02:48:54 +0000
1823+++ src/server/shell/default_persistent_surface_store.cpp 2017-10-27 17:26:09 +0000
1824@@ -17,7 +17,7 @@
1825 */
1826
1827 #include "default_persistent_surface_store.h"
1828-#include <uuid/uuid.h>
1829+#include <uuid.h>
1830 #include <algorithm>
1831 #include <unordered_map>
1832 #include <boost/throw_exception.hpp>
1833
1834=== modified file 'src/utils/CMakeLists.txt'
1835--- src/utils/CMakeLists.txt 2017-05-08 03:04:26 +0000
1836+++ src/utils/CMakeLists.txt 2017-10-27 17:26:09 +0000
1837@@ -10,9 +10,11 @@
1838 mir_add_wrapped_executable(mirout out.c)
1839 target_link_libraries(mirout mirclient m)
1840
1841+if (MIR_EGL_SUPPORTED)
1842 mir_add_wrapped_executable(mirvanity vanity.c)
1843 target_include_directories(mirvanity PRIVATE ${PROJECT_SOURCE_DIR}/examples)
1844 target_link_libraries(mirvanity eglapp)
1845+endif()
1846
1847 mir_add_wrapped_executable(mirin in.cpp)
1848 target_link_libraries(mirin mirclient)
1849
1850=== modified file 'src/utils/run.cpp'
1851--- src/utils/run.cpp 2017-07-28 17:00:43 +0000
1852+++ src/utils/run.cpp 2017-10-27 17:26:09 +0000
1853@@ -85,7 +85,7 @@
1854 setenv("GDK_BACKEND", "mir", true); // configure GTK to use Mir
1855 setenv("QT_QPA_PLATFORM", "ubuntumirclient", true); // configure Qt to use Mir
1856 unsetenv("QT_QPA_PLATFORMTHEME"); // Discourage Qt from unsupported theme
1857- setenv("SDL_VIDEODRIVER", "mir", true); // configure SDL to use Mir
1858+ setenv("SDL_VIDEODRIVER", "wayland", true); // configure SDL to use Wayland
1859
1860 if (auto const client_platform = getenv("MIR_CLIENT_PLATFORM_PATH"))
1861 setenv("MIR_CLIENT_PLATFORM_PATH", canonicalize(client_platform).c_str(), true);
1862
1863=== modified file 'tests/CMakeLists.txt'
1864--- tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
1865+++ tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
1866@@ -45,6 +45,7 @@
1867 ${PROJECT_SOURCE_DIR}/include/platform
1868 ${PROJECT_SOURCE_DIR}/include/miral
1869 ${PROJECT_SOURCE_DIR}/include/server
1870+ ${MIRSERVER_INCLUDE_DIRS}
1871 ${PROJECT_SOURCE_DIR}/include/client
1872 ${PROJECT_SOURCE_DIR}/include/common
1873 ${PROJECT_SOURCE_DIR}/include/test
1874@@ -109,9 +110,9 @@
1875 mir-test-doubles-platform-static
1876 ${Boost_LIBRARIES}
1877 ${GTEST_BOTH_LIBRARIES}
1878- ${GMOCK_LIBRARY}
1879 PRIVATE
1880 ${GMOCK_MAIN_LIBRARY}
1881+ ${GMOCK_LIBRARIES}
1882 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
1883 )
1884
1885
1886=== modified file 'tests/include/mir/test/doubles/triggered_main_loop.h'
1887--- tests/include/mir/test/doubles/triggered_main_loop.h 2017-07-28 17:00:43 +0000
1888+++ tests/include/mir/test/doubles/triggered_main_loop.h 2017-10-27 17:26:09 +0000
1889@@ -41,6 +41,7 @@
1890 void unregister_fd_handler(void const* owner) override;
1891 std::unique_ptr<mir::time::Alarm> create_alarm(callback const& call) override;
1892 void enqueue(void const* owner, ServerAction const& action) override;
1893+ void enqueue_with_guaranteed_execution(ServerAction const& action) override;
1894
1895 void spawn(std::function<void()>&& work) override;
1896
1897
1898=== modified file 'tests/integration-tests/CMakeLists.txt'
1899--- tests/integration-tests/CMakeLists.txt 2017-08-25 06:41:20 +0000
1900+++ tests/integration-tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
1901@@ -69,8 +69,7 @@
1902
1903 ${Boost_LIBRARIES}
1904 ${GTEST_BOTH_LIBRARIES}
1905- ${GMOCK_LIBRARY}
1906- ${GMOCK_MAIN_LIBRARY}
1907+ ${GMOCK_LIBRARIES}
1908 # Mesa platform dependencies
1909 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
1910 ${GBM_LDFLAGS} ${GBM_LIBRARIES}
1911
1912=== modified file 'tests/mir_test_doubles/CMakeLists.txt'
1913--- tests/mir_test_doubles/CMakeLists.txt 2017-08-25 06:41:20 +0000
1914+++ tests/mir_test_doubles/CMakeLists.txt 2017-10-27 17:26:09 +0000
1915@@ -86,7 +86,7 @@
1916 mirserver
1917
1918 ${Boost_LIBRARIES}
1919- ${GMOCK_LIBRARY}
1920+ ${GMOCK_LIBRARIES}
1921 ${GMOCK_MAIN_LIBRARY}
1922 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
1923 )
1924@@ -104,7 +104,7 @@
1925 mir-test-doubles-platform-static
1926
1927 -ldl
1928- ${GMOCK_LIBRARY}
1929+ ${GMOCK_LIBRARIES}
1930 ${GMOCK_MAIN_LIBRARY}
1931 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
1932 )
1933
1934=== modified file 'tests/mir_test_doubles/triggered_main_loop.cpp'
1935--- tests/mir_test_doubles/triggered_main_loop.cpp 2017-07-28 17:00:43 +0000
1936+++ tests/mir_test_doubles/triggered_main_loop.cpp 2017-10-27 17:26:09 +0000
1937@@ -81,6 +81,12 @@
1938 actions.push_back(action);
1939 }
1940
1941+void mtd::TriggeredMainLoop::enqueue_with_guaranteed_execution(ServerAction const& action)
1942+{
1943+ base::enqueue(nullptr, action);
1944+ actions.push_back(action);
1945+}
1946+
1947 void mtd::TriggeredMainLoop::trigger_server_actions()
1948 {
1949 for (auto const& action : actions)
1950
1951=== modified file 'tests/mir_test_framework/CMakeLists.txt'
1952--- tests/mir_test_framework/CMakeLists.txt 2017-09-25 13:39:41 +0000
1953+++ tests/mir_test_framework/CMakeLists.txt 2017-10-27 17:26:09 +0000
1954@@ -85,11 +85,11 @@
1955
1956 target_link_libraries(mir-test-framework-static
1957
1958+ mirserver
1959 mirclient
1960 ${Boost_LIBRARIES}
1961 ${GTEST_BOTH_LIBRARIES}
1962- ${GMOCK_LIBRARY}
1963- ${GMOCK_MAIN_LIBRARY}
1964+ ${GMOCK_LIBRARIES}
1965 ${UMOCKDEV_LIBRARIES}
1966 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
1967 )
1968
1969=== modified file 'tests/mir_test_framework/canonical_window_manager.cpp'
1970--- tests/mir_test_framework/canonical_window_manager.cpp 2017-08-30 11:59:08 +0000
1971+++ tests/mir_test_framework/canonical_window_manager.cpp 2017-10-27 17:26:09 +0000
1972@@ -24,7 +24,7 @@
1973 #include "mir/shell/surface_ready_observer.h"
1974 #include "mir/shell/display_layout.h"
1975
1976-#include <uuid/uuid.h>
1977+#include <uuid.h>
1978 #include <linux/input.h>
1979 #include <csignal>
1980
1981
1982=== modified file 'tests/miral/drag_and_drop.cpp'
1983--- tests/miral/drag_and_drop.cpp 2017-08-23 16:15:03 +0000
1984+++ tests/miral/drag_and_drop.cpp 2017-10-27 17:26:09 +0000
1985@@ -41,7 +41,7 @@
1986 #include <gtest/gtest.h>
1987
1988 #include <linux/input.h>
1989-#include <uuid/uuid.h>
1990+#include <uuid.h>
1991
1992 #include <boost/throw_exception.hpp>
1993 #include <atomic>
1994
1995=== modified file 'tests/performance-tests/CMakeLists.txt'
1996--- tests/performance-tests/CMakeLists.txt 2017-09-18 10:57:00 +0000
1997+++ tests/performance-tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
1998@@ -28,8 +28,8 @@
1999 test_compositor.cpp
2000 )
2001 target_link_libraries(mir_compositor_performance_test
2002+ mir_system_performance_test
2003 ${GTEST_BOTH_LIBRARIES}
2004- mir_system_performance_test
2005 )
2006
2007 mir_add_wrapped_executable(mir_client_startup_performance_test
2008
2009=== modified file 'tests/unit-tests/CMakeLists.txt'
2010--- tests/unit-tests/CMakeLists.txt 2017-09-07 05:58:13 +0000
2011+++ tests/unit-tests/CMakeLists.txt 2017-10-27 17:26:09 +0000
2012@@ -136,8 +136,7 @@
2013
2014 ${PROTOBUF_LITE_LIBRARIES}
2015 ${GTEST_BOTH_LIBRARIES}
2016- ${GMOCK_LIBRARY}
2017- ${GMOCK_MAIN_LIBRARY}
2018+ ${GMOCK_LIBRARIES}
2019 ${Boost_LIBRARIES}
2020 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
2021 )
2022@@ -176,8 +175,7 @@
2023
2024 ${PROTOBUF_LITE_LIBRARIES}
2025 ${GTEST_BOTH_LIBRARIES}
2026- ${GMOCK_LIBRARY}
2027- ${GMOCK_MAIN_LIBRARY}
2028+ ${GMOCK_LIBRARIES}
2029 ${Boost_LIBRARIES}
2030 ${UMOCKDEV_LIBRARIES}
2031 ${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
2032
2033=== modified file 'tests/unit-tests/platforms/mesa/kms/test_cursor.cpp'
2034--- tests/unit-tests/platforms/mesa/kms/test_cursor.cpp 2017-07-31 08:58:34 +0000
2035+++ tests/unit-tests/platforms/mesa/kms/test_cursor.cpp 2017-10-27 17:26:09 +0000
2036@@ -24,7 +24,6 @@
2037 #include "mir/graphics/cursor_image.h"
2038
2039 #include <xf86drm.h>
2040-#include <drm/drm.h>
2041
2042 #include "mir/test/doubles/mock_gbm.h"
2043 #include "mir/test/doubles/mock_drm.h"
2044@@ -265,7 +264,7 @@
2045 {
2046 return geom::Size{geom::Width{64}, geom::Height{64}};
2047 }
2048- geom::Displacement hotspot() const
2049+ geom::Displacement hotspot() const
2050 {
2051 return geom::Displacement{0, 0};
2052 }
2053@@ -425,7 +424,7 @@
2054 if (pixels[i] != 0x0)
2055 return false;
2056 }
2057- return true;
2058+ return true;
2059 }
2060
2061 TEST_F(MesaCursorTest, show_cursor_pads_missing_data)
2062@@ -680,7 +679,7 @@
2063
2064 cursor.hide();
2065 cursor.move_to({17, 29});
2066-
2067+
2068 output_container.verify_and_clear_expectations();
2069 }
2070
2071@@ -772,7 +771,7 @@
2072 cursor.show(stub_image); // ensures initial_cursor_location
2073
2074 static geom::Displacement hotspot_displacement{10, 10};
2075-
2076+
2077 static geom::Point const
2078 initial_cursor_location = {0, 0},
2079 cursor_location_1 = {20, 20},
2080@@ -788,8 +787,8 @@
2081 return hotspot_displacement;
2082 }
2083 };
2084-
2085-
2086+
2087+
2088 EXPECT_CALL(mock_gbm, gbm_bo_write(_, _, _)).Times(AnyNumber());
2089 EXPECT_CALL(*output_container.outputs[0], set_cursor(_)).Times(AnyNumber());
2090
2091
2092=== modified file 'tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp'
2093--- tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-08-25 06:41:20 +0000
2094+++ tests/unit-tests/platforms/nested/test_nested_display_configuration.cpp 2017-10-27 17:26:09 +0000
2095@@ -155,7 +155,7 @@
2096 auto edid_size = mir_output_get_edid_size(output);
2097
2098 ASSERT_NE(nullptr, edid_start);
2099- ASSERT_NE(0, edid_size);
2100+ ASSERT_NE(0u, edid_size);
2101
2102 std::vector<uint8_t> host_edid(edid_start, edid_start+edid_size);
2103
2104
2105=== modified file 'tests/unit-tests/scene/test_mediating_display_changer.cpp'
2106--- tests/unit-tests/scene/test_mediating_display_changer.cpp 2017-08-09 11:30:59 +0000
2107+++ tests/unit-tests/scene/test_mediating_display_changer.cpp 2017-10-27 17:26:09 +0000
2108@@ -100,6 +100,10 @@
2109 {
2110 action();
2111 }
2112+ void enqueue_with_guaranteed_execution(mir::ServerAction const& action) override
2113+ {
2114+ action();
2115+ }
2116
2117 void pause_processing_for(void const* /*owner*/) override {}
2118 void resume_processing_for(void const* /*owner*/) override {}
2119@@ -110,8 +114,10 @@
2120 MockServerActionQueue()
2121 {
2122 ON_CALL(*this, enqueue(_, _)).WillByDefault(InvokeArgument<1>());
2123+ ON_CALL(*this, enqueue_with_guaranteed_execution(_)).WillByDefault(InvokeArgument<0>());
2124 }
2125 MOCK_METHOD2(enqueue, void(void const*, mir::ServerAction const&));
2126+ MOCK_METHOD1(enqueue_with_guaranteed_execution, void(mir::ServerAction const&));
2127 MOCK_METHOD1(pause_processing_for, void(void const*));
2128 MOCK_METHOD1(resume_processing_for, void(void const*));
2129 };
2130
2131=== modified file 'tests/unit-tests/test_glib_main_loop.cpp'
2132--- tests/unit-tests/test_glib_main_loop.cpp 2017-07-28 17:00:43 +0000
2133+++ tests/unit-tests/test_glib_main_loop.cpp 2017-10-27 17:26:09 +0000
2134@@ -833,6 +833,76 @@
2135 destroy_glib_main_loop);
2136 }
2137
2138+TEST_F(GLibMainLoopTest, enqueue_with_guaranteed_execution_executes_before_run)
2139+{
2140+ using namespace testing;
2141+
2142+ int num_actions{0};
2143+
2144+ ml.enqueue_with_guaranteed_execution(
2145+ [&num_actions]
2146+ {
2147+ ++num_actions;
2148+ });
2149+
2150+ EXPECT_THAT(num_actions, Eq(1));
2151+}
2152+
2153+TEST_F(GLibMainLoopTest, enqueue_with_guaranteed_execution_executes_after_stop)
2154+{
2155+ using namespace testing;
2156+
2157+ int num_actions{0};
2158+
2159+ ml.enqueue(
2160+ nullptr,
2161+ [this]()
2162+ {
2163+ ml.stop();
2164+ });
2165+
2166+ ml.run();
2167+
2168+ ml.enqueue_with_guaranteed_execution(
2169+ [&num_actions]
2170+ {
2171+ ++num_actions;
2172+ });
2173+
2174+ EXPECT_THAT(num_actions, Eq(1));
2175+}
2176+
2177+TEST_F(GLibMainLoopTest, enqueue_with_guaranteed_execution_executes_on_mainloop)
2178+{
2179+ using namespace testing;
2180+
2181+ mt::Signal loop_running;
2182+ mt::Signal loop_finished;
2183+
2184+ ml.enqueue(
2185+ nullptr,
2186+ [&loop_running]() { loop_running.raise(); });
2187+
2188+ mt::AutoJoinThread t{
2189+ [&]
2190+ {
2191+ ml.run();
2192+ loop_finished.raise();
2193+ }};
2194+
2195+ ASSERT_TRUE(loop_running.wait_for(std::chrono::seconds{5}));
2196+
2197+ ml.enqueue_with_guaranteed_execution(
2198+ [main_thread = std::this_thread::get_id()]()
2199+ {
2200+ EXPECT_THAT(std::this_thread::get_id(), Ne(main_thread));
2201+ });
2202+
2203+ ml.stop();
2204+
2205+ EXPECT_TRUE(loop_finished.wait_for(std::chrono::seconds{30}));
2206+}
2207+
2208 namespace
2209 {
2210
2211
2212=== modified file 'tests/unit-tests/test_raii.cpp'
2213--- tests/unit-tests/test_raii.cpp 2017-07-28 17:00:43 +0000
2214+++ tests/unit-tests/test_raii.cpp 2017-10-27 17:26:09 +0000
2215@@ -21,6 +21,8 @@
2216 #include <gtest/gtest.h>
2217 #include <gmock/gmock.h>
2218
2219+#include <functional>
2220+
2221 namespace
2222 {
2223 struct RaiiTest : public ::testing::Test
2224
2225=== removed file 'tools/abi_check.sh'
2226--- tools/abi_check.sh 2017-05-08 03:04:26 +0000
2227+++ tools/abi_check.sh 1970-01-01 00:00:00 +0000
2228@@ -1,315 +0,0 @@
2229-#!/bin/bash
2230-
2231-set -e
2232-
2233-declare -A abi_var_for=(\
2234- ["mircore"]="MIRCORE_ABI" \
2235- ["mirclient"]="MIRCLIENT_ABI" \
2236- ["mircommon"]="MIRCOMMON_ABI" \
2237- ["mirplatform"]="MIRPLATFORM_ABI" \
2238- ["mirserver"]="MIRSERVER_ABI" \
2239- ["mircookie"]="MIRCOOKIE_ABI" \
2240- ["mirclientplatformmesa"]="MIR_CLIENT_PLATFORM_ABI" \
2241- ["mirplatformgraphicsmesakms"]="MIR_SERVER_GRAPHICS_PLATFORM_ABI" \
2242- ["mirplatforminputevdev"]="MIR_SERVER_INPUT_PLATFORM_ABI" )
2243-
2244-declare -A libtype=(\
2245- ["mirclientplatformmesa"]="plugin-client" \
2246- ["mirplatformgraphicsmesakms"]="plugin" \
2247- ["mirplatforminputevdev"]="plugin" )
2248-
2249-declare -A package_name=(\
2250- ["mirclientplatformmesa"]="mir-client-platform-mesa" \
2251- ["mirplatformgraphicsmesakms"]="mir-platform-graphics-mesa-kms" \
2252- ["mirplatforminputevdev"]="mir-platform-input-evdev" )
2253-
2254-declare -A libsoname=(\
2255- ["mirclientplatformmesa"]="mir/client-platform/mesa" \
2256- ["mirplatformgraphicsmesakms"]="mir/server-platform/graphics-mesa-kms" \
2257- ["mirplatforminputevdev"]="mir/server-platform/input-evdev" )
2258-
2259-declare -A headers_for=(\
2260- ["mirclientplatformmesa"]="src/include/client/mir/client_platform_factory.h" \
2261- ["mirplatformgraphicsmesakms"]="mirplatform/mir/graphics/platform.h" \
2262- ["mirplatforminputevdev"]="mirplatform/mir/input" )
2263-
2264-declare -A exclusions_for=(\
2265- ["mirplatform"]="mir/input" \
2266- ["mirserver"]="mir/input/input_device_hub.h" )
2267-
2268-function print_help_and_exit()
2269-{
2270- local prog=$(basename $0)
2271-
2272- local all_libs=${!abi_var_for[@]}
2273- local all_libs=${all_libs// /|}
2274- echo "Usage: $prog <libname> <abi_dump_dir> <source_dir>"
2275- echo "Runs a full ABI check on the given library."
2276- echo ""
2277- echo " libname=[${all_libs}]"
2278- exit 0
2279-}
2280-
2281-function get_abi_number()
2282-{
2283- local abi_var=${1}
2284- local search_dir=${2}
2285- grep -hR --include=CMakeLists.txt "set($abi_var [[:digit:]]\+)" ${search_dir}/src | grep -o '[[:digit:]]\+'
2286-}
2287-
2288-function is_plugin()
2289-{
2290- local name=${1}
2291- if [[ ${libtype[${name}]} == "plugin"* ]];
2292- then
2293- return 0
2294- else
2295- return 1
2296- fi
2297-}
2298-
2299-function package_abi_for()
2300-{
2301- local name=${1}
2302- local pkg_name=lib${name}
2303-
2304- if is_plugin ${name};
2305- then
2306- pkg_name=${package_name[${name}]}
2307- fi
2308-
2309- apt-cache show ${pkg_name}* | grep Package: | grep -o '[[:digit:]]\+' | sort -n -r | head -n 1
2310-}
2311-
2312-function needs_abi_check()
2313-{
2314- local name=${1}
2315- local source_dir=${2}
2316- local abi_var=${abi_var_for[${name}]}
2317-
2318- local old_abi=$(package_abi_for ${name})
2319- local new_abi=$(get_abi_number ${abi_var} ${source_dir})
2320- if [ -z "${old_abi}" ];
2321- then
2322- echo "Failed to find old ${abi_var}" >&2
2323- exit 1
2324- fi
2325-
2326- if [ -z "${new_abi}" ];
2327- then
2328- echo "Failed to find new ${abi_var}" >&2
2329- exit 1
2330- fi
2331- echo "Detected ${abi_var}_new=${new_abi}"
2332- echo "Detected ${abi_var}_old=${old_abi}"
2333-
2334- if [ "${old_abi}" == "${new_abi}" ];
2335- then
2336- return 0
2337- else
2338- return 1
2339- fi
2340-}
2341-
2342-function prepare_pkg_dir()
2343-{
2344- local pkg_dir=${1}
2345-
2346- # "partial" is required by apt-get
2347- mkdir -p ${pkg_dir}/partial
2348-}
2349-
2350-function package_name_for()
2351-{
2352- local name=${1}
2353- local pkg_name=lib${name}
2354-
2355- if is_plugin ${name};
2356- then
2357- pkg_name=${package_name[${name}]}
2358- fi
2359-
2360- local abi_number=$(package_abi_for ${name})
2361- echo ${pkg_name}${abi_number}
2362-}
2363-
2364-function header_packages_for()
2365-{
2366- local name=${1}
2367- local pkg=lib${name}-dev
2368-
2369- if is_plugin ${name};
2370- then
2371- # Some plugin headers are defined in this package
2372- pkg="libmirplatform-dev"
2373- fi
2374-
2375- # Only interested in other mir dev package deps
2376- local dev_deps=$(apt-cache depends ${pkg} | grep Depends: | grep -o "\<libmir.*-dev\>"| tr '\n' ' ')
2377-
2378- # Workaround missing dependency
2379- if [ ${name} == "mirserver" ] || [ ${name} == "mirplatforminputevdev" ];
2380- then
2381- dev_deps="${dev_deps} libmirclient-dev"
2382- fi
2383-
2384- echo "${pkg} ${dev_deps}"
2385-}
2386-
2387-function soname_for()
2388-{
2389- local name=${1}
2390- local pkg_dir=${2}
2391- local arch=$(gcc -dumpmachine)
2392- local abi_number=$(package_abi_for ${name})
2393- local so_name=lib${name}
2394-
2395- if is_plugin ${name};
2396- then
2397- so_name=${libsoname[${name}]}
2398- fi
2399-
2400- echo ${pkg_dir}/usr/lib/${arch}/${so_name}.so.${abi_number}
2401-}
2402-
2403-function download_packages()
2404-{
2405- local name=${1}
2406- local pkg_dir=${2}
2407- local pkg_name=$(package_name_for ${name})
2408- local header_pkgs=$(header_packages_for ${name})
2409-
2410- echo "Downloading: ${pkg_name} ${header_pkgs} for ${name}"
2411- apt-get -d -o Dir::Cache=${pkg_dir} -o Debug::NoLocking=1 install --reinstall -y ${pkg_name} ${header_pkgs}
2412-}
2413-
2414-function download_mir_source_into()
2415-{
2416- local pkg_dir=${1}
2417- pushd ${pkg_dir} > /dev/null
2418-
2419- apt-get source --download-only mir
2420- mkdir -p mirsource
2421-
2422- local src_pkg=$(apt-cache showsrc mir | grep -o "mir.*orig.tar.gz" | head -n 1)
2423- tar xf ${src_pkg} -C mirsource --strip-components 1
2424-
2425- popd > /dev/null
2426-}
2427-
2428-function unpack_debs()
2429-{
2430- local pkg_dir=${1}
2431-
2432- for deb in ${pkg_dir}/archives/* ;
2433- do
2434- if [ ! -d ${deb} ] ; then
2435- echo "unpacking: ${deb}"
2436- dpkg -x ${deb} ${pkg_dir}
2437- fi
2438- done
2439-}
2440-
2441-function make_lib_descriptor()
2442-{
2443- local name=${1}
2444- local pkg_dir=${2}
2445- local descriptor_file=${3}
2446-
2447- local abi_number=$(package_abi_for ${name})
2448- local lib=$(soname_for ${name} ${pkg_dir})
2449-
2450- local lib_includes=
2451- for path in $(ls ${pkg_dir}/usr/include);
2452- do
2453- lib_includes=${lib_includes}${pkg_dir}/usr/include/${path}"\n"
2454- done
2455-
2456- local lib_headers=${pkg_dir}/usr/include/${name}
2457- local lib_skip_headers=
2458- for path in ${exclusions_for[${name}]};
2459- do
2460- lib_skip_headers=${lib_excludes}${pkg_dir}/usr/include/${name}/${path}"\n"
2461- done
2462-
2463- if [ "${libtype[${name}]}" == "plugin-client" ];
2464- then
2465- download_mir_source_into ${pkg_dir}
2466- lib_headers=${pkg_dir}/mirsource/${headers_for[${name}]}
2467- elif [ "${libtype[${name}]}" == "plugin" ];
2468- then
2469- lib_headers=${pkg_dir}/usr/include/${headers_for[${name}]}
2470- fi
2471-
2472- cp ${SOURCE_DIR}/tools/lib_descriptor.xml.skel ${descriptor_file}
2473- sed -i 's@${LIB_DESC_LIBS}@'${lib}'@g' ${descriptor_file}
2474- sed -i 's@${LIB_DESC_HEADERS}@'${lib_headers}'@g' ${descriptor_file}
2475- sed -i 's@${LIB_DESC_INCLUDE_PATHS}@'${lib_includes}'@g' ${descriptor_file}
2476- sed -i 's/${LIB_DESC_GCC_OPTS}/-std=c++14/g' ${descriptor_file}
2477- sed -i 's@${LIB_DESC_SKIP_HEADERS}@'${lib_skip_headers}'@g' ${descriptor_file}
2478- sed -i 's/${LIB_DESC_DEFINES}//g' ${descriptor_file}
2479-}
2480-
2481-function dump_abi_for_prev_release()
2482-{
2483- local name=${1}
2484- local abi_dump_dir=${2}
2485- local abi_dump=${3}
2486- local pkg_dir=${abi_dump_dir}/prev-release-pkgs
2487-
2488- if [ ! -s "${abi_dump}" ];
2489- then
2490- echo "Generating ${abi_dump}"
2491- prepare_pkg_dir ${pkg_dir}
2492- download_packages ${name} ${pkg_dir}
2493- unpack_debs ${pkg_dir}
2494-
2495- local descriptor_file=${pkg_dir}/${name}_desc.xml
2496- make_lib_descriptor ${name} ${pkg_dir} ${descriptor_file}
2497-
2498- abi-compliance-checker -gcc-path g++ -l ${name} -v1 previous -dump-path ${abi_dump} -dump-abi ${descriptor_file}
2499- fi
2500-
2501- if [ ! -s "${abi_dump}" ];
2502- then
2503- echo "Error: failed to generate abi dump for ${name}"
2504- exit 1;
2505- fi
2506-}
2507-
2508-function run_abi_check()
2509-{
2510- local name=${1}
2511- local old_dump=${2}
2512- local new_dump=${3}
2513- local skip_symbols_file=${4}
2514-
2515- if [ -f ${skip_symbols_file} ];
2516- then
2517- local skip_symbols_opt="-skip-symbols ${skip_symbols_file}"
2518- fi
2519-
2520- echo "Running abi-compliance-checker for ${name}"
2521- abi-compliance-checker -l ${NAME} -old "${old_dump}" -new "${new_dump}" ${skip_symbols_opt}
2522-}
2523-
2524-if [ $# -ne 3 ];
2525-then
2526- print_help_and_exit
2527-fi
2528-
2529-NAME=${1}
2530-ABI_DUMP_DIR=${2}
2531-SOURCE_DIR=${3}
2532-
2533-OLD_ABI_DUMP_FILE=${ABI_DUMP_DIR}/${NAME}_prev.abi.tar.gz
2534-NEW_ABI_DUMP_FILE=${ABI_DUMP_DIR}/${NAME}_next.abi.tar.gz
2535-SKIP_SYMBOLS_FILE=${SOURCE_DIR}/tools/abi-check-${NAME}-skip-symbols
2536-
2537-if needs_abi_check ${NAME} ${SOURCE_DIR};
2538-then
2539- dump_abi_for_prev_release ${NAME} ${ABI_DUMP_DIR} ${OLD_ABI_DUMP_FILE}
2540- run_abi_check ${NAME} ${OLD_ABI_DUMP_FILE} ${NEW_ABI_DUMP_FILE} ${SKIP_SYMBOLS_FILE}
2541-else
2542- echo "No need for abi-compliance-checker, ABI has already been bumped for ${NAME}"
2543-fi
2544
2545=== modified file 'tools/setup-partial-armhf-chroot.sh'
2546--- tools/setup-partial-armhf-chroot.sh 2017-05-08 03:04:26 +0000
2547+++ tools/setup-partial-armhf-chroot.sh 2017-10-27 17:26:09 +0000
2548@@ -10,9 +10,9 @@
2549 usage() {
2550 echo "Usage: ${name} [options] mychroot-dir"
2551 echo "options:"
2552- echo " -a arch Select architecture, i.e. armhf, arm64, ppc... Default is armhf"
2553- echo " -d dist Select distribution, i.e. vivid, wily. Default is vivid"
2554- echo " -r rep Select an additional repository for bootstrap. Default is none"
2555+ echo " -a arch Select architecture, i.e. armhf, arm64, ppc... Default is armhf"
2556+ echo " -d dist Select distribution, i.e. vivid, wily. Default is vivid"
2557+ echo " -r rep Select an additional repository for bootstrap. Default is none"
2558 echo
2559 echo "please supply at least a directory to create partial chroot in. (eg, ./setup-partial-armhf-chroot.sh mychroot-dir)"
2560 }
2561@@ -39,7 +39,7 @@
2562 sources="$sources source$sourceid"
2563 ;;
2564 :)
2565- echo "Option -$OPTARG requires an argument"
2566+ echo "Option -$OPTARG requires an argument"
2567 usage
2568 exit 1
2569 ;;
2570@@ -48,7 +48,7 @@
2571 exit 0
2572 ;;
2573 \?)
2574- echo "Invalid option: -$OPTARG"
2575+ echo "Invalid option: -$OPTARG"
2576 usage
2577 exit 1
2578 ;;
2579@@ -66,7 +66,7 @@
2580 echo "creating phablet-compatible $arch partial chroot for mir compilation in directory ${directory}"
2581
2582 if [ ! -d ${directory} ]; then
2583- mkdir -p ${directory}
2584+ mkdir -p ${directory}
2585 fi
2586
2587 DEBCONTROL=$(pwd)/../debian/control
2588@@ -83,7 +83,7 @@
2589 # dpkg-checkbuilddeps returns non-zero when dependencies are not met and the list is sent to stderr
2590 builddeps=$(dpkg-checkbuilddeps -a ${arch} --admindir=. ${DEBCONTROL} 2>&1 )
2591 if [ $? -eq 0 ] ; then
2592- exit 0
2593+ exit 0
2594 fi
2595 echo "${builddeps}"
2596
2597@@ -97,7 +97,6 @@
2598 -e 's/Unmet build dependencies://g' \
2599 -e 's/build-essential:native//g')
2600 builddeps=$(echo ${builddeps} | sed 's/([^)]*)//g')
2601-builddeps=$(echo ${builddeps} | sed -e 's/abi-compliance-checker//g')
2602 builddeps=$(echo ${builddeps} | sed -e 's/multistrap//g')
2603
2604 case ${arch} in
2605@@ -143,7 +142,7 @@
2606 done
2607
2608 # Fakeroot is required to stop the apt update command giving up
2609-fakeroot multistrap -f mstrap.conf
2610+fakeroot multistrap -f mstrap.conf
2611
2612 rm -f var/cache/apt/archives/lock
2613
2614@@ -163,4 +162,4 @@
2615 ln -sf $(pwd)$(readlink ${broken_symlink}) ${broken_symlink}
2616 done
2617
2618-popd > /dev/null
2619+popd > /dev/null

Subscribers

People subscribed via source and target branches