Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7b94013
Initial changes
Feb 2, 2026
5bd3ba1
Removed all internal private api
Feb 24, 2026
6b72ee4
Removed forward decleration
Feb 24, 2026
f97b973
Using internal zigzag encode and decode
Feb 24, 2026
612b5e6
Upgraded grpc submodule to v1.78.0
Feb 25, 2026
2168edf
Updated template constructor
Feb 25, 2026
a84deab
Removed extra whitespace
yash-ni Feb 25, 2026
8cc31e3
Removed hard coded utf8 validity check
Feb 25, 2026
3155c14
Added conditional_variable include
Feb 26, 2026
c5c2bbc
Removed periods from debug log
Feb 26, 2026
8e0ba50
Removed circular dependency
Mar 3, 2026
7f81183
Rename semaphore to lv_semaphore
Mar 5, 2026
65fcab3
Added unit tests
Mar 5, 2026
bf2caf1
Added cached datasize
Mar 9, 2026
4124261
Fixed parsing for various types
Mar 10, 2026
fed4c1a
Fixed byte message parsing
Mar 10, 2026
55d0d02
Added _cachedByteSize
Mar 10, 2026
e04a823
Fixed enum parsing
Mar 10, 2026
cf0ad3b
Fix nested message parsing
Mar 10, 2026
29f542c
Through rumtime error if string is invalid
Mar 10, 2026
a4677a9
Correctly parse oneof in codedstream
Mar 10, 2026
9d5dd7f
Minor cleanup
Mar 10, 2026
6dbd4d1
Fix parsing for singular types
Mar 10, 2026
7e1b27d
Invalidate bytesize cache
Mar 10, 2026
83f90ab
Added AreUtf8StringsEnabled feature toggle for byte parsing
Mar 10, 2026
575868c
Return error from seralizetostring
yash-ni Mar 10, 2026
dc3b40b
Remove commented headers
yash-ni Mar 10, 2026
cee22b7
Correct cache reset
Mar 10, 2026
140bb94
Merge branch 'serializationTraits' of https://github.com/yash-ni/grpc…
Mar 10, 2026
f3c60d5
Remove empty buffer check
yash-ni Mar 10, 2026
4f29cef
Include break in wiretype group
Mar 10, 2026
3f8ec86
Upgrade grpc to v1.78.1
Mar 10, 2026
27ece25
Update src/lv_serialization_traits.h comments
yash-ni Mar 11, 2026
b724c3e
Return false if parsing fails
Mar 11, 2026
6fd988d
Removed buffer clear
Mar 11, 2026
14da4fa
Override recorderror and recordwarning
Mar 11, 2026
89c2d96
Added support for unpacked repeated field
Mar 11, 2026
de9faf8
Added tests for unpacked repeated fields
Mar 11, 2026
4934beb
Use wireformat from wireformatlite internal library
Mar 12, 2026
76717b8
Remove inline zigzag helpers
Mar 12, 2026
9d4f86f
Minor changes
Mar 12, 2026
671108a
Minor changes
Mar 16, 2026
b3d8e61
Changed parameter names to camelcase
Mar 16, 2026
b937508
Resolved build errors
Mar 16, 2026
1be6f27
Refactor protobuf numeric field parsing using traits-based template
Mar 16, 2026
340defe
Fix: merge multiple packed chunks for the same repeated field
Mar 16, 2026
78f8eea
Added commentes for bytesizelongcache
Mar 16, 2026
93a816a
Added tests for repeated string/bytes merging across multiple occurre…
Mar 16, 2026
41393df
Correctly handle empty buffers
Mar 16, 2026
5d987fa
Removed unnecessary copies and allocations in ParseFromByteBuffer
Mar 16, 2026
a584ff2
Minor changes and refactoring
Mar 17, 2026
aa84620
Minor changes and code cleanup
Mar 23, 2026
3ea9447
minor changes
Mar 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(labview-grpc C CXX)
set(ABSL_ENABLE_INSTALL ON)

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have any backward compatibility impact for Linux RT? Have you done any testing with an RT target and LV 2023Q1?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven’t tested this on Linux RT beyond the build pipeline. I tested it on LV 2019. Is there any specific reason you’re asking about 2023 Q1?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last time we upgraded grpc libraries, it required removing support for some older versions of LVRT, and I don't think we really realized it until after the fact. See #439. I want to ensure the same thing isn't happening here.

I'm not familiar with the Linux RT toolchain and deployment which is why I asked the question. Presumably the update to C++ 20 requires a new version of the C++ standard runtime library to be deployed. How is that done for a Linux RT system? I don't believe the "install" pattern used for our binaries expects/includes any binaries other than what are built from this repo. So presumably this dependency would already need to be available on the system from a shared location? If so and the rest of the LV toolchain is using a different C++ runtime version then it seems like that could be a problem. Or are we statically linking in the dependency? It's not clear to me browsing through the cmake files. Anyway, this is what motivated the question.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue before was when the RT toolchain that was used for build was changed (defined here:
https://github.com/yash-ni/grpc-labview/blob/de9faf8cc4504da024f140ae14971b7ef51c2527/.github/workflows/build_on_rt.yml#L30-L31)

The RT toolchain links to a version of libc and libstdc++, which is what breaks the shared library on previous versions of NILRT.

Since this PR does not change the toolchain - and the RT build workflow is passing - I would not expect that the compatible NILRT versions to be affected by this. (However I would still recommend testing just to be sure :))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition: libstdc++ uses symbol versioning to preserve compatibility with older versions: https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html

If the code depends on symbols that are marked CXXABI_1.3.14 but the installed libstdc++ only supports up to CXXABI_1.3.12 or something, then you will get errors from dlopen or function calls.

# Set default visibility to hidden, only export LIBRARY_EXPORT symbols from the shared library
add_compile_options(-fvisibility=hidden)
else()
Expand All @@ -19,7 +19,7 @@ else()
set(protobuf_MSVC_STATIC_RUNTIME ON CACHE BOOL "Use static runtime for protobuf" FORCE)
set(ABSL_MSVC_STATIC_RUNTIME ON CACHE BOOL "Use static runtime for Abseil")
set(CARES_MSVC_STATIC_RUNTIME ON CACHE BOOL "Use static runtime for c-ares")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244")
add_compile_options("$<$<NOT:$<CONFIG:Debug>>:/Zi>")
add_link_options("$<$<NOT:$<CONFIG:Debug>>:/DEBUG>")
Expand All @@ -46,6 +46,15 @@ add_definitions(-D_PS_${CMAKE_SIZEOF_VOID_P})
#----------------------------------------------------------------------
add_subdirectory(third_party/grpc ${CMAKE_CURRENT_BINARY_DIR}/grpc EXCLUDE_FROM_ALL)

#----------------------------------------------------------------------
# Workaround for MSVC C1001 ICE in descriptor_visitor.h on 32-bit builds
# Force protobuf to use C++20 to avoid compiler internal error
# See: https://github.com/google/bloaty/pull/410
#----------------------------------------------------------------------
if(MSVC)
set_target_properties(libprotobuf libprotobuf-lite libprotoc PROPERTIES CXX_STANDARD 20)
endif()

#----------------------------------------------------------------------
# Use the grpc targets directly from this build.
#----------------------------------------------------------------------
Expand Down Expand Up @@ -95,6 +104,7 @@ add_library(labview_grpc_server SHARED
src/lv_message_value.cc
src/lv_proto_server_reflection_plugin.cc
src/lv_proto_server_reflection_service.cc
src/lv_serialization_traits.cc
src/message_element_metadata_owner.cc
src/message_metadata.cc
src/path_support.cc
Expand Down Expand Up @@ -217,6 +227,42 @@ target_link_libraries(test_server
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF})

#######################################################################
# Unit Tests (Google Test)
#######################################################################

# Google Test is bundled with gRPC
set(GTEST_DIR "${CMAKE_SOURCE_DIR}/third_party/grpc/third_party/googletest")
add_subdirectory(${GTEST_DIR} ${CMAKE_CURRENT_BINARY_DIR}/googletest EXCLUDE_FROM_ALL)

add_executable(unit_tests
tests/unit/lv_message_tests.cc
src/lv_message.cc
src/lv_message_value.cc
src/lv_serialization_traits.cc
src/string_utils.cc
src/feature_toggles.cc
src/message_metadata.cc
src/message_element_metadata_owner.cc
src/lv_interop.cc
src/path_support.cc
src/exceptions.cc
src/well_known_messages.cc
)
target_link_libraries(unit_tests
gtest
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
target_include_directories(unit_tests PRIVATE
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_CURRENT_BINARY_DIR}"
"${GTEST_DIR}/googletest/include"
)

enable_testing()
add_test(NAME unit_tests COMMAND unit_tests)

add_dependencies(labview_grpc_server Detect_Compatibility_Breaks)
add_dependencies(labview_grpc_generator Detect_Compatibility_Breaks)
add_dependencies(test_client Detect_Compatibility_Breaks)
Expand Down
4 changes: 0 additions & 4 deletions src/event_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
#include <grpc_server.h>
#include <lv_message.h>

//---------------------------------------------------------------------
//---------------------------------------------------------------------
using namespace google::protobuf::internal;

namespace grpc_labview
{
//---------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/grpc_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#pragma once

//---------------------------------------------------------------------
// IMPORTANT: lv_serialization_traits.h MUST be included BEFORE grpc headers
// This registers our custom SerializationTraits<LVMessage> specialization
//---------------------------------------------------------------------
#include <metadata_owner.h>
#include <lv_serialization_traits.h>
#include <grpcpp/grpcpp.h>
#include <lv_message.h>
#include <grpcpp/impl/codegen/sync_stream.h>
#include <metadata_owner.h>
#include <future>
#include <unordered_map>

Expand Down
6 changes: 5 additions & 1 deletion src/grpc_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
//---------------------------------------------------------------------
#ifdef __WIN32__
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#endif

//---------------------------------------------------------------------
// IMPORTANT: lv_serialization_traits.h MUST be included BEFORE grpc headers
// This registers our custom SerializationTraits<LVMessage> specialization
//---------------------------------------------------------------------
#include <lv_serialization_traits.h>
#include <grpcpp/grpcpp.h>
#include <grpcpp/impl/codegen/async_generic_service.h>
#include <grpcpp/impl/codegen/completion_queue.h>
Expand All @@ -27,7 +31,7 @@
#include <map>
#include <event_data.h>
#include <metadata_owner.h>
#include <semaphore.h>
#include <lv_semaphore.h>

//---------------------------------------------------------------------
//---------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/lv_interop.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//---------------------------------------------------------------------
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#endif

Expand Down
Loading
Loading