From ac09a0ee90d5b37b3b264e6f278cd19ccd1f2657 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:07:20 -0600 Subject: [PATCH 01/16] Rename plugin and cleanup some of cmake --- .gitignore | 2 ++ .../CMakeLists.txt | 36 +++++++++++-------- .../analytics/stub/main.cpp | 0 .../analytics/stub/settings/actions.cpp | 0 .../analytics/stub/settings/actions.h | 0 .../stub/settings/active_settings_builder.cpp | 0 .../stub/settings/active_settings_builder.h | 0 .../stub/settings/active_settings_rules.cpp | 0 .../stub/settings/active_settings_rules.h | 0 .../analytics/stub/settings/device_agent.cpp | 0 .../analytics/stub/settings/device_agent.h | 0 .../analytics/stub/settings/engine.cpp | 0 .../analytics/stub/settings/engine.h | 0 .../analytics/stub/settings/plugin.cpp | 0 .../analytics/stub/settings/plugin.h | 0 .../analytics/stub/settings/settings_model.h | 0 .../stub_analytics_plugin_settings_ini.cpp | 0 .../stub_analytics_plugin_settings_ini.h | 0 .../analytics/stub/utils.cpp | 0 .../vms_server_plugins/analytics/stub/utils.h | 0 20 files changed, 24 insertions(+), 14 deletions(-) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/CMakeLists.txt (70%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/main.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/actions.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/actions.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/engine.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/plugin.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/plugin.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/settings_model.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.h (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/utils.cpp (100%) rename samples/{stub_analytics_plugin => cloudfuse_plugin}/src/nx/vms_server_plugins/analytics/stub/utils.h (100%) diff --git a/.gitignore b/.gitignore index f43a13c..0f64ee6 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ *.exe *.out *.app + +/build/ \ No newline at end of file diff --git a/samples/stub_analytics_plugin/CMakeLists.txt b/samples/cloudfuse_plugin/CMakeLists.txt similarity index 70% rename from samples/stub_analytics_plugin/CMakeLists.txt rename to samples/cloudfuse_plugin/CMakeLists.txt index c2d58a4..5e111d7 100644 --- a/samples/stub_analytics_plugin/CMakeLists.txt +++ b/samples/cloudfuse_plugin/CMakeLists.txt @@ -1,7 +1,14 @@ ## Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/ -cmake_minimum_required(VERSION 3.14) -project(stub_analytics_plugin) +cmake_minimum_required(VERSION 3.16...3.29) + +project( + cloudfuse_plugin + VERSION 0.1.0 + DESCRIPTION "VMS Plugin for Lyve Cloud" + HOMEPAGE_URL "https://github.com/Seagate/nx-lyve-cloud-plugin" + LANGUAGES CXX +) set(metadataSdkDir "" CACHE PATH "Path to unpacked VMS Metadata SDK zip.") if(metadataSdkDir STREQUAL "") @@ -11,9 +18,6 @@ if(metadataSdkDir STREQUAL "") endif() endif() -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_EXTENSIONS OFF) - set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -63,19 +67,23 @@ target_link_libraries(nx_sdk PRIVATE nx_kit) target_compile_definitions(nx_sdk PRIVATE NX_PLUGIN_API=${API_EXPORT_MACRO}) #< for nxLibContext() #-------------------------------------------------------------------------------------------------- -# Define stub_analytics_plugin lib, dynamic, depends on nx_kit and nx_sdk. +# Define cloudfuse_plugin lib, dynamic, depends on nx_kit and nx_sdk. +find_package(OpenSSL REQUIRED) +set(CLOUDFUSE_PLUGIN_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src) +file(GLOB_RECURSE CLOUDFUSE_PLUGIN_SRC CONFIGURE_DEPENDS ${CLOUDFUSE_PLUGIN_SRC_DIR}/*) -set(STUB_ANALYTICS_PLUGIN_SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/src) -file(GLOB_RECURSE STUB_ANALYTICS_PLUGIN_SRC CONFIGURE_DEPENDS ${STUB_ANALYTICS_PLUGIN_SRC_DIR}/*) +add_library(cloudfuse_plugin SHARED ${CLOUDFUSE_PLUGIN_SRC}) +target_include_directories(cloudfuse_plugin PRIVATE ${CLOUDFUSE_PLUGIN_SRC_DIR}) +target_link_libraries(cloudfuse_plugin PRIVATE nx_kit nx_sdk OpenSSL::SSL) -add_library(stub_analytics_plugin SHARED ${STUB_ANALYTICS_PLUGIN_SRC}) -target_include_directories(stub_analytics_plugin PRIVATE ${STUB_ANALYTICS_PLUGIN_SRC_DIR}) -target_link_libraries(stub_analytics_plugin PRIVATE nx_kit nx_sdk) - -target_compile_definitions(stub_analytics_plugin +target_compile_definitions(cloudfuse_plugin PRIVATE NX_PLUGIN_API=${API_EXPORT_MACRO} ) +target_compile_features(cloudfuse_plugin PUBLIC cxx_std_17) +set_target_properties(cloudfuse_plugin PROPERTIES CXX_EXTENSIONS OFF) +set_target_properties(cloudfuse_plugin PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) + if(NOT WIN32) - target_link_libraries(stub_analytics_plugin PRIVATE pthread) + target_link_libraries(cloudfuse_plugin PRIVATE pthread) endif() \ No newline at end of file diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/main.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/main.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/main.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/main.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/actions.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_builder.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/active_settings_rules.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/device_agent.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/plugin.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/settings_model.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/settings_model.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/settings_model.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/settings_model.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/stub_analytics_plugin_settings_ini.h diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp diff --git a/samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/utils.h b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.h similarity index 100% rename from samples/stub_analytics_plugin/src/nx/vms_server_plugins/analytics/stub/utils.h rename to samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.h From 17c013416719c4da861d134951da7953999edc43 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:49:42 -0600 Subject: [PATCH 02/16] Don't hardcode bucketname, let cloudfuse select first bucket --- .../nx/vms_server_plugins/analytics/stub/settings/engine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp index 24ee063..102aa5e 100644 --- a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp +++ b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp @@ -158,6 +158,7 @@ Result Engine::settingsReceived() std::string secretKey = values[kSecretKeyPasswordFieldId]; std::string endpointUrl = "https://s3.us-east-1.lyvecloud.seagate.com"; std::string endpointRegion = "us-east-1"; + std::string bucketName = ""; // Using empty string to cause cloudfuse to select first available bucket std::string mountDir = cfManager.getMountDir(); std::string fileCacheDir = cfManager.getFileCacheDir(); std::string passphrase = ""; @@ -237,9 +238,9 @@ Result Engine::settingsReceived() } #if defined(__linux__) - processReturn dryGenConfig = cfManager.genS3Config(endpointRegion, endpointUrl, "stxe1-srg-lens-lab1", passphrase); + processReturn dryGenConfig = cfManager.genS3Config(endpointRegion, endpointUrl, bucketName, passphrase); #elif defined(_WIN32) - processReturn dryGenConfig = cfManager.genS3Config(keyId, secretKey, endpointRegion, endpointUrl, "stxe1-srg-lens-lab1", passphrase); + processReturn dryGenConfig = cfManager.genS3Config(keyId, secretKey, endpointRegion, endpointUrl, bucketName, passphrase); #endif if (dryGenConfig.errCode != 0) { From 17289ea63610ae01da446be0a423531e0a7fa525 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:57:20 -0600 Subject: [PATCH 03/16] Add compiler flags, fix warnings --- samples/cloudfuse_plugin/CMakeLists.txt | 13 ++++++++++--- .../analytics/stub/settings/engine.cpp | 2 +- .../nx/vms_server_plugins/analytics/stub/utils.cpp | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/samples/cloudfuse_plugin/CMakeLists.txt b/samples/cloudfuse_plugin/CMakeLists.txt index 5e111d7..a0a8b00 100644 --- a/samples/cloudfuse_plugin/CMakeLists.txt +++ b/samples/cloudfuse_plugin/CMakeLists.txt @@ -65,6 +65,7 @@ target_include_directories(nx_sdk PUBLIC ${SDK_SRC_DIR}) target_link_libraries(nx_sdk PRIVATE nx_kit) target_compile_definitions(nx_sdk PRIVATE NX_PLUGIN_API=${API_EXPORT_MACRO}) #< for nxLibContext() +target_compile_features(nx_sdk PRIVATE cxx_std_17) #-------------------------------------------------------------------------------------------------- # Define cloudfuse_plugin lib, dynamic, depends on nx_kit and nx_sdk. @@ -80,9 +81,15 @@ target_compile_definitions(cloudfuse_plugin PRIVATE NX_PLUGIN_API=${API_EXPORT_MACRO} ) -target_compile_features(cloudfuse_plugin PUBLIC cxx_std_17) -set_target_properties(cloudfuse_plugin PROPERTIES CXX_EXTENSIONS OFF) -set_target_properties(cloudfuse_plugin PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) +target_compile_features(cloudfuse_plugin PRIVATE cxx_std_17) +set_target_properties(cloudfuse_plugin PROPERTIES + CXX_EXTENSIONS OFF + NTERPROCEDURAL_OPTIMIZATION TRUE +) +target_compile_options(cloudfuse_plugin PRIVATE + -Wall -Wformat -Wformat=2 -Wconversion -Wimplicit-fallthrough + -Werror=format-security +) if(NOT WIN32) target_link_libraries(cloudfuse_plugin PRIVATE pthread) diff --git a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp index 102aa5e..f9f5ecd 100644 --- a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp +++ b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp @@ -121,7 +121,7 @@ bool Engine::processActiveSettings( std::vector activeSettingNames = settingIdsToUpdate; if (activeSettingNames.empty()) { - for (const auto item : activeSettingsItems.array_items()) + for (const auto &item : activeSettingsItems.array_items()) { if (item["type"].string_value() == "Button") continue; diff --git a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp index 49c7e27..9f22bca 100644 --- a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp +++ b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/utils.cpp @@ -77,7 +77,7 @@ std::string join( const std::string& itemPostfix) { std::string result; - for (int i = 0; i < strings.size(); ++i) + for (size_t i = 0; i < strings.size(); ++i) { result += itemPrefix + strings[i] + itemPostfix; if (i != strings.size() - 1) From f6f181567d66f74dfb2b577620c7935cd5a73c5f Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:45:05 -0600 Subject: [PATCH 04/16] Add action to build using cmake --- .github/workflows/cmake-build.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/cmake-build.yml diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml new file mode 100644 index 0000000..d6e31f8 --- /dev/null +++ b/.github/workflows/cmake-build.yml @@ -0,0 +1,40 @@ +# 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 multiple platforms + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main", "add-github-actions" ] + +jobs: + 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-22.04, ubuntu-20.04] + build_type: [Release] + c_compiler: [gcc, clang] + + steps: + - uses: actions/checkout@v4 + + - name: Build using CMake + run: | + ./build_samples.sh + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -S ${{ github.workspace }} + --no-tests From d1c578d18b93d090da379a78820c309e8d140b05 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:47:48 -0600 Subject: [PATCH 05/16] Test on GitHub --- .github/workflows/cmake-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index d6e31f8..99a71be 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -4,7 +4,7 @@ name: CMake on multiple platforms on: push: - branches: [ "main" ] + branches: [ "main", "add-github-actions" ] pull_request: branches: [ "main", "add-github-actions" ] From 6499ce170d21255047ec61143c6c69b3ab86cf2b Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:54:16 -0600 Subject: [PATCH 06/16] Fix builds --- .github/workflows/cmake-build.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 99a71be..22d1f23 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -26,15 +26,22 @@ jobs: os: [ubuntu-22.04, ubuntu-20.04] build_type: [Release] c_compiler: [gcc, clang] + include: + - os: ubuntu-latest + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-latest + c_compiler: clang + cpp_compiler: clang++ steps: - uses: actions/checkout@v4 - name: Build using CMake - run: | - ./build_samples.sh - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + run: > + ./build_samples.sh + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} --no-tests From 44b9adb985603d56749a9daebc82facd6b34c7d1 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:57:28 -0600 Subject: [PATCH 07/16] Fix builds --- .github/workflows/cmake-build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 22d1f23..9e2eca7 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -6,7 +6,7 @@ on: push: branches: [ "main", "add-github-actions" ] pull_request: - branches: [ "main", "add-github-actions" ] + branches: [ "main" ] jobs: build: @@ -27,10 +27,16 @@ jobs: build_type: [Release] c_compiler: [gcc, clang] include: - - os: ubuntu-latest + - os: ubuntu-22.04 + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-22.04 + c_compiler: clang + cpp_compiler: clang++ + - os: ubuntu-20.04 c_compiler: gcc cpp_compiler: g++ - - os: ubuntu-latest + - os: ubuntu-20.04 c_compiler: clang cpp_compiler: clang++ @@ -39,9 +45,7 @@ jobs: - name: Build using CMake run: > - ./build_samples.sh - -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} - -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} - -S ${{ github.workspace }} + ./build_samples.sh + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} --no-tests From ddea37128b5d4fa85c220389af9a1932da3dc200 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:59:15 -0600 Subject: [PATCH 08/16] Don't run unit tests --- .github/workflows/cmake-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 9e2eca7..7994290 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -46,6 +46,7 @@ jobs: - name: Build using CMake run: > ./build_samples.sh + --no-tests -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} --no-tests From 22dc3a19c94773f6332cb3cd31d17b5630dc89e5 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:59:56 -0600 Subject: [PATCH 09/16] Don't run unit tests --- .github/workflows/cmake-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 7994290..61b4539 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -49,4 +49,3 @@ jobs: --no-tests -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} - --no-tests From d8d42ed334df2643036052a91e282b4627f14b7a Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:11:42 -0600 Subject: [PATCH 10/16] Include missing header --- src/cloudfuse/child_process_linux.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cloudfuse/child_process_linux.cpp b/src/cloudfuse/child_process_linux.cpp index d8cac06..ee80db0 100644 --- a/src/cloudfuse/child_process_linux.cpp +++ b/src/cloudfuse/child_process_linux.cpp @@ -1,6 +1,7 @@ #if defined(__linux__) #include "child_process.h" #include +#include #include #include From 2c0dbd7b6f0bdd0ffb87f289cb88084536653dbb Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:16:30 -0600 Subject: [PATCH 11/16] Add missing header --- .../src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp index f9f5ecd..48aeb48 100644 --- a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp +++ b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include From 6c67320bec01d8c5543ed108ec5d9c4a90143a17 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:19:06 -0600 Subject: [PATCH 12/16] Add missing header --- .../src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp index 48aeb48..cc513ea 100644 --- a/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp +++ b/samples/cloudfuse_plugin/src/nx/vms_server_plugins/analytics/stub/settings/engine.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include From 17bb492f5f6c171e6f7342b984b4fb74c8b919c7 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:20:50 -0600 Subject: [PATCH 13/16] Add ubuntu 24.04 --- .github/workflows/cmake-build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 61b4539..a94a5ab 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -23,10 +23,16 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-22.04, ubuntu-20.04] + os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04] build_type: [Release] c_compiler: [gcc, clang] include: + - os: ubuntu-24.04 + c_compiler: gcc + cpp_compiler: g++ + - os: ubuntu-24.04 + c_compiler: clang + cpp_compiler: clang++ - os: ubuntu-22.04 c_compiler: gcc cpp_compiler: g++ From 6f9d183fc9b21da11999200381c378eed71c72a2 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:27:25 -0600 Subject: [PATCH 14/16] Fix some warnings --- nx_kit/src/json11/json11.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/nx_kit/src/json11/json11.cpp b/nx_kit/src/json11/json11.cpp index 6de413d..1aed282 100644 --- a/nx_kit/src/json11/json11.cpp +++ b/nx_kit/src/json11/json11.cpp @@ -157,7 +157,7 @@ class Value : public JsonValue { // Constructors explicit Value(const T &value) : m_value(value) {} - explicit Value(T &&value) : m_value(move(value)) {} + explicit Value(T &&value) : m_value(std::move(value)) {} // Get type tag Json::Type type() const override { @@ -204,7 +204,7 @@ class JsonString final : public Value { const string &string_value() const override { return m_value; } public: explicit JsonString(const string &value) : Value(value) {} - explicit JsonString(string &&value) : Value(move(value)) {} + explicit JsonString(string &&value) : Value(std::move(value)) {} }; class JsonArray final : public Value { @@ -212,7 +212,7 @@ class JsonArray final : public Value { const Json & operator[](size_t i) const override; public: explicit JsonArray(const Json::array &value) : Value(value) {} - explicit JsonArray(Json::array &&value) : Value(move(value)) {} + explicit JsonArray(Json::array &&value) : Value(std::move(value)) {} }; class JsonObject final : public Value { @@ -220,7 +220,7 @@ class JsonObject final : public Value { const Json & operator[](const string &key) const override; public: explicit JsonObject(const Json::object &value) : Value(value) {} - explicit JsonObject(Json::object &&value) : Value(move(value)) {} + explicit JsonObject(Json::object &&value) : Value(std::move(value)) {} }; class JsonNull final : public Value { @@ -262,12 +262,12 @@ Json::Json(double value) : m_ptr(make_shared(value)) { Json::Json(int value) : m_ptr(make_shared(value)) {} Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} Json::Json(const string &value) : m_ptr(make_shared(value)) {} -Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} +Json::Json(string &&value) : m_ptr(make_shared(std::move(value))) {} Json::Json(const char * value) : m_ptr(make_shared(value)) {} Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::array &&values) : m_ptr(make_shared(std::move(values))) {} Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::object &&values) : m_ptr(make_shared(std::move(values))) {} /* * * * * * * * * * * * * * * * * * * * * Accessors @@ -382,13 +382,13 @@ struct JsonParser final { * Mark this parse as failed. */ Json fail(string &&msg) { - return fail(move(msg), Json()); + return fail(std::move(msg), Json()); } template T fail(string &&msg, const T err_ret) { if (!failed) - err = std::move(msg); + err = std::std::move(msg); failed = true; return err_ret; } From 3c51ad310dd598dcc11e61f936abcdf6a5463c7b Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:28:46 -0600 Subject: [PATCH 15/16] Fix error --- nx_kit/src/json11/json11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx_kit/src/json11/json11.cpp b/nx_kit/src/json11/json11.cpp index 1aed282..503d73e 100644 --- a/nx_kit/src/json11/json11.cpp +++ b/nx_kit/src/json11/json11.cpp @@ -388,7 +388,7 @@ struct JsonParser final { template T fail(string &&msg, const T err_ret) { if (!failed) - err = std::std::move(msg); + err = std::move(msg); failed = true; return err_ret; } From 8c86b2f1eba556c630a4e251eea6c2ba97005a88 Mon Sep 17 00:00:00 2001 From: James Fantin-Hardesty <24646452+jfantinhardesty@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:57:22 -0600 Subject: [PATCH 16/16] Cleanup for merge --- .github/workflows/cmake-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index a94a5ab..d68e724 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -4,7 +4,7 @@ name: CMake on multiple platforms on: push: - branches: [ "main", "add-github-actions" ] + branches: [ "main" ] pull_request: branches: [ "main" ]