Skip to content

Commit

Permalink
Merge branch 'main' into feature/window_management_testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkae committed Jun 27, 2024
2 parents 47690cc + 0980da3 commit 4273f01
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 47 deletions.
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
10
31 changes: 10 additions & 21 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ export CCACHE_BASEDIR = $(shell pwd)
export MIR_SERVER_LOGGING = on
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_HOST_ARCH_ENDIAN),little)
XDG_RUNTIME_DIR=/tmp GTEST_OUTPUT=xml:./ dh_auto_build -- ARGS="-V" ptest
else
echo "Testsuite disabled on $(DEB_HOST_ARCH) due to lack of big-endian support."
endif
else
# Run tests across Launchpad RISC-V builds (LP#1891686)
ifeq ($(USER) $(DEB_HOST_ARCH),buildd riscv64)
Expand All @@ -36,45 +32,38 @@ COMMON_CONFIGURE_OPTIONS = \
-DMIR_LINK_TIME_OPTIMIZATION=ON\

ifeq ($(filter ppc64el,$(DEB_HOST_ARCH)),ppc64el)
# Disable spurious error on GCC-12
ifneq ($(shell gcc --version | grep '12.[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_COMPILER_QUIRKS="libinput_environment.cpp:restrict"
endif
# Disable spurious error on GCC-13
ifneq ($(shell gcc --version | grep '13.[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_COMPILER_QUIRKS="test_touchspot_controller.cpp:array-bounds"
endif
endif
ifeq ($(filter riscv64,$(DEB_HOST_ARCH)),riscv64)
# Disable spurious error on GCC-12
ifneq ($(shell gcc --version | grep '12.[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_COMPILER_QUIRKS="test_linearising_executor.cpp:use-after-free"
endif
endif

# Disable LTO if optimizations are off
ifeq ($(filter noopt,$(DEB_BUILD_OPTIONS)),noopt)
COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=OFF
DEB_BUILD_MAINT_OPTIONS += optimize=-lto
endif

# Disable LTO on binutils 2.42.50.20240618
# https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/2070302
ifneq ($(shell ld --version | grep '2.42.50.20240618$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_LINK_TIME_OPTIMIZATION=OFF
DEB_BUILD_MAINT_OPTIONS += optimize=-lto
endif

# We can't guarantee non-Ubuntu builds will build against WLCS packages we
# control, so disable it on non-Ubuntu builds
ifeq ($(filter Ubuntu,$(DEB_VENDOR)),)
COMMON_CONFIGURE_OPTIONS += -DMIR_RUN_WLCS_TESTS=OFF
endif

# Disable miral tests on Launchpad riscv64 (MirServer/mir#2375)
# Disable miral tests on Launchpad riscv64 (canonical/mir#3443)
ifeq ($(USER) $(DEB_HOST_ARCH),buildd riscv64)
COMMON_CONFIGURE_OPTIONS += -DMIR_RUN_MIRAL_TESTS=OFF
# Disable unit tests on Launchpad riscv64 jammy kinetic
ifneq ($(filter jammy kinetic lunar,$(DEB_DISTRIBUTION)),)
COMMON_CONFIGURE_OPTIONS += -DMIR_RUN_UNIT_TESTS=OFF
endif
endif

# Disable pre-compiled headers on GCC-12 & 13
ifneq ($(shell gcc --version | grep '1[23].[[:digit:]]\+.[[:digit:]]\+$$'),)
# Disable pre-compiled headers on GCC-13
ifneq ($(shell gcc --version | grep '13.[[:digit:]]\+.[[:digit:]]\+$$'),)
COMMON_CONFIGURE_OPTIONS += -DMIR_USE_PRECOMPILED_HEADERS=OFF
endif

Expand Down
5 changes: 3 additions & 2 deletions src/common/sharedlibrary/shared_library_prober.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "mir/shared_library.h"

#include <boost/filesystem.hpp>
#include <boost/throw_exception.hpp>

#include <system_error>
#include <cstring>
Expand All @@ -31,8 +32,8 @@ std::error_code boost_to_std_error(boost::system::error_code const& ec)
{
if (ec.category() != boost::system::system_category())
{
throw std::logic_error{"Boost error from unexpected category: " +
ec.message()};
BOOST_THROW_EXCEPTION(std::logic_error{"Boost error from unexpected category: " +
ec.message()});
}
return std::error_code{ec.value(), std::system_category()};
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/depth_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "mir/depth_layer.h"

#ifndef __clang__
#include <stdexcept>
#include "mir/fatal.h"
#endif

auto mir::mir_depth_layer_get_index(MirDepthLayer depth_layer) -> unsigned int
Expand All @@ -34,6 +34,6 @@ auto mir::mir_depth_layer_get_index(MirDepthLayer depth_layer) -> unsigned int
// GCC and Clang both ensure the switch is exhaustive.
// GCC, however, gets a "control reaches end of non-void function" warning without this
#ifndef __clang__
throw std::logic_error("Invalid MirDepthLayer in mir::mir_depth_layer_get_index()");
fatal_error_abort("Invalid MirDepthLayer in mir::mir_depth_layer_get_index()");
#endif
}
6 changes: 3 additions & 3 deletions src/miral/basic_window_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1121,20 +1121,20 @@ void miral::BasicWindowManager::modify_window(WindowInfo& window_info, WindowSpe

if (!window_info.can_morph_to(new_type))
{
throw std::runtime_error("Unsupported window type change");
BOOST_THROW_EXCEPTION(std::runtime_error("Unsupported window type change"));
}

if (window_info_tmp.must_not_have_parent())
{
if (modifications.parent().is_set())
throw std::runtime_error("Target window type does not support parent");
BOOST_THROW_EXCEPTION(std::runtime_error("Target window type does not support parent"));

window_info_tmp.parent({});
}
else if (window_info_tmp.must_have_parent())
{
if (!window_info_tmp.parent())
throw std::runtime_error("Target window type requires parent");
BOOST_THROW_EXCEPTION(std::runtime_error("Target window type requires parent"));
}
}

Expand Down
1 change: 0 additions & 1 deletion src/platforms/eglstream-kms/server/buffer_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
#include <boost/throw_exception.hpp>
#include <boost/exception/errinfo_errno.hpp>

#include <system_error>
#include <cassert>


Expand Down
1 change: 0 additions & 1 deletion src/platforms/gbm-kms/server/buffer_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@

#include <optional>
#include <stdexcept>
#include <system_error>
#include <cassert>
#include <fcntl.h>
#include <xf86drm.h>
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/gbm-kms/server/kms/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ mgg::Cursor::Cursor(

hide();
if (last_set_failed)
throw std::runtime_error("Initial KMS cursor set failed");
BOOST_THROW_EXCEPTION(std::runtime_error("Initial KMS cursor set failed"));
}

mgg::Cursor::~Cursor() noexcept
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/gbm-kms/server/kms/platform_symbols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ auto probe_display_platform(

if (auto error = -drmSetInterfaceVersion(tmp_fd, &sv))
{
throw std::system_error{
BOOST_THROW_EXCEPTION((std::system_error{
error,
std::system_category(),
std::string{"Failed to set DRM interface version on device "} + device.devnode()};
std::string{"Failed to set DRM interface version on device "} + device.devnode()}));
}

// For now, we *also* require our DisplayPlatform to support creating a HW EGL context
Expand Down
2 changes: 1 addition & 1 deletion src/server/graphics/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ auto mir::DefaultServerConfiguration::the_rendering_platforms() ->
if (platforms.empty())
{
auto msg = "Failed to find any platform plugins in: " + path;
throw std::runtime_error(msg.c_str());
BOOST_THROW_EXCEPTION(std::runtime_error(msg.c_str()));
}

auto display_targets = the_display_platforms();
Expand Down
6 changes: 0 additions & 6 deletions tests/mir_test_framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ set_property(
SOURCE udev_environment.cpp
PROPERTY COMPILE_OPTIONS -Wno-variadic-macros)

if ("libinput_environment.cpp:restrict" IN_LIST MIR_COMPILER_QUIRKS)
set_property(
SOURCE libinput_environment.cpp
PROPERTY COMPILE_OPTIONS -Wno-error=restrict)
endif()

# Umockdev uses glib, which uses the deprecated "register" storage qualifier
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dregister=")

Expand Down
6 changes: 0 additions & 6 deletions tests/unit-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,6 @@ set_property(
SOURCE graphics/test_platform_prober.cpp
PROPERTY COMPILE_OPTIONS -Wno-variadic-macros)

if ("test_linearising_executor.cpp:use-after-free" IN_LIST MIR_COMPILER_QUIRKS)
set_property(
SOURCE test_linearising_executor.cpp
PROPERTY COMPILE_OPTIONS -Wno-error=use-after-free # riscv64 spuriously warns here
)
endif()
if ("test_touchspot_controller.cpp:array-bounds" IN_LIST MIR_COMPILER_QUIRKS)
set_property(
SOURCE input/test_touchspot_controller.cpp
Expand Down

0 comments on commit 4273f01

Please sign in to comment.