Index: LeahiRt/main.cpp =================================================================== diff -u -rf8c0a0b1c19dc386b2f88484d53db022270690a7 -r2c00c6e743844c9a71fa03ce5a5c436ef3836484 --- LeahiRt/main.cpp (.../main.cpp) (revision f8c0a0b1c19dc386b2f88484d53db022270690a7) +++ LeahiRt/main.cpp (.../main.cpp) (revision 2c00c6e743844c9a71fa03ce5a5c436ef3836484) @@ -50,7 +50,7 @@ parser.process(app); LeahiRtController rtController(parser.value(configOption)); - rtController.connectToServer(); + rtController.connectToAgent(); return app.exec(); } Index: lib/MsgUtils/CMakeLists.txt =================================================================== diff -u -rf8c0a0b1c19dc386b2f88484d53db022270690a7 -r2c00c6e743844c9a71fa03ce5a5c436ef3836484 --- lib/MsgUtils/CMakeLists.txt (.../CMakeLists.txt) (revision f8c0a0b1c19dc386b2f88484d53db022270690a7) +++ lib/MsgUtils/CMakeLists.txt (.../CMakeLists.txt) (revision 2c00c6e743844c9a71fa03ce5a5c436ef3836484) @@ -17,12 +17,63 @@ find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network SerialBus) set(MSGUTILS_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/scripts) + +# Create a build-local venv so pip install works on distros that enforce PEP 668 +# (Debian/Ubuntu with Python 3.11+, etc.) without polluting system or user site-packages. +set(MSGUTILS_VENV_DIR ${CMAKE_CURRENT_BINARY_DIR}/msgutils-venv) +set(MSGUTILS_PYTHON ${MSGUTILS_VENV_DIR}/bin/python) +# Probe pip inside the venv — a half-created venv missing python3-venv has python but no pip. +execute_process( + COMMAND ${MSGUTILS_PYTHON} -m pip --version + RESULT_VARIABLE _venv_pip_ok + OUTPUT_QUIET + ERROR_QUIET +) +if(NOT _venv_pip_ok EQUAL 0) + message(STATUS "Creating msgutils Python venv at ${MSGUTILS_VENV_DIR}") + file(REMOVE_RECURSE ${MSGUTILS_VENV_DIR}) + execute_process( + COMMAND ${Python3_EXECUTABLE} -m venv ${MSGUTILS_VENV_DIR} + RESULT_VARIABLE _venv_result + OUTPUT_VARIABLE _venv_output + ERROR_VARIABLE _venv_output + ) + if(NOT _venv_result EQUAL 0 OR NOT EXISTS ${MSGUTILS_PYTHON}) + message(FATAL_ERROR + "Failed to create venv at ${MSGUTILS_VENV_DIR}.\n" + "Install the venv module (e.g. 'sudo apt install python3-venv' or 'python3-full' on Debian/Ubuntu, " + "matching your Python version).\n" + "Output:\n${_venv_output}") + endif() + # Verify pip is actually usable in the new venv. + execute_process( + COMMAND ${MSGUTILS_PYTHON} -m pip --version + RESULT_VARIABLE _venv_pip_ok + OUTPUT_QUIET + ERROR_QUIET + ) + if(NOT _venv_pip_ok EQUAL 0) + message(FATAL_ERROR + "Venv at ${MSGUTILS_VENV_DIR} was created but pip is not available inside it. " + "Install the matching python3-venv package and reconfigure.") + endif() +endif() + include(cmake/MsgUtils.cmake) +# Upgrade pip to ensure pyproject.toml-based editable installs are supported (requires pip >= 21.3). +execute_process( + COMMAND ${MSGUTILS_PYTHON} -m pip install --upgrade pip --quiet + RESULT_VARIABLE _pip_upgrade_result +) +if(NOT _pip_upgrade_result EQUAL 0) + message(FATAL_ERROR "Failed to upgrade pip in msgutils venv (pip returned ${_pip_upgrade_result})") +endif() + # install the Python package in editable mode so that the generated protobuf files can be imported by the Python scripts # without needing to be copied to the Python package directory execute_process( - COMMAND ${Python3_EXECUTABLE} -m pip install -e ${MSGUTILS_SCRIPTS_DIR} --quiet + COMMAND ${MSGUTILS_PYTHON} -m pip install -e ${MSGUTILS_SCRIPTS_DIR} --quiet RESULT_VARIABLE _pip_result ) if(NOT _pip_result EQUAL 0) Index: lib/MsgUtils/cmake/MsgUtils.cmake =================================================================== diff -u -r0bbdafc836463652c41d839ba652e77775a43bec -r2c00c6e743844c9a71fa03ce5a5c436ef3836484 --- lib/MsgUtils/cmake/MsgUtils.cmake (.../MsgUtils.cmake) (revision 0bbdafc836463652c41d839ba652e77775a43bec) +++ lib/MsgUtils/cmake/MsgUtils.cmake (.../MsgUtils.cmake) (revision 2c00c6e743844c9a71fa03ce5a5c436ef3836484) @@ -37,7 +37,7 @@ ${_header_path} ${_source_path} COMMAND - ${Python3_EXECUTABLE} ${MSGUTILS_SCRIPTS_DIR}/GenerateMsgDefsCpp.py + ${MSGUTILS_PYTHON} ${MSGUTILS_SCRIPTS_DIR}/GenerateMsgDefsCpp.py --namespace ${_namespace} --header_dir ${_header_dir} --source_dir ${_source_dir} @@ -79,7 +79,7 @@ OUTPUT ${_protobuf_abs_filename} COMMAND - ${Python3_EXECUTABLE} ${MSGUTILS_SCRIPTS_DIR}/GenerateProtobuf.py + ${MSGUTILS_PYTHON} ${MSGUTILS_SCRIPTS_DIR}/GenerateProtobuf.py --namespace ${_namespace} --output_dir ${_output_path} ${${_input_confs}} @@ -128,7 +128,7 @@ ${_header_path} ${_source_path} COMMAND - ${Python3_EXECUTABLE} ${MSGUTILS_SCRIPTS_DIR}/GenerateMsgDefsCpp.py + ${MSGUTILS_PYTHON} ${MSGUTILS_SCRIPTS_DIR}/GenerateMsgDefsCpp.py --namespace ${_namespace} --header_dir ${_header_dir} --source_dir ${_source_dir} @@ -170,7 +170,7 @@ OUTPUT ${_protobuf_abs_filename} COMMAND - ${Python3_EXECUTABLE} ${MSGUTILS_SCRIPTS_DIR}/GenerateProtobuf.py + ${MSGUTILS_PYTHON} ${MSGUTILS_SCRIPTS_DIR}/GenerateProtobuf.py --namespace ${_namespace} --output_dir ${_output_path} ${${_input_csvs}} Index: lib/MsgUtils/scripts/pyproject.toml =================================================================== diff -u -r0bbdafc836463652c41d839ba652e77775a43bec -r2c00c6e743844c9a71fa03ce5a5c436ef3836484 --- lib/MsgUtils/scripts/pyproject.toml (.../pyproject.toml) (revision 0bbdafc836463652c41d839ba652e77775a43bec) +++ lib/MsgUtils/scripts/pyproject.toml (.../pyproject.toml) (revision 2c00c6e743844c9a71fa03ce5a5c436ef3836484) @@ -1,3 +1,20 @@ [build-system] requires = ["setuptools>=42"] build-backend = "setuptools.build_meta" + +[project] +name = "msgutils" +version = "1.0.0" +description = "Diality Message Utilities" +requires-python = ">=3.9" +dependencies = ["jinja2"] + +[project.scripts] +GenerateMsgDefsCpp = "GenerateMsgDefsCpp:main" +GenerateProtobuf = "GenerateProtobuf:main" + +[tool.setuptools.packages.find] +exclude = ["test*"] + +[tool.setuptools.package-data] +msgutils = ["templates/*"] Fisheye: Tag 2c00c6e743844c9a71fa03ce5a5c436ef3836484 refers to a dead (removed) revision in file `lib/MsgUtils/scripts/setup.py'. Fisheye: No comparison available. Pass `N' to diff? Index: lib/MsgUtils/src/MessageBuilder.cpp =================================================================== diff -u -rcfc0df719cb5033078d0cac45ce0f6243810f2e7 -r2c00c6e743844c9a71fa03ce5a5c436ef3836484 --- lib/MsgUtils/src/MessageBuilder.cpp (.../MessageBuilder.cpp) (revision cfc0df719cb5033078d0cac45ce0f6243810f2e7) +++ lib/MsgUtils/src/MessageBuilder.cpp (.../MessageBuilder.cpp) (revision 2c00c6e743844c9a71fa03ce5a5c436ef3836484) @@ -140,7 +140,7 @@ // return false; // } Q_UNUSED(vMsgId) - const quint8 len = (vData.length() > eLenMaxData) ? eLenMaxData : vData.length(); + const quint8 len = (vData.length() > eLenMaxData) ? (quint8)eLenMaxData : vData.length(); vPayload += len; vPayload += vData.mid(0, len); // Adding required Data return true;