From 5c314f31d895913c81d66cb9ee7ca60dfe6c15cc Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Fri, 11 Apr 2025 11:06:26 -0400 Subject: [PATCH 1/5] [RSDK-10385] Permit builds with VS 2019 16.10+ --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db9b94c32..5ab0cb843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,8 +158,8 @@ if (VIAMCPPSDK_ENFORCE_COMPILER_MINIMA) message(FATAL_ERROR "Insufficient Apple clang version: XCode 10.0+ required") endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.34) - message(FATAL_ERROR "Insufficient MSVC version: Visual Studio 2022 17.4 (MSVC 19.34) or later is required") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.29) + message(FATAL_ERROR "Insufficient MSVC version: Visual Studio 2019 16.10 (MSVC 19.29) or later is required") endif() else() message(FATAL_ERROR "Unknown / untested compiler ${CMAKE_CXX_COMPILER_ID}") From ab6511926e8c78b66157cd43ae2e48ad7840ca79 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Fri, 11 Apr 2025 13:32:37 -0400 Subject: [PATCH 2/5] Revert "[RSDK-10385] Permit builds with VS 2019 16.10+" This reverts commit 5c314f31d895913c81d66cb9ee7ca60dfe6c15cc. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ab0cb843..db9b94c32 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,8 +158,8 @@ if (VIAMCPPSDK_ENFORCE_COMPILER_MINIMA) message(FATAL_ERROR "Insufficient Apple clang version: XCode 10.0+ required") endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.29) - message(FATAL_ERROR "Insufficient MSVC version: Visual Studio 2019 16.10 (MSVC 19.29) or later is required") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.34) + message(FATAL_ERROR "Insufficient MSVC version: Visual Studio 2022 17.4 (MSVC 19.34) or later is required") endif() else() message(FATAL_ERROR "Unknown / untested compiler ${CMAKE_CXX_COMPILER_ID}") From d5507126cfdf5b5ae67910903017d1018cafe88d Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Fri, 11 Apr 2025 13:36:01 -0400 Subject: [PATCH 3/5] [RSDK-10385] Don't enforce compiler minima or complain about warnings for conan builds --- conanfile.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/conanfile.py b/conanfile.py index 574ad5450..1fef0b57d 100644 --- a/conanfile.py +++ b/conanfile.py @@ -65,6 +65,15 @@ def generate(self): tc.cache_variables["VIAMCPPSDK_OFFLINE_PROTO_GENERATION"] = self.options.offline_proto_generation tc.cache_variables["VIAMCPPSDK_USE_DYNAMIC_PROTOS"] = True + # We don't want to constrain these for conan builds because we + # don't know the context where we might be being built. We + # should permit the build if it works. Also, even the C++ SDK + # is warnings clean on the modern compilers we use in CI, it, + # or headers from its dependencies, might throw warnings with + # older compilers, and we should still allow a build there. + tc.cache_variables["VIAMCPPSDK_ENFORCE_COMPILER_MINIMA"] = False + tc.cache_variables["VIAMCPPSDK_USE_WALL_WERROR"] = False + tc.cache_variables["VIAMCPPSDK_BUILD_TESTS"] = False tc.cache_variables["VIAMCPPSDK_BUILD_EXAMPLES"] = False From d0b0974feb2c894ac8917776c7b469eba71e10bd Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Fri, 11 Apr 2025 21:16:15 -0400 Subject: [PATCH 4/5] [RSDK-10385] Eliminate wrapper struct for VS2019 compat --- src/viam/sdk/services/motion.cpp | 4 ---- src/viam/sdk/services/motion.hpp | 18 ++++++------------ .../sdk/services/private/motion_client.cpp | 7 +++---- .../sdk/services/private/motion_server.cpp | 4 ++-- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/src/viam/sdk/services/motion.cpp b/src/viam/sdk/services/motion.cpp index 286d8a64d..072e31065 100644 --- a/src/viam/sdk/services/motion.cpp +++ b/src/viam/sdk/services/motion.cpp @@ -22,10 +22,6 @@ bool operator==(const obstacle_detector& lhs, const obstacle_detector& rhs) { return lhs.vision_service == rhs.vision_service && lhs.camera == rhs.camera; } -bool operator==(const Motion::steps& lhs, const Motion::steps& rhs) { - return lhs.steps == rhs.steps; -} - bool operator==(const Motion::plan_status& lhs, const Motion::plan_status& rhs) { return std::tie(lhs.reason, lhs.state, lhs.timestamp) == std::tie(rhs.reason, rhs.state, rhs.timestamp); diff --git a/src/viam/sdk/services/motion.hpp b/src/viam/sdk/services/motion.hpp index 32055cdb5..59435039c 100644 --- a/src/viam/sdk/services/motion.hpp +++ b/src/viam/sdk/services/motion.hpp @@ -113,19 +113,13 @@ class Motion : public Service { friend bool operator==(const plan_status_with_id& lhs, const plan_status_with_id& rhs); }; - /// @struct steps + /// @brief An individual "step", representing the state each component (keyed as a fully + /// qualified component name) should reach while executing that step of the plan. + using step = std::unordered_map; + /// @brief An ordered list of plan steps. /// @ingroup Motion - struct steps { - /// @brief An individual "step", representing the state each component (keyed as a fully - /// qualified component name) should reach while executing that step of the plan. - typedef std::unordered_map step; - - /// @brief The ordered list of steps. - std::vector steps; - - friend bool operator==(const struct steps& lhs, const struct steps& rhs); - }; + using steps = std::vector; /// @struct plan /// @brief Describes a motion plan. @@ -142,7 +136,7 @@ class Motion : public Service { std::string execution_id; /// @brief An ordered list of plan steps. - struct steps steps; + steps steps; friend bool operator==(const plan& lhs, const plan& rhs); }; diff --git a/src/viam/sdk/services/private/motion_client.cpp b/src/viam/sdk/services/private/motion_client.cpp index 8dbccc13a..a570c7f2f 100644 --- a/src/viam/sdk/services/private/motion_client.cpp +++ b/src/viam/sdk/services/private/motion_client.cpp @@ -139,17 +139,16 @@ Motion::plan_status_with_id from_proto(const service::motion::v1::PlanStatusWith Motion::steps steps_from_proto( const google::protobuf::RepeatedPtrField& proto) { - using step = Motion::steps::step; - std::vector steps; + Motion::steps steps; for (const auto& ps : proto) { - step step; + Motion::step step; for (const auto& component : ps.step()) { step.emplace(component.first, from_proto(component.second.pose())); } steps.push_back(std::move(step)); } - return {steps}; + return steps; } Motion::plan plan_from_proto(const service::motion::v1::Plan& proto) { diff --git a/src/viam/sdk/services/private/motion_server.cpp b/src/viam/sdk/services/private/motion_server.cpp index e393cfca3..9874dc604 100644 --- a/src/viam/sdk/services/private/motion_server.cpp +++ b/src/viam/sdk/services/private/motion_server.cpp @@ -51,7 +51,7 @@ service::motion::v1::PlanStatus to_proto(const Motion::plan_status& ps) { return proto; } -service::motion::v1::PlanStep to_proto(const Motion::steps::step& step) { +service::motion::v1::PlanStep to_proto(const Motion::step& step) { service::motion::v1::PlanStep proto; for (const auto& kv : step) { service::motion::v1::ComponentState cs; @@ -67,7 +67,7 @@ service::motion::v1::Plan to_proto(const Motion::plan& plan) { *proto.mutable_id() = plan.id; *proto.mutable_component_name() = to_proto(plan.component_name); *proto.mutable_execution_id() = plan.execution_id; - for (const auto& step : plan.steps.steps) { + for (const auto& step : plan.steps) { *proto.mutable_steps()->Add() = to_proto(step); } From 3084f997c64a603734e55f1be9eb9e66a6337705 Mon Sep 17 00:00:00 2001 From: Andrew Morrow Date: Fri, 11 Apr 2025 22:37:47 -0400 Subject: [PATCH 5/5] [RSDK-10385] Remove unhelpful typedef as well --- src/viam/sdk/services/motion.hpp | 7 ++----- src/viam/sdk/services/private/motion_client.cpp | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/viam/sdk/services/motion.hpp b/src/viam/sdk/services/motion.hpp index 59435039c..8da6ee637 100644 --- a/src/viam/sdk/services/motion.hpp +++ b/src/viam/sdk/services/motion.hpp @@ -115,11 +115,8 @@ class Motion : public Service { /// @brief An individual "step", representing the state each component (keyed as a fully /// qualified component name) should reach while executing that step of the plan. - using step = std::unordered_map; - - /// @brief An ordered list of plan steps. /// @ingroup Motion - using steps = std::vector; + using step = std::unordered_map; /// @struct plan /// @brief Describes a motion plan. @@ -136,7 +133,7 @@ class Motion : public Service { std::string execution_id; /// @brief An ordered list of plan steps. - steps steps; + std::vector steps; friend bool operator==(const plan& lhs, const plan& rhs); }; diff --git a/src/viam/sdk/services/private/motion_client.cpp b/src/viam/sdk/services/private/motion_client.cpp index a570c7f2f..eddcd959e 100644 --- a/src/viam/sdk/services/private/motion_client.cpp +++ b/src/viam/sdk/services/private/motion_client.cpp @@ -137,9 +137,9 @@ Motion::plan_status_with_id from_proto(const service::motion::v1::PlanStatusWith return pswi; } -Motion::steps steps_from_proto( +std::vector steps_from_proto( const google::protobuf::RepeatedPtrField& proto) { - Motion::steps steps; + std::vector steps; for (const auto& ps : proto) { Motion::step step; for (const auto& component : ps.step()) {