From 4979b7733ed53ede1cdb91a27ba74ead3625848e Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Sun, 2 Sep 2018 17:00:23 +0200 Subject: [PATCH 1/7] cpu_features: fix clang, set cast-align to warning Change -Wcast-align from error to warning for clang compiler by adding the -Wno-error=cast-align compiler flag. Fixes #881 --- external/cpu_features/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/external/cpu_features/CMakeLists.txt b/external/cpu_features/CMakeLists.txt index 9893e50..b978e97 100644 --- a/external/cpu_features/CMakeLists.txt +++ b/external/cpu_features/CMakeLists.txt @@ -5,6 +5,10 @@ project(CpuFeatures VERSION 0.1.0) # ANBOX allow to build in our more strict build environment set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=switch-default -Wno-error=unused-parameter -Wno-error=overflow") +if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=cast-align") +endif() + # Default Build Type to be Release if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING From 0482cdb7eae3eb1a61de63d8a12229feb77995f5 Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Sun, 2 Sep 2018 17:06:51 +0200 Subject: [PATCH 2/7] dbus: fix clang compile errors This commit downgrades the following clang compiler errors into warnings: * unused-private-field * unused-const-variable * unused-lambda-capture --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f411999..8d9479a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,12 @@ set(C_AND_CXX_WARNINGS "-pedantic -Wall -Wextra") set(EXTRA_C_WARNINGS "-Wcast-align -Wcast-qual -Wformat -Wredundant-decls -Wswitch-default") set(EXTRA_CXX_WARNINGS "-Wnon-virtual-dtor -Wold-style-cast") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-private-field") + set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-const-variable") + set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-lambda-capture") +endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_AND_CXX_WARNINGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_WARNINGS}") From 3c1d7e6149bb9b442f969deaaa4d8ab690345cce Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Tue, 4 Sep 2018 19:24:52 +0200 Subject: [PATCH 3/7] dbus: remove private unused field type_ This commit removes the private unused field type_ from anbox::dbus::Bus and promotes -Wunused-private-field back to error level on clang. --- CMakeLists.txt | 1 - src/anbox/dbus/bus.cpp | 4 +--- src/anbox/dbus/bus.h | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d9479a..90144cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ set(EXTRA_C_WARNINGS "-Wcast-align -Wcast-qual -Wformat -Wredundant-decls -Wswit set(EXTRA_CXX_WARNINGS "-Wnon-virtual-dtor -Wold-style-cast") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-private-field") set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-const-variable") set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-lambda-capture") endif() diff --git a/src/anbox/dbus/bus.cpp b/src/anbox/dbus/bus.cpp index 9c3af18..92813f9 100644 --- a/src/anbox/dbus/bus.cpp +++ b/src/anbox/dbus/bus.cpp @@ -20,9 +20,7 @@ namespace anbox { namespace dbus { -Bus::Bus(Type type) : - type_{type} { - +Bus::Bus(Type type) { int ret = 0; switch (type) { case Type::Session: diff --git a/src/anbox/dbus/bus.h b/src/anbox/dbus/bus.h index 218e472..fe3eeac 100644 --- a/src/anbox/dbus/bus.h +++ b/src/anbox/dbus/bus.h @@ -48,7 +48,6 @@ class Bus : public DoNotCopyOrMove { private: void worker_main(); - Type type_; sd_bus *bus_ = nullptr; std::thread worker_thread_; std::atomic_bool running_{false}; From 92c2481fb9a12c7653bf74559a47c086495d5ea1 Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Tue, 4 Sep 2018 19:33:26 +0200 Subject: [PATCH 4/7] cmds: remove unused lambda capture this Remove a unused lambda capture on [this] in anbox::cmds::CheckFeatures::CheckFeatures() and promote -Wunused-lambda-capture back to error level on clang. --- CMakeLists.txt | 1 - src/anbox/cmds/check_features.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90144cc..bcde1a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,6 @@ set(EXTRA_CXX_WARNINGS "-Wnon-virtual-dtor -Wold-style-cast") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-const-variable") - set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-lambda-capture") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_AND_CXX_WARNINGS}") diff --git a/src/anbox/cmds/check_features.cpp b/src/anbox/cmds/check_features.cpp index 5826d59..dbb7dc5 100644 --- a/src/anbox/cmds/check_features.cpp +++ b/src/anbox/cmds/check_features.cpp @@ -42,7 +42,7 @@ anbox::cmds::CheckFeatures::CheckFeatures() cli::Name{"check-features"}, cli::Usage{"check-features"}, cli::Description{"Check that the host system supports all necessary features"}} { - action([this](const cli::Command::Context&) { + action([](const cli::Command::Context&) { #if defined(CPU_FEATURES_ARCH_X86) const auto info = cpu_features::GetX86Info(); std::vector missing_features; From 85fb89c2f48644eb6ad7677b03081455a5b66da5 Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Tue, 4 Sep 2018 19:40:49 +0200 Subject: [PATCH 5/7] graphics: remove unused const variable This removes the constexpr const char * default_glesv1_lib and promote -Wunused-const-variable back to error level on clang. --- CMakeLists.txt | 4 ---- src/anbox/graphics/emugl/RenderApi.cpp | 1 - 2 files changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bcde1a8..f411999 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,10 +24,6 @@ set(C_AND_CXX_WARNINGS "-pedantic -Wall -Wextra") set(EXTRA_C_WARNINGS "-Wcast-align -Wcast-qual -Wformat -Wredundant-decls -Wswitch-default") set(EXTRA_CXX_WARNINGS "-Wnon-virtual-dtor -Wold-style-cast") -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(EXTRA_CXX_WARNINGS "${EXTRA_CXX_WARNINGS} -Wno-error=unused-const-variable") -endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_AND_CXX_WARNINGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_WARNINGS}") diff --git a/src/anbox/graphics/emugl/RenderApi.cpp b/src/anbox/graphics/emugl/RenderApi.cpp index b798c29..df02d6f 100644 --- a/src/anbox/graphics/emugl/RenderApi.cpp +++ b/src/anbox/graphics/emugl/RenderApi.cpp @@ -30,7 +30,6 @@ GLESv1Dispatch s_gles1; namespace { constexpr const char *default_egl_lib{"libEGL.so.1"}; -constexpr const char *default_glesv1_lib{"libGLESv1_CM.so.1"}; constexpr const char *default_glesv2_lib{"libGLESv2.so.2"}; } From 4bbc519626a7b42be2fcf384d2b6869b811eb611 Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Tue, 4 Sep 2018 19:48:00 +0200 Subject: [PATCH 6/7] dbus: demote clang c99-extensions error to warning This commit uses GCC friendly pragmas to demote a clang error on C99-specific feature usage to a warning. The C99 feature that is used here is compound literals. It gets used trough a macro from the dbus C library. --- src/anbox/dbus/stub/application_manager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/anbox/dbus/stub/application_manager.cpp b/src/anbox/dbus/stub/application_manager.cpp index 3487793..58b716c 100644 --- a/src/anbox/dbus/stub/application_manager.cpp +++ b/src/anbox/dbus/stub/application_manager.cpp @@ -114,7 +114,12 @@ void ApplicationManager::launch(const android::Intent &intent, if (r < 0) throw std::runtime_error("Failed to construct DBus message"); + #pragma GCC diagnostic push + #pragma GCC diagnostic warning "-Wpragmas" + #pragma GCC diagnostic warning "-Wc99-extensions" sd_bus_error error = SD_BUS_ERROR_NULL; + #pragma GCC diagnostic pop + r = sd_bus_call(bus_->raw(), m, 0, &error, nullptr); if (r < 0) { const auto msg = utils::string_format("%s", error.message); From ab8a8094cc0609d1807f33b3549cfd7fe42e3136 Mon Sep 17 00:00:00 2001 From: Simon Fels Date: Sat, 8 Sep 2018 15:36:42 +0200 Subject: [PATCH 7/7] Add probot stale configuration We want to get issues without activity closed after a while unless they are marked with specific labels to keep things clean and maintainable. --- .github/stale.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..850b57d --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,34 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 120 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - android + - app-support + - bug + - build + - container + - distro-support + - documentation + - duplicate + - enhancement + - help wanted + - kernel + - not-snap + - question + - session manager + - sigill + - startup + - tools + - undecided + - upstream-bug +# Label to use when marking an issue as stale +staleLabel: decaying +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false