From 965de22b12ebf3ba0d12d81aadba88c49e5d2166 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Thu, 7 Mar 2024 17:36:33 +0100 Subject: [PATCH 01/16] manager: add support for --version command line parameter This adds the Unix/Linux traditional commmand line argument "--version" so that it is possible to retrieve the version of the binary. Example output: /usr/bin/manager (everest-framework 0.10.1) Signed-off-by: Michael Heimpold --- src/CMakeLists.txt | 5 +++++ src/cmake-vars.h.in | 5 +++++ src/manager.cpp | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 src/cmake-vars.h.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6be217a2..e3d7ca53 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,6 @@ +# make some cmake variables available as defines +configure_file(cmake-vars.h.in cmake-vars.h @ONLY) + add_executable(manager) target_sources(manager PRIVATE @@ -5,6 +8,8 @@ target_sources(manager manager.cpp ) +target_include_directories(manager PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries(manager PRIVATE everest::framework diff --git a/src/cmake-vars.h.in b/src/cmake-vars.h.in new file mode 100644 index 00000000..0d2071a8 --- /dev/null +++ b/src/cmake-vars.h.in @@ -0,0 +1,5 @@ +#pragma once + +#define PROJECT_NAME "@PROJECT_NAME@" +#define PROJECT_DESCRIPTION "@PROJECT_DESCRIPTION@" +#define PROJECT_VERSION "@PROJECT_VERSION@" diff --git a/src/manager.cpp b/src/manager.cpp index eb38ad12..2f41b598 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -33,6 +33,7 @@ #include "controller/ipc.hpp" #include "system_unix.hpp" +#include "cmake-vars.h" namespace po = boost::program_options; namespace fs = std::filesystem; @@ -715,6 +716,7 @@ int boot(const po::variables_map& vm) { int main(int argc, char* argv[]) { po::options_description desc("EVerest manager"); + desc.add_options()("version", "Print version and exit"); desc.add_options()("help,h", "produce help message"); desc.add_options()("check", "Check and validate all config files and exit (0=success)"); desc.add_options()("dump", po::value(), @@ -746,6 +748,11 @@ int main(int argc, char* argv[]) { return EXIT_SUCCESS; } + if (vm.count("version") != 0) { + std::cout << argv[0] << " (" << PROJECT_NAME << " " << PROJECT_VERSION << ")" << std::endl; + return EXIT_SUCCESS; + } + return boot(vm); } catch (const BootException& e) { From c37fa115cfa2679ae15017662979e591deb0e9f9 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Tue, 12 Mar 2024 16:15:10 +0100 Subject: [PATCH 02/16] ModuleLoader: add support to print version via command line The generated code of each C++ module uses the module loader for processing command line parameters etc. This is why we have to extend the class and pass the version information from the generated files into the framework library here. Signed-off-by: Michael Heimpold --- include/framework/runtime.hpp | 4 +++- lib/runtime.cpp | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/framework/runtime.hpp b/include/framework/runtime.hpp index fd7883b3..00504199 100644 --- a/include/framework/runtime.hpp +++ b/include/framework/runtime.hpp @@ -150,11 +150,13 @@ class ModuleLoader { std::string module_id; std::string original_process_name; ModuleCallbacks callbacks; + const std::string project_name; + const std::string project_version; bool parse_command_line(int argc, char* argv[]); public: - explicit ModuleLoader(int argc, char* argv[], ModuleCallbacks callbacks); + explicit ModuleLoader(int argc, char* argv[], ModuleCallbacks callbacks, const char* project_name, const char* project_version); int initialize(); }; diff --git a/lib/runtime.cpp b/lib/runtime.cpp index 66c089be..3be21595 100644 --- a/lib/runtime.cpp +++ b/lib/runtime.cpp @@ -377,8 +377,8 @@ ModuleCallbacks::ModuleCallbacks(const std::functionparse_command_line(argc, argv)) { return; } @@ -524,6 +524,7 @@ int ModuleLoader::initialize() { bool ModuleLoader::parse_command_line(int argc, char* argv[]) { po::options_description desc("EVerest"); + desc.add_options()("version", "Print version and exit"); desc.add_options()("help,h", "produce help message"); desc.add_options()("prefix", po::value(), "Set main EVerest directory"); desc.add_options()("module,m", po::value(), @@ -540,6 +541,11 @@ bool ModuleLoader::parse_command_line(int argc, char* argv[]) { return false; } + if (vm.count("version") != 0) { + std::cout << argv[0] << " (" << project_name << " " << project_version << ")" << std::endl; + return false; + } + const auto prefix_opt = parse_string_option(vm, "prefix"); const auto config_opt = parse_string_option(vm, "config"); this->runtime_settings = std::make_unique(prefix_opt, config_opt); From d26679c1d5597bd665b183f6ad11f62c2c44aaa2 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 4 Apr 2024 17:45:07 +0200 Subject: [PATCH 03/16] Add additional backwards compatible ModuleLoader constructor change project_name and project_version paramters to a struct VersionInformation that also includes a git_version member Signed-off-by: Kai-Uwe Hermann --- include/framework/runtime.hpp | 16 +++++++++++++--- lib/runtime.cpp | 9 ++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/include/framework/runtime.hpp b/include/framework/runtime.hpp index 00504199..918a9cd9 100644 --- a/include/framework/runtime.hpp +++ b/include/framework/runtime.hpp @@ -120,6 +120,8 @@ struct RuntimeSettings { std::string run_as_user; + std::string version_information; + nlohmann::json config; bool validate_schema; @@ -144,19 +146,27 @@ struct ModuleCallbacks { const std::function& ready); }; +struct VersionInformation { + std::string project_name; + std::string project_version; + std::string git_version; +}; + class ModuleLoader { private: std::shared_ptr runtime_settings; std::string module_id; std::string original_process_name; ModuleCallbacks callbacks; - const std::string project_name; - const std::string project_version; + VersionInformation version_information; bool parse_command_line(int argc, char* argv[]); public: - explicit ModuleLoader(int argc, char* argv[], ModuleCallbacks callbacks, const char* project_name, const char* project_version); + explicit ModuleLoader(int argc, char* argv[], ModuleCallbacks callbacks) : + ModuleLoader(argc, argv, callbacks, {"undefined project", "undefined version", "undefined git version"}){}; + explicit ModuleLoader(int argc, char* argv[], ModuleCallbacks callbacks, + const VersionInformation version_information); int initialize(); }; diff --git a/lib/runtime.cpp b/lib/runtime.cpp index 3be21595..bfacbc34 100644 --- a/lib/runtime.cpp +++ b/lib/runtime.cpp @@ -377,8 +377,9 @@ ModuleCallbacks::ModuleCallbacks(const std::functionparse_command_line(argc, argv)) { return; } @@ -542,7 +543,9 @@ bool ModuleLoader::parse_command_line(int argc, char* argv[]) { } if (vm.count("version") != 0) { - std::cout << argv[0] << " (" << project_name << " " << project_version << ")" << std::endl; + std::cout << argv[0] << " (" << this->version_information.project_name << " " + << this->version_information.project_version << " " << this->version_information.git_version << ")" + << std::endl; return false; } From dbb2b26d613b1f37d53efc4de6c2e3fdcea7ef3a Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 4 Apr 2024 17:48:37 +0200 Subject: [PATCH 04/16] Move version information header to everest-cmake v0.3 It is now automatically generated in ${CMAKE_CURRENT_BINARY_DIR}/generated/include/version_information.hpp Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 11 ++++++----- src/cmake-vars.h.in | 5 ----- src/manager.cpp | 7 +++++-- 4 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 src/cmake-vars.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index ed39c4d8..0a9add49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(everest-framework LANGUAGES CXX C ) -find_package(everest-cmake 0.1 REQUIRED +find_package(everest-cmake 0.3 REQUIRED PATHS ../everest-cmake ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e3d7ca53..69d841cd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,14 +1,15 @@ -# make some cmake variables available as defines -configure_file(cmake-vars.h.in cmake-vars.h @ONLY) - add_executable(manager) target_sources(manager PRIVATE system_unix.cpp manager.cpp ) - -target_include_directories(manager PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +# generate version information header +evc_generate_version_information() +target_include_directories(manager + PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/generated/include +) target_link_libraries(manager PRIVATE diff --git a/src/cmake-vars.h.in b/src/cmake-vars.h.in deleted file mode 100644 index 0d2071a8..00000000 --- a/src/cmake-vars.h.in +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#define PROJECT_NAME "@PROJECT_NAME@" -#define PROJECT_DESCRIPTION "@PROJECT_DESCRIPTION@" -#define PROJECT_VERSION "@PROJECT_VERSION@" diff --git a/src/manager.cpp b/src/manager.cpp index 2f41b598..1a0a5e75 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -33,7 +33,7 @@ #include "controller/ipc.hpp" #include "system_unix.hpp" -#include "cmake-vars.h" +#include namespace po = boost::program_options; namespace fs = std::filesystem; @@ -472,6 +472,8 @@ int boot(const po::variables_map& vm) { EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " | |____ \\ / __/ | | __/\\__ \\ |_ "); EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " |______| \\/ \\___|_| \\___||___/\\__|"); EVLOG_info << ""; + EVLOG_info << PROJECT_NAME << " " << PROJECT_VERSION << " " << GIT_VERSION; + EVLOG_info << ""; if (rs->mqtt_broker_socket_path.empty()) { EVLOG_info << "Using MQTT broker " << rs->mqtt_broker_host << ":" << rs->mqtt_broker_port; @@ -749,7 +751,8 @@ int main(int argc, char* argv[]) { } if (vm.count("version") != 0) { - std::cout << argv[0] << " (" << PROJECT_NAME << " " << PROJECT_VERSION << ")" << std::endl; + std::cout << argv[0] << " (" << PROJECT_NAME << " " << PROJECT_VERSION << " " << GIT_VERSION << ") " + << std::endl; return EXIT_SUCCESS; } From 2ac8a98a4d344293187624546949a5814c11e4b6 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 4 Apr 2024 17:50:52 +0200 Subject: [PATCH 05/16] Display everest-core version during startup from a generated file This file can be generated during a build of everest-core Signed-off-by: Kai-Uwe Hermann --- lib/runtime.cpp | 8 ++++++++ src/manager.cpp | 1 + 2 files changed, 9 insertions(+) diff --git a/lib/runtime.cpp b/lib/runtime.cpp index bfacbc34..a8a44cd2 100644 --- a/lib/runtime.cpp +++ b/lib/runtime.cpp @@ -11,6 +11,7 @@ #include #include +#include #include @@ -368,6 +369,13 @@ RuntimeSettings::RuntimeSettings(const std::string& prefix_, const std::string& validate_schema = defaults::VALIDATE_SCHEMA; } run_as_user = settings.value("run_as_user", ""); + auto version_information_path = data_dir / "version_information.txt"; + if (fs::exists(version_information_path)) { + std::ifstream ifs(version_information_path.string()); + version_information = std::string(std::istreambuf_iterator(ifs), std::istreambuf_iterator()); + } else { + version_information = "unknown"; + } } ModuleCallbacks::ModuleCallbacks(const std::function& register_module_adapter, diff --git a/src/manager.cpp b/src/manager.cpp index 1a0a5e75..58dd57b1 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -473,6 +473,7 @@ int boot(const po::variables_map& vm) { EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " |______| \\/ \\___|_| \\___||___/\\__|"); EVLOG_info << ""; EVLOG_info << PROJECT_NAME << " " << PROJECT_VERSION << " " << GIT_VERSION; + EVLOG_info << rs->version_information; EVLOG_info << ""; if (rs->mqtt_broker_socket_path.empty()) { From 234742ddf3604a32f84330f8065f024a3a5ca120 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 4 Apr 2024 20:11:22 +0200 Subject: [PATCH 06/16] Revert everest-cmake dependency upgrade generate version info header directly Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 5 ++++- cmake/assets/version_information.hpp.in | 6 ++++++ cmake/ev-version-information.cmake | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 cmake/assets/version_information.hpp.in create mode 100644 cmake/ev-version-information.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a9add49..fa797093 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(everest-framework LANGUAGES CXX C ) -find_package(everest-cmake 0.3 REQUIRED +find_package(everest-cmake 0.1 REQUIRED PATHS ../everest-cmake ) @@ -92,6 +92,9 @@ else() include(find-mqttc) endif() +include(ev-version-information) +evc_generate_version_information() + set(EVEREST_FRAMEWORK_GENERATED_INC_DIR ${PROJECT_BINARY_DIR}/generated) configure_file( include/compile_time_settings.hpp.in diff --git a/cmake/assets/version_information.hpp.in b/cmake/assets/version_information.hpp.in new file mode 100644 index 00000000..d720b226 --- /dev/null +++ b/cmake/assets/version_information.hpp.in @@ -0,0 +1,6 @@ +#pragma once + +#define PROJECT_NAME "@PROJECT_NAME@" +#define PROJECT_DESCRIPTION "@PROJECT_DESCRIPTION@" +#define PROJECT_VERSION "@PROJECT_VERSION@" +#define GIT_VERSION "@GIT_VERSION@" diff --git a/cmake/ev-version-information.cmake b/cmake/ev-version-information.cmake new file mode 100644 index 00000000..96e0ee3c --- /dev/null +++ b/cmake/ev-version-information.cmake @@ -0,0 +1,16 @@ + +set(EVEREST_VERSION_INFORMATION_HEADER_IN "${CMAKE_CURRENT_LIST_DIR}/assets/version_information.hpp.in") + +function (evc_generate_version_information) + execute_process( + COMMAND + git describe --dirty --always --tags + WORKING_DIRECTORY + ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE + GIT_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + # make version information available as c++ header + configure_file("${EVEREST_VERSION_INFORMATION_HEADER_IN}" "${CMAKE_CURRENT_BINARY_DIR}/generated/include/generated/version_information.hpp" @ONLY) +endfunction() From b9c999eedca40f88e315e350a17d01a420bfbfe5 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 4 Apr 2024 20:19:44 +0200 Subject: [PATCH 07/16] Generate placeholder version_information.hpp in bazel This has no version information (for now) Signed-off-by: Kai-Uwe Hermann --- BUILD.bazel | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 3a75dbe6..81b6f2f9 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -7,10 +7,22 @@ genrule( """, ) +genrule( + name = "version_information", + outs = ["include/generated/include/version_information.hpp"], + cmd = """ + echo "#pragma once" > $@ + echo "#define PROJECT_NAME \\"everest-framework\\"" >> $@ + echo "#define PROJECT_DESCRIPTION \\"\\"" >> $@ + echo "#define PROJECT_VERSION \\"\\"" >> $@ + echo "#define GIT_VERSION \\"\\"" >> $@ + """, +) + cc_library( name = "framework", srcs = glob(["lib/**/*.cpp"]), - hdrs = glob(["include/**/*.hpp"]) + [":compile_time_settings"], + hdrs = glob(["include/**/*.hpp"]) + [":compile_time_settings", ":version_information"], copts = ["-std=c++17"], strip_include_prefix = "include", visibility = ["//visibility:public"], From 9bdddac96e39f1afab40809e6898968dcbf070f4 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Fri, 5 Apr 2024 10:32:26 +0200 Subject: [PATCH 08/16] Fix include path in BAZEL.build Signed-off-by: Kai-Uwe Hermann --- BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel index 81b6f2f9..f1e73500 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -9,7 +9,7 @@ genrule( genrule( name = "version_information", - outs = ["include/generated/include/version_information.hpp"], + outs = ["include/generated/version_information.hpp"], cmd = """ echo "#pragma once" > $@ echo "#define PROJECT_NAME \\"everest-framework\\"" >> $@ From 0f34052900275141e351bcf92e9131404660ea15 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Mon, 22 Apr 2024 11:49:27 +0200 Subject: [PATCH 09/16] Bump dependency on everest-cmake back to 0.3 Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 3 +-- cmake/assets/version_information.hpp.in | 6 ------ cmake/ev-version-information.cmake | 16 ---------------- 3 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 cmake/assets/version_information.hpp.in delete mode 100644 cmake/ev-version-information.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index fa797093..974df9ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(everest-framework LANGUAGES CXX C ) -find_package(everest-cmake 0.1 REQUIRED +find_package(everest-cmake 0.3 REQUIRED PATHS ../everest-cmake ) @@ -92,7 +92,6 @@ else() include(find-mqttc) endif() -include(ev-version-information) evc_generate_version_information() set(EVEREST_FRAMEWORK_GENERATED_INC_DIR ${PROJECT_BINARY_DIR}/generated) diff --git a/cmake/assets/version_information.hpp.in b/cmake/assets/version_information.hpp.in deleted file mode 100644 index d720b226..00000000 --- a/cmake/assets/version_information.hpp.in +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -#define PROJECT_NAME "@PROJECT_NAME@" -#define PROJECT_DESCRIPTION "@PROJECT_DESCRIPTION@" -#define PROJECT_VERSION "@PROJECT_VERSION@" -#define GIT_VERSION "@GIT_VERSION@" diff --git a/cmake/ev-version-information.cmake b/cmake/ev-version-information.cmake deleted file mode 100644 index 96e0ee3c..00000000 --- a/cmake/ev-version-information.cmake +++ /dev/null @@ -1,16 +0,0 @@ - -set(EVEREST_VERSION_INFORMATION_HEADER_IN "${CMAKE_CURRENT_LIST_DIR}/assets/version_information.hpp.in") - -function (evc_generate_version_information) - execute_process( - COMMAND - git describe --dirty --always --tags - WORKING_DIRECTORY - ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE - GIT_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - # make version information available as c++ header - configure_file("${EVEREST_VERSION_INFORMATION_HEADER_IN}" "${CMAKE_CURRENT_BINARY_DIR}/generated/include/generated/version_information.hpp" @ONLY) -endfunction() From 885e31546d59f5efaf2fe636a26849edeea3f600 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Mon, 22 Apr 2024 11:50:21 +0200 Subject: [PATCH 10/16] cleanup Signed-off-by: Kai-Uwe Hermann --- lib/everest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/everest.cpp b/lib/everest.cpp index 48cece7c..7b64f9d8 100644 --- a/lib/everest.cpp +++ b/lib/everest.cpp @@ -699,7 +699,6 @@ void Everest::telemetry_publish(const std::string& category, const std::string& void Everest::signal_ready() { BOOST_LOG_FUNCTION(); - // EVLOG_info << "Module " << this->module_id << " initialized."; const auto ready_topic = fmt::format("{}/ready", this->config.mqtt_module_prefix(this->module_id)); this->mqtt_abstraction.publish(ready_topic, json(true)); From 22284254ead181451aca468a4b99a7562e5bac4f Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 13 Jun 2024 12:02:14 +0200 Subject: [PATCH 11/16] Make EVerest logo more colorful Signed-off-by: Kai-Uwe Hermann --- src/manager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/manager.cpp b/src/manager.cpp index 58dd57b1..095aa052 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -465,12 +465,12 @@ int boot(const po::variables_map& vm) { Logging::init(rs->logging_config_file.string()); - EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " ________ __ _ "); - EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " | ____\\ \\ / / | | "); - EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " | |__ \\ \\ / /__ _ __ ___ ___| |_ "); - EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " | __| \\ \\/ / _ \\ '__/ _ \\/ __| __|"); - EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " | |____ \\ / __/ | | __/\\__ \\ |_ "); - EVLOG_info << fmt::format(TERMINAL_STYLE_BLUE, " |______| \\/ \\___|_| \\___||___/\\__|"); + EVLOG_info << " \033[0;1;35;95m_\033[0;1;31;91m__\033[0;1;33;93m__\033[0;1;32;92m__\033[0;1;36;96m_\033[0m \033[0;1;31;91m_\033[0;1;33;93m_\033[0m \033[0;1;36;96m_\033[0m "; + EVLOG_info << " \033[0;1;31;91m|\033[0m \033[0;1;33;93m_\033[0;1;32;92m__\033[0;1;36;96m_\\\033[0m \033[0;1;34;94m\\\033[0m \033[0;1;33;93m/\033[0m \033[0;1;32;92m/\033[0m \033[0;1;34;94m|\033[0m \033[0;1;35;95m|\033[0m"; + EVLOG_info << " \033[0;1;33;93m|\033[0m \033[0;1;32;92m|_\033[0;1;36;96m_\033[0m \033[0;1;35;95m\\\033[0m \033[0;1;31;91m\\\033[0m \033[0;1;33;93m/\033[0m \033[0;1;32;92m/\033[0;1;36;96m__\033[0m \033[0;1;34;94m_\033[0m \033[0;1;35;95m_\033[0;1;31;91m_\033[0m \033[0;1;33;93m__\033[0;1;32;92m_\033[0m \033[0;1;36;96m_\033[0;1;34;94m__\033[0;1;35;95m|\033[0m \033[0;1;31;91m|_\033[0m"; + EVLOG_info << " \033[0;1;32;92m|\033[0m \033[0;1;36;96m_\033[0;1;34;94m_|\033[0m \033[0;1;31;91m\\\033[0m \033[0;1;33;93m\\\033[0;1;32;92m/\033[0m \033[0;1;36;96m/\033[0m \033[0;1;34;94m_\033[0m \033[0;1;35;95m\\\033[0m \033[0;1;31;91m'_\033[0;1;33;93m_/\033[0m \033[0;1;32;92m_\033[0m \033[0;1;36;96m\\\033[0;1;34;94m/\033[0m \033[0;1;35;95m__\033[0;1;31;91m|\033[0m \033[0;1;33;93m__\033[0;1;32;92m|\033[0m"; + EVLOG_info << " \033[0;1;36;96m|\033[0m \033[0;1;34;94m|_\033[0;1;35;95m__\033[0;1;31;91m_\033[0m \033[0;1;32;92m\\\033[0m \033[0;1;36;96m/\033[0m \033[0;1;35;95m__\033[0;1;31;91m/\033[0m \033[0;1;33;93m|\033[0m \033[0;1;32;92m|\033[0m \033[0;1;36;96m_\033[0;1;34;94m_/\033[0;1;35;95m\\_\033[0;1;31;91m_\033[0m \033[0;1;33;93m\\\033[0m \033[0;1;32;92m|_\033[0m"; + EVLOG_info << " \033[0;1;34;94m|_\033[0;1;35;95m__\033[0;1;31;91m__\033[0;1;33;93m_|\033[0m \033[0;1;36;96m\\\033[0;1;34;94m/\033[0m \033[0;1;35;95m\\_\033[0;1;31;91m__\033[0;1;33;93m|_\033[0;1;32;92m|\033[0m \033[0;1;36;96m\\\033[0;1;34;94m__\033[0;1;35;95m_|\033[0;1;31;91m|_\033[0;1;33;93m__\033[0;1;32;92m/\\\033[0;1;36;96m__\033[0;1;34;94m|\033[0m"; EVLOG_info << ""; EVLOG_info << PROJECT_NAME << " " << PROJECT_VERSION << " " << GIT_VERSION; EVLOG_info << rs->version_information; From fa24d11ef2e8c3e5aa13294e0b24c098368d5587 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 13 Jun 2024 12:03:11 +0200 Subject: [PATCH 12/16] Bump version to 0.15.0 Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 974df9ac..899ac0ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14) project(everest-framework - VERSION 0.14.1 + VERSION 0.15.0 DESCRIPTION "The open operating system for e-mobility charging stations" LANGUAGES CXX C ) From 0a415c27f5f6a57ff6094f0e33570c467bf75c0b Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 13 Jun 2024 12:06:38 +0200 Subject: [PATCH 13/16] Bump needed version of everest-cmake Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 899ac0ec..d6e4e517 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ project(everest-framework LANGUAGES CXX C ) -find_package(everest-cmake 0.3 REQUIRED +find_package(everest-cmake 0.4 REQUIRED PATHS ../everest-cmake ) From fb45fda4c300c78c071304711004c1f2d612f385 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 13 Jun 2024 12:08:50 +0200 Subject: [PATCH 14/16] clang-format Signed-off-by: Kai-Uwe Hermann --- src/manager.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/manager.cpp b/src/manager.cpp index 095aa052..6f904899 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -465,12 +465,31 @@ int boot(const po::variables_map& vm) { Logging::init(rs->logging_config_file.string()); - EVLOG_info << " \033[0;1;35;95m_\033[0;1;31;91m__\033[0;1;33;93m__\033[0;1;32;92m__\033[0;1;36;96m_\033[0m \033[0;1;31;91m_\033[0;1;33;93m_\033[0m \033[0;1;36;96m_\033[0m "; - EVLOG_info << " \033[0;1;31;91m|\033[0m \033[0;1;33;93m_\033[0;1;32;92m__\033[0;1;36;96m_\\\033[0m \033[0;1;34;94m\\\033[0m \033[0;1;33;93m/\033[0m \033[0;1;32;92m/\033[0m \033[0;1;34;94m|\033[0m \033[0;1;35;95m|\033[0m"; - EVLOG_info << " \033[0;1;33;93m|\033[0m \033[0;1;32;92m|_\033[0;1;36;96m_\033[0m \033[0;1;35;95m\\\033[0m \033[0;1;31;91m\\\033[0m \033[0;1;33;93m/\033[0m \033[0;1;32;92m/\033[0;1;36;96m__\033[0m \033[0;1;34;94m_\033[0m \033[0;1;35;95m_\033[0;1;31;91m_\033[0m \033[0;1;33;93m__\033[0;1;32;92m_\033[0m \033[0;1;36;96m_\033[0;1;34;94m__\033[0;1;35;95m|\033[0m \033[0;1;31;91m|_\033[0m"; - EVLOG_info << " \033[0;1;32;92m|\033[0m \033[0;1;36;96m_\033[0;1;34;94m_|\033[0m \033[0;1;31;91m\\\033[0m \033[0;1;33;93m\\\033[0;1;32;92m/\033[0m \033[0;1;36;96m/\033[0m \033[0;1;34;94m_\033[0m \033[0;1;35;95m\\\033[0m \033[0;1;31;91m'_\033[0;1;33;93m_/\033[0m \033[0;1;32;92m_\033[0m \033[0;1;36;96m\\\033[0;1;34;94m/\033[0m \033[0;1;35;95m__\033[0;1;31;91m|\033[0m \033[0;1;33;93m__\033[0;1;32;92m|\033[0m"; - EVLOG_info << " \033[0;1;36;96m|\033[0m \033[0;1;34;94m|_\033[0;1;35;95m__\033[0;1;31;91m_\033[0m \033[0;1;32;92m\\\033[0m \033[0;1;36;96m/\033[0m \033[0;1;35;95m__\033[0;1;31;91m/\033[0m \033[0;1;33;93m|\033[0m \033[0;1;32;92m|\033[0m \033[0;1;36;96m_\033[0;1;34;94m_/\033[0;1;35;95m\\_\033[0;1;31;91m_\033[0m \033[0;1;33;93m\\\033[0m \033[0;1;32;92m|_\033[0m"; - EVLOG_info << " \033[0;1;34;94m|_\033[0;1;35;95m__\033[0;1;31;91m__\033[0;1;33;93m_|\033[0m \033[0;1;36;96m\\\033[0;1;34;94m/\033[0m \033[0;1;35;95m\\_\033[0;1;31;91m__\033[0;1;33;93m|_\033[0;1;32;92m|\033[0m \033[0;1;36;96m\\\033[0;1;34;94m__\033[0;1;35;95m_|\033[0;1;31;91m|_\033[0;1;33;93m__\033[0;1;32;92m/\\\033[0;1;36;96m__\033[0;1;34;94m|\033[0m"; + EVLOG_info << " \033[0;1;35;95m_\033[0;1;31;91m__\033[0;1;33;93m__\033[0;1;32;92m__\033[0;1;36;96m_\033[0m " + "\033[0;1;31;91m_\033[0;1;33;93m_\033[0m \033[0;1;36;96m_\033[0m "; + EVLOG_info << " \033[0;1;31;91m|\033[0m \033[0;1;33;93m_\033[0;1;32;92m__\033[0;1;36;96m_\\\033[0m " + "\033[0;1;34;94m\\\033[0m \033[0;1;33;93m/\033[0m \033[0;1;32;92m/\033[0m " + "\033[0;1;34;94m|\033[0m \033[0;1;35;95m|\033[0m"; + EVLOG_info + << " \033[0;1;33;93m|\033[0m \033[0;1;32;92m|_\033[0;1;36;96m_\033[0m \033[0;1;35;95m\\\033[0m " + "\033[0;1;31;91m\\\033[0m \033[0;1;33;93m/\033[0m \033[0;1;32;92m/\033[0;1;36;96m__\033[0m " + "\033[0;1;34;94m_\033[0m \033[0;1;35;95m_\033[0;1;31;91m_\033[0m \033[0;1;33;93m__\033[0;1;32;92m_\033[0m " + "\033[0;1;36;96m_\033[0;1;34;94m__\033[0;1;35;95m|\033[0m \033[0;1;31;91m|_\033[0m"; + EVLOG_info << " \033[0;1;32;92m|\033[0m \033[0;1;36;96m_\033[0;1;34;94m_|\033[0m \033[0;1;31;91m\\\033[0m " + "\033[0;1;33;93m\\\033[0;1;32;92m/\033[0m \033[0;1;36;96m/\033[0m \033[0;1;34;94m_\033[0m " + "\033[0;1;35;95m\\\033[0m \033[0;1;31;91m'_\033[0;1;33;93m_/\033[0m \033[0;1;32;92m_\033[0m " + "\033[0;1;36;96m\\\033[0;1;34;94m/\033[0m \033[0;1;35;95m__\033[0;1;31;91m|\033[0m " + "\033[0;1;33;93m__\033[0;1;32;92m|\033[0m"; + EVLOG_info << " \033[0;1;36;96m|\033[0m \033[0;1;34;94m|_\033[0;1;35;95m__\033[0;1;31;91m_\033[0m " + "\033[0;1;32;92m\\\033[0m \033[0;1;36;96m/\033[0m \033[0;1;35;95m__\033[0;1;31;91m/\033[0m " + "\033[0;1;33;93m|\033[0m \033[0;1;32;92m|\033[0m " + "\033[0;1;36;96m_\033[0;1;34;94m_/\033[0;1;35;95m\\_\033[0;1;31;91m_\033[0m \033[0;1;33;93m\\\033[0m " + "\033[0;1;32;92m|_\033[0m"; + EVLOG_info << " \033[0;1;34;94m|_\033[0;1;35;95m__\033[0;1;31;91m__\033[0;1;33;93m_|\033[0m " + "\033[0;1;36;96m\\\033[0;1;34;94m/\033[0m " + "\033[0;1;35;95m\\_\033[0;1;31;91m__\033[0;1;33;93m|_\033[0;1;32;92m|\033[0m " + "\033[0;1;36;96m\\\033[0;1;34;94m__\033[0;1;35;95m_|\033[0;1;31;91m|_\033[0;1;33;93m__\033[0;1;32;" + "92m/\\\033[0;1;36;96m__\033[0;1;34;94m|\033[0m"; EVLOG_info << ""; EVLOG_info << PROJECT_NAME << " " << PROJECT_VERSION << " " << GIT_VERSION; EVLOG_info << rs->version_information; From c3b465a839648436b15888dd4904851e9b4e6651 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Thu, 13 Jun 2024 18:12:38 +0200 Subject: [PATCH 15/16] Remove superfluous evc_generate_version_information call Signed-off-by: Kai-Uwe Hermann --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6e4e517..e102aac3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,8 +92,6 @@ else() include(find-mqttc) endif() -evc_generate_version_information() - set(EVEREST_FRAMEWORK_GENERATED_INC_DIR ${PROJECT_BINARY_DIR}/generated) configure_file( include/compile_time_settings.hpp.in From 36a70543b3214447a87d222ece62fc67545ced61 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Fri, 14 Jun 2024 09:37:16 +0200 Subject: [PATCH 16/16] Move to buildkit v1.2.0 instead of outdated latest Signed-off-by: Kai-Uwe Hermann --- .github/workflows/cmake_build.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake_build.yaml b/.github/workflows/cmake_build.yaml index 8f3e5614..0d53db5f 100644 --- a/.github/workflows/cmake_build.yaml +++ b/.github/workflows/cmake_build.yaml @@ -12,6 +12,9 @@ on: - 'ubuntu-22.04' - 'large-ubuntu-22.04-xxl' +env: + BUILD_KIT_IMAGE: ghcr.io/everest/build-kit-alpine:v1.2.0 + jobs: build: name: Build and Test @@ -39,8 +42,8 @@ jobs: rsync -a source/.ci/build-kit/ scripts - name: Pull build-kit docker image run: | - docker pull --quiet ghcr.io/everest/build-kit-alpine:latest - docker image tag ghcr.io/everest/build-kit-alpine:latest build-kit + docker pull --quiet ${{ env.BUILD_KIT_IMAGE }} + docker image tag ${{ env.BUILD_KIT_IMAGE }} build-kit - name: Compile run: | docker run \