diff --git a/.github/workflows/madara-tests.yaml b/.github/workflows/madara-tests.yaml index b3e82a805..ea2f579c3 100644 --- a/.github/workflows/madara-tests.yaml +++ b/.github/workflows/madara-tests.yaml @@ -1,6 +1,6 @@ # This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. # See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml -name: CMake on Ubuntu +name: Madara CI on: push: @@ -9,71 +9,169 @@ on: types: [opened, reopened, review_requested] jobs: - build: - runs-on: ${{ matrix.os }} + # build: + # runs-on: ${{ matrix.os }} + # strategy: + # # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. + # fail-fast: false + + # # Set up a matrix to run the following 3 configurations: + # # 1. + # # 2. + # # 3. + # # + # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. + # matrix: + # os: [ubuntu-latest, macos-latest] #, windows-latest] + # build_type: [Release] + # #c_compiler: [gcc, clang] #, cl] + # include: + # #- os: windows-latest + # # c_compiler: cl + # # cpp_compiler: cl + # #- os: ubuntu-latest + # # c_compiler: gcc + # # cpp_compiler: g++ + # # - os: macos-latest + # # c_compiler: clang + # # cpp_compiler: clang++ + # #- os: ubuntu-latest + # # c_compiler: clang + # # cpp_compiler: clang++ + # #- os: windows-latest + # # c_compiler: gcc + # #- os: windows-latest + # # c_compiler: clang + # #- os: ubuntu-latest + # # c_compiler: cl + + # steps: + # - uses: actions/checkout@v3 + + Linux: + + runs-on: ubuntu-${{ matrix.os-version }} strategy: - # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. fail-fast: false - - # Set up a matrix to run the following 3 configurations: - # 1. - # 2. - # 3. - # - # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest] #, windows-latest] - build_type: [Release] - c_compiler: [gcc] #, clang] #, cl] + #build_type: [Release] include: - #- os: windows-latest - # c_compiler: cl - # cpp_compiler: cl - - os: ubuntu-latest + - job-name: 'Linux 20.04 g++' + os: ubuntu-22.04 + os-version: '20.04' + c_compiler: gcc + cpp_compiler: g++ + build_type: [Release] + - job-name: 'Linux 22.04 g++' + os-version: '22.04' c_compiler: gcc cpp_compiler: g++ - #- os: ubuntu-latest - # c_compiler: clang - # cpp_compiler: clang++ - # exclude: - #- os: windows-latest - # c_compiler: gcc - #- os: windows-latest - # c_compiler: clang - #- os: ubuntu-latest - # c_compiler: cl + build_type: [Release] + - job-name: 'Linux 20.04 clang' + os: ubuntu-20.04 + os-version: '20.04' + c_compiler: clang + cpp_compiler: clang++ + build_type: [Release] + - job-name: 'Linux 22.04 clang' + os: ubuntu-22.04 + os-version: '22.04' + c_compiler: clang + cpp_compiler: clang++ + build_type: [Release] + + name: ${{ matrix.job-name }} steps: - - uses: actions/checkout@v3 - - name: Install Boost and SSL - run: sudo apt-get install -y libboost-all-dev git libssl-dev - - - name: Set reusable strings - # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. - id: strings - shell: bash - run: | - echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: > - cmake -B ${{ steps.strings.outputs.build-output-dir }} - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -Dmadara_TESTS=ON - -Dmadara_SSL=ON - -S ${{ github.workspace }} - - - name: Build - # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j $(nproc) - - - name: Test - working-directory: ${{ steps.strings.outputs.build-output-dir }} - # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest --build-config ${{ matrix.build_type }} -j $(nproc) + - uses: actions/checkout@v3 + - name: Install Boost and SSL + run: sudo apt-get install -y libboost-all-dev git libssl-dev + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -Dmadara_TESTS=ON + -Dmadara_SSL=ON + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j $(nproc) + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} --output-on-failure -j $(nproc) + + macOS: + + runs-on: macos-${{ matrix.os-version }} + strategy: + fail-fast: false + matrix: + include: + - job-name: 'Mac 12' + os: macos-12 + os-version: '12' + c_compiler: clang + cpp_compiler: clang++ + build_type: [Release] + # Disabling Mac 11 as the runner seems especially slow + # - job-name: 'Mac 11' + # os: macos-11 + # os-version: '11' + # c_compiler: clang + # cpp_compiler: clang++ + # build_type: [Release] + + + name: ${{ matrix.job-name }} + steps: + - uses: actions/checkout@v3 + - name: Install Boost and OpenSSL + run: brew install boost autoconf automake libtool git openssl + - name: Force Link OpenSSL + run: brew link --force openssl + + - name: Set reusable strings + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. + id: strings + shell: bash + run: | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: > + cmake -B ${{ steps.strings.outputs.build-output-dir }} + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -Dmadara_TESTS=ON + -Dmadara_SSL=OFF + -S ${{ github.workspace }} + + - name: Build + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} -j $(sysctl -n hw.ncpu) + + - name: Test + working-directory: ${{ steps.strings.outputs.build-output-dir }} + # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). + # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + run: ctest --build-config ${{ matrix.build_type }} --output-on-failure -j $(sysctl -n hw.ncpu) diff --git a/VERSION.txt b/VERSION.txt index fbcbf7380..8cf6caf56 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -3.4.0 \ No newline at end of file +3.4.1 \ No newline at end of file diff --git a/docs/Doxyfile_MADARA.dxy b/docs/Doxyfile_MADARA.dxy index cb38ca97e..51c85e845 100644 --- a/docs/Doxyfile_MADARA.dxy +++ b/docs/Doxyfile_MADARA.dxy @@ -38,7 +38,7 @@ PROJECT_NAME = MADARA # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 3.4.0 +PROJECT_NUMBER = 3.4.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/docs/Doxyfile_MADARA_NoGraphviz.dxy b/docs/Doxyfile_MADARA_NoGraphviz.dxy index a4e68cb63..8fc832f48 100644 --- a/docs/Doxyfile_MADARA_NoGraphviz.dxy +++ b/docs/Doxyfile_MADARA_NoGraphviz.dxy @@ -38,7 +38,7 @@ PROJECT_NAME = MADARA # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 3.4.0 +PROJECT_NUMBER = 3.4.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/include/madara/transport/udp/UdpRegistryClient.cpp b/include/madara/transport/udp/UdpRegistryClient.cpp index 3064c6ce4..bdf0aa7ee 100644 --- a/include/madara/transport/udp/UdpRegistryClient.cpp +++ b/include/madara/transport/udp/UdpRegistryClient.cpp @@ -60,7 +60,7 @@ void UdpRegistryClient::send_register(void) const char* print_prefix = "UdpRegistryClient::register"; long result(0); - uint64_t bytes_sent = 0; + //uint64_t bytes_sent = 0; if (servers_.size() > 0) { @@ -94,7 +94,7 @@ void UdpRegistryClient::send_register(void) if (actual_sent > 0) { - bytes_sent += actual_sent; + //bytes_sent += actual_sent; madara_logger_log(context_.get_logger(), logger::LOG_MAJOR, "%s:" diff --git a/include/madara/utility/LQueue.cpp b/include/madara/utility/LQueue.cpp index 77e057785..b5d966e21 100644 --- a/include/madara/utility/LQueue.cpp +++ b/include/madara/utility/LQueue.cpp @@ -269,7 +269,7 @@ madara::utility::LQueue& madara::utility::LQueue::operator=( // Perform actions needed when queue goes out of scope. template -madara::utility::LQueue::~LQueue(void) +madara::utility::LQueue::~LQueue(void) { // delete all elements of the list delete_list(); diff --git a/include/madara/utility/LStack.cpp b/include/madara/utility/LStack.cpp index 8324fc912..70334f009 100644 --- a/include/madara/utility/LStack.cpp +++ b/include/madara/utility/LStack.cpp @@ -298,7 +298,7 @@ madara::utility::LStack& madara::utility::LStack::operator=( // Perform actions needed when queue goes out of scope. template -madara::utility::LStack::~LStack(void) +madara::utility::LStack::~LStack(void) { // delete all elements of the list delete_list(); diff --git a/include/madara/utility/Refcounter.cpp b/include/madara/utility/Refcounter.cpp index 8e0fa2c1e..5d2c557f1 100644 --- a/include/madara/utility/Refcounter.cpp +++ b/include/madara/utility/Refcounter.cpp @@ -29,7 +29,7 @@ madara::utility::Refcounter::Refcounter(const Refcounter& rhs) /// Dtor will delete pointer if refcount becomes 0 template -madara::utility::Refcounter::~Refcounter(void) +madara::utility::Refcounter::~Refcounter(void) { decrement(); } diff --git a/include/madara/utility/ScopedArray.inl b/include/madara/utility/ScopedArray.inl index 41bc96441..3f7419a4a 100644 --- a/include/madara/utility/ScopedArray.inl +++ b/include/madara/utility/ScopedArray.inl @@ -29,7 +29,7 @@ madara::utility::ScopedArray::ScopedArray(const ScopedArray& rhs) /// Dtor will delete pointer if refcount becomes 0 template -madara::utility::ScopedArray::~ScopedArray(void) +madara::utility::ScopedArray::~ScopedArray(void) { decrement(); } diff --git a/include/madara/utility/ThreadSafeVector.cpp b/include/madara/utility/ThreadSafeVector.cpp index 01e1865aa..a975f4b91 100644 --- a/include/madara/utility/ThreadSafeVector.cpp +++ b/include/madara/utility/ThreadSafeVector.cpp @@ -25,14 +25,14 @@ madara::utility::ThreadSafeVector::ThreadSafeVector( } template -madara::utility::ThreadSafeVector::~ThreadSafeVector(void) +madara::utility::ThreadSafeVector::~ThreadSafeVector(void) { clear(); } template void madara::utility::ThreadSafeVector::operator=( - const ThreadSafeVector& rhs) + const ThreadSafeVector& rhs) { MADARA_GUARD_TYPE guard(mutex_); MADARA_GUARD_TYPE rhs_guard(rhs.mutex_); diff --git a/include/madara/utility/Utility.inl b/include/madara/utility/Utility.inl index 6edfe51b9..c7bf07350 100644 --- a/include/madara/utility/Utility.inl +++ b/include/madara/utility/Utility.inl @@ -581,7 +581,7 @@ inline std::vector get_file_missing_fragments( std::ofstream output(filename, std::ios::out | std::ios::binary); size_t num_fragments = expected_size / fragment_size; - size_t actual_size = 0; + //size_t actual_size = 0; if (expected_size % fragment_size > 0) { @@ -610,7 +610,7 @@ inline std::vector get_file_missing_fragments( size_t size = 0; utility::read_file(frag_file, buffer, size); - actual_size += size; + //actual_size += size; madara_logger_ptr_log(logger::global_logger.get(), logger::LOG_TRACE, "utility::get_file_missing_fragments: checking fragment %d\n", i); diff --git a/tests/test_knowledge_base.cpp b/tests/test_knowledge_base.cpp index d3104aedf..d5f9cb330 100644 --- a/tests/test_knowledge_base.cpp +++ b/tests/test_knowledge_base.cpp @@ -5,6 +5,8 @@ #include "madara/utility/Utility.h" #include "test.h" +#include + namespace logger = madara::logger; namespace utility = madara::utility; @@ -71,10 +73,13 @@ int main(int, char**) // KnowledgeReferenceSettings (false)); knowledge.print("Testing KnowledgeRecord status method, return value is: "); + int record1Status = record1.status(); - char str[16]; - sprintf(str, "%d", record1Status); - knowledge.print(str); + + std::stringstream buffer; + buffer << record1Status; + + knowledge.print(buffer.str().c_str()); knowledge.print("\n"); // MADARA_debug_level = 10; diff --git a/tools/karl.cpp b/tools/karl.cpp index de9a4d175..5871a1246 100644 --- a/tools/karl.cpp +++ b/tools/karl.cpp @@ -268,15 +268,15 @@ class StatsFilter : public madara::filters::AggregateFilter } // calculate bytes - size_t bytes = record.second.size(); - if(record.second.is_integer_type()) - { - bytes *= sizeof(int64_t); - } - else if(record.second.is_double_type()) - { - bytes *= sizeof(double); - } + // size_t bytes = record.second.size(); + // if(record.second.is_integer_type()) + // { + // bytes *= sizeof(int64_t); + // } + // else if(record.second.is_double_type()) + // { + // bytes *= sizeof(double); + // } // update bytes sent by originator var_orig_stats.bytes += record.second.size();