fix(zenoh_cpp_vendor): bump zenoh-cpp to fix MSVC 19.44 build failure#968
fix(zenoh_cpp_vendor): bump zenoh-cpp to fix MSVC 19.44 build failure#968YuanYuYuan wants to merge 6 commits into
Conversation
eclipse-zenoh/zenoh-cpp#776 fixed std::forward<D>(d) → std::move(d) in three Bytes move constructors. MSVC 19.44 (VS 2022 17.14, used by the ROS 2 Windows buildfarm) rejects std::forward on deduced lambda types with C2665/C3536. The fix is merged at a3cd1a2d. Bump zenoh_cpp_vendor to that commit to unblock ci_windows builds.
|
Pulls: #968 |
|
Feedback from @jmachowinski via Zulip:
|
The windows runner seems to build rmw_zenoh_cpp successfully.
|
|
I just double checked. Your fix if not compiling on MSVC 2022. |
|
Hi @jmachowinski! These are the snapshots of falling one and the patched one. The MSVC is the same 19.44.35225 which is Visual Studio 2022 version 17.14 with toolset version 14.44. And it can build on my local Windows machine with Visual Studio 2022. Can you clarify the issue you faced? |
|
This is odd. I run windows 11 with the same compiler : I am using your version of the fix: I deleted zenoh_cpp_vendor from build / install to be sure the fix is picked up, and when I I can see it is the patched version : template <class Allocator>
Bytes(std::vector<uint8_t, Allocator>&& v) : Bytes() {
std::vector<uint8_t, Allocator>* ptr = new std::vector<uint8_t, Allocator>(std::move(v));
auto d = [p = ptr]() mutable { delete p; };
using D = decltype(d);
using Dval = std::remove_reference_t<D>;
using DroppableType = typename detail::closures::Droppable<Dval>;
auto drop = DroppableType::into_context(std::move(d));
::z_bytes_from_buf(interop::as_owned_c_ptr(*this), ptr->data(), ptr->size(),
detail::closures::_zenoh_drop_with_context, drop);
}but the compile fails for me : These errors go away if I apply the patches proposed in eclipse-zenoh/zenoh-cpp#778 |
|
I found the difference ! These change the minimum c++ version for all ros packages to c++20 and C17. If I remove the patches from rcutils, it compiles. If I manually change the c++ version in the CMakeLists.txt in rmw_zenoh_cpp to 20 I get the same compile errors. |
…ibility" This reverts commit 41e2def.



Summary
zenoh_cpp_vendorto zenoh-cpp commita3cd1a2d(fix(bytes): replace std::forward<D>(d) with std::move(d) in move constructors eclipse-zenoh/zenoh-cpp#776) to fix MSVC 19.44 build failures on the ROS 2 Windows buildfarm.Root Cause
MSVC 19.44 (VS 2022 17.14,
14.44.35207), shipped with the ROS 2 buildfarm, introduced conformance tightening that rejectsstd::forward<D>(d)whenDis a deduced local lambda type:Three
Bytesmove constructors inbytes.hxxused this pattern. The fix replacesstd::forward<D>(d)withstd::move(d), which is semantically equivalent (sinceDis never a reference here) and accepted by all compilers.Failure Reference
https://ci.ros2.org/job/ci_windows/27578/console
Key Changes
zenoh_cpp_vendor/CMakeLists.txt:VCS_VERSIONforzenoh_cpp_vendorupdated fromaf381b42(zenoh-cpp 1.9.0 tag) toa3cd1a2d(one commit past the tag, containing the MSVC fix).The zenoh-c pinned commits are unchanged. The zenoh-cpp
af381b42→a3cd1a2ddelta touches onlybytes.hxxand is fully compatible with zenoh-c 1.8.Breaking Changes
None
Did you use Generative AI?
Yes. Claude (claude-sonnet-4-6) via Claude Code was used to assist with creating an initial prototype version of the changes contained in this PR.