Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some backports to 0.10.x #1778

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 13 additions & 8 deletions .azure/templates/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ steps:
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/.cache/pip"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
sudo apt-get install -y clang clang-tools clang-tidy
sudo apt install -y clang clang-tools clang-tidy
condition: eq(variables['Agent.OS'], 'Linux')
name: setup_linux
- bash: |
set -e -x
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
echo "###vso[task.setvariable variable=pip_cache;]${HOME}/Library/Caches/pip"
echo "###vso[task.setvariable variable=PATH;]$(python3 -m site --user-base)/bin:${PATH}"
echo "###vso[task.setvariable variable=build_tool_options;]-j 4"
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
brew install bison
condition: eq(variables['Agent.OS'], 'Darwin')
name: setup_macos
# Use PowerShell rather than Bash to ensure Windows-style paths
Expand All @@ -62,16 +62,13 @@ steps:
} else {
Write-Host "###vso[task.setvariable variable=build_tool_options;]-j 4"
}
# On purpose do not install bison on windows to test the fallback to the parser.y in tree.
# choco install winflexbison3
condition: eq(variables['Agent.OS'], 'Windows_NT')
name: setup_windows
- task: Cache@2
inputs:
key: pip | 2 | $(Agent.OS)
path: $(pip_cache)
name: cache_pip
- template: /.azure/templates/install-conan.yml
- bash: |
set -e -x
python -m pip install pip wheel setuptools --user --upgrade
Expand All @@ -90,6 +87,7 @@ steps:
iceoryx
mkdir iceoryx/build
cd iceoryx/build
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_BUILD_SHARED_LIBS=on \
-DCMAKE_INSTALL_PREFIX=install \
Expand All @@ -101,10 +99,15 @@ steps:
set -e -x
mkdir build
cd build
conan install -b missing -pr:b ${BUILD_PROFILE} -pr:h ${HOST_PROFILE} -s build_type=${BUILD_TYPE} ../${CONANFILE:-conanfile.txt}
prefix_path="${BUILD_SOURCESDIRECTORY}/iceoryx/build/install"
if [[ "${AGENT_OS}" == 'Darwin' ]] ; then
prefix_path="${prefix_path}:`brew --prefix openssl`"
# Azure sometimes adds a spurious ' to BUILD_TOOL_OPTIONS
BUILD_TOOL_OPTIONS="-j 4"
fi
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=install \
-DCMAKE_PREFIX_PATH="${BUILD_SOURCESDIRECTORY}/iceoryx/build/install" \
-DCMAKE_PREFIX_PATH="${prefix_path//:/;}" \
-DANALYZER=${ANALYZER:-off} \
-DSANITIZER=${SANITIZER:-none} \
-DENABLE_SSL=${SSL:-on} \
Expand Down Expand Up @@ -142,11 +145,13 @@ steps:
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
${GENERATOR:+-G} "${GENERATOR}" -A "${PLATFORM}" -T "${TOOLSET}" "${INSTALLPREFIX}/share/CycloneDDS/examples/helloworld"
cmake --build . --config ${BUILD_TYPE} -- ${BUILD_TOOL_OPTIONS}
condition: ne(variables['testing'], 'off')
name: test
displayName: Test
- bash: |
set -e -x
cd build
[[ "${AGENT_OS}" == 'Darwin' ]] && BUILD_TOOL_OPTIONS="-j 4"
cmake --build . --config ${BUILD_TYPE} --target gcov -- ${BUILD_TOOL_OPTIONS}
gcovr --exclude '.*/tests/.*' --root "${BUILD_SOURCESDIRECTORY}" --json "$(System.DefaultWorkingDirectory)/coverage-$(Agent.JobName).json"
name: generate_code_coverage
Expand Down
66 changes: 0 additions & 66 deletions .azure/templates/install-conan.yml

This file was deleted.

35 changes: 4 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
cmake_minimum_required(VERSION 3.16)
project(CycloneDDS VERSION 0.10.3 LANGUAGES C)
project(CycloneDDS VERSION 0.10.4 LANGUAGES C)

# Set a default build type if none was specified
set(default_build_type "RelWithDebInfo")
Expand Down Expand Up @@ -72,33 +72,6 @@ if(APPLE)
endif()
endif()

# Conan
if(EXISTS "${CMAKE_BINARY_DIR}/conanbuildinfo.cmake")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
if(APPLE)
# By default Conan strips all RPATHs (see conanbuildinfo.cmake), which
# causes tests to fail as the executables cannot find the library target.
# By setting KEEP_RPATHS, Conan does not set CMAKE_SKIP_RPATH and the
# resulting binaries still have the RPATH information. This is fine because
# CMake will strip the build RPATH information in the install step.
#
# NOTE:
# Conan's default approach is to use the "imports" feature, which copies
# all the dependencies into the bin directory. Of course, this doesn't work
# quite that well for libraries generated in this Project (see Conan
# documentation).
#
# See the links below for more information.
# https://github.com/conan-io/conan/issues/337
# https://docs.conan.io/en/latest/howtos/manage_shared_libraries/rpaths.html
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
conan_basic_setup(KEEP_RPATHS)
else()
conan_basic_setup()
endif()
conan_define_targets()
endif()

# Set reasonably strict warning options for clang, gcc, msvc
# Enable coloured ouput if Ninja is used for building
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
Expand Down Expand Up @@ -227,9 +200,9 @@ endif()
find_package(codecov)
set(MEMORYCHECK_COMMAND_OPTIONS "--track-origins=yes --leak-check=full --trace-children=yes --child-silent-after-fork=yes --xml=yes --xml-file=TestResultValgrind_%p.xml --tool=memcheck --show-reachable=yes --leak-resolution=high")

# By default building the testing tree is enabled by including CTest, but
# since not everybody has CUnit, and because it is not strictly required to
# build the product itself, switch to off by default.
# Tests (integrated with CTest) are not built by default: not only are they not useful to
# most people, building the test suite also forces exporting way more symbols from the
# library so we can actually build the tests.
option(BUILD_TESTING "Build the testing tree." OFF)

# Include the tests for idlc. These tests use the idl compiler (C back-end) to
Expand Down
19 changes: 4 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ while True:
sleep(rng.exponential())
```

Today DDS is also popular in robotics and autonomous vehicles because those really depend on high-throuhgput, low-latency control systems without introducing a single point of failure by having a message broker in the middle.
Today DDS is also popular in robotics and autonomous vehicles because those really depend on high-throughput, low-latency control systems without introducing a single point of failure by having a message broker in the middle.
Indeed, it is by far the most used and the default middleware choice in ROS 2.
It is used to transfer commands, sensor data and even video and point clouds between components.

Expand Down Expand Up @@ -99,7 +99,7 @@ With references to the individual OMG specifications, the following is available
- [DDS XTypes](https://www.omg.org/spec/DDS-XTypes/1.3/PDF) - the structural type system (some [caveats](docs/dev/xtypes_relnotes.md) here)
- [DDSI-RTPS](https://www.omg.org/spec/DDSI-RTPS/2.5/PDF) - the interoperable network protocol

The network stack in Cyclone DDS has been around for over a decade in one form or another and has proven itself in many systems, including large, high-availability ones and systems where interoperation with other implementations was needed.
The network stack in Cyclone DDS has been around for over a decade in one form or another and has proven itself in many systems, including large, high-availability ones and systems where interoperatibility with other implementations was needed.

This repository provides the core of Cyclone DDS including its C API, the [OMG C++](https://github.com/eclipse-cyclonedds/cyclonedds-cxx) and the [Python](https://github.com/eclipse-cyclonedds/cyclonedds-python) language bindings are in sibling repositories.

Expand Down Expand Up @@ -134,7 +134,7 @@ Depending on whether you want to develop applications using Cyclone DDS or contr
There are some configuration options specified using CMake defines in addition to the standard options like `CMAKE_BUILD_TYPE`:

* `-DBUILD_EXAMPLES=ON`: to build the included examples
* `-DBUILD_TESTING=ON`: to build the test suite (this requires [CUnit](http://cunit.sourceforge.net/), see [Contributing to Eclipse Cyclone DDS](#contributing-to-eclipse-cyclone-dds) below for more information)
* `-DBUILD_TESTING=ON`: to build the test suite (forces exporting all symbols from the library)
* `-DBUILD_IDLC=NO`: to disable building the IDL compiler (affects building examples, tests and `ddsperf`)
* `-DBUILD_DDSPERF=NO`: to disable building the [`ddsperf`](https://github.com/eclipse-cyclonedds/cyclonedds/tree/master/src/tools/ddsperf) tool for performance measurement
* `-DENABLE_SSL=NO`: to not look for OpenSSL, remove TLS/TCP support and avoid building the plugins that implement authentication and encryption (default is `AUTO` to enable them if OpenSSL is found)
Expand Down Expand Up @@ -189,25 +189,14 @@ Note that the default build type is a release build with debug information inclu

We very much welcome all contributions to the project, whether that is questions, examples, bug
fixes, enhancements or improvements to the documentation, or anything else really.
When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite using CTest and CUnit that can be built locally if desired.
When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite built using a simple testing framework and CTest that can be built locally if desired.
To build it, set the cmake variable `BUILD_TESTING` to on when configuring, e.g.:

$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON ..
$ cmake --build .
$ ctest

Such a build requires the presence of [CUnit](http://cunit.sourceforge.net/).
You can install this yourself, or you can choose to instead rely on the [Conan](https://conan.io) packaging system that the CI build infrastructure also uses.
In that case, install Conan and do:

$ conan install .. --build missing

in the build directory prior to running cmake.

For Windows, depending on the generator, you might also need to add switches to select the architecture and build type, e.g., `conan install -s arch=x86_64 -s build_type=Debug ..`
This will automatically download and/or build CUnit (and, at the moment, OpenSSL).

## Documentation

The [documentation](https://cyclonedds.io/docs) is still rather limited and some parts of it are still only available in the form of text files in the `docs` directory.
Expand Down
26 changes: 18 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ jobs:
topic_discovery: off
idlc_testing: off # temporary dislabled because of passing -t option to idlc in this test for recursive types
cc: gcc-10
'Ubuntu 18.04 LTS with GCC 7 (Debug, x86_64)':
image: ubuntu-18.04
conanfile: conanfile102.txt
cc: gcc-7
'Ubuntu 20.04 LTS with Clang 10 (Debug, x86_64)':
image: ubuntu-20.04
'Ubuntu 22.04 LTS with GCC 10 (Debug, x86_64, no tests)':
image: ubuntu-22.04
cc: gcc-10
testing: off
idlc_xtests: off
'Ubuntu 22.04 LTS with Clang 12 (Debug, x86_64)':
image: ubuntu-22.04
analyzer: on
sanitizer: address,undefined
cc: clang-10
Expand Down Expand Up @@ -88,10 +89,19 @@ jobs:
sanitizer: undefined
cc: clang
coverage: on
'Windows 2019 with Visual Studio 2019 (Visual Studio 2017, Debug, x86)':
'macOS 12 with gcc 12 (Debug, analyzer, x86_64)':
image: macOS-12
sanitizer: undefined
deadline_update_skip: on
cc: gcc-12
analyzer: on
# 32-bit Windows: without SSL/security because Chocolateley only provides 64-bit OpenSSL
'Windows 2019 with Visual Studio 2019 (Visual Studio 2017, Debug, x86, no security)':
arch: x86
image: windows-2019
idlc_testing: off
ssl: off
security: off
idlc_xtests: off
generator: 'Visual Studio 16 2019'
toolset: v141
'Windows 2019 with Visual Studio 2019 (Debug, x86_64)':
Expand Down
12 changes: 1 addition & 11 deletions cmake/Modules/CUnit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
find_package(CUnit REQUIRED)

set(CUNIT_DIR "${CMAKE_CURRENT_LIST_DIR}/CUnit")

Expand Down Expand Up @@ -227,14 +226,6 @@ function(set_test_library_paths TEST_NAME)
endfunction()

function(add_cunit_executable TARGET)
# Retrieve location of shared libary, which is need to extend the PATH
# environment variable on Microsoft Windows, so that the operating
# system can locate the .dll that it was linked against.
# On macOS, this mechanism is used to set the DYLD_LIBRARY_PATH.
get_target_property(CUNIT_LIBRARY_TYPE CUnit TYPE)
get_target_property(CUNIT_IMPORTED_LOCATION CUnit IMPORTED_LOCATION)
get_filename_component(CUNIT_LIBRARY_DIR "${CUNIT_IMPORTED_LOCATION}" PATH)

set(decls)
set(defns)
set(sources)
Expand Down Expand Up @@ -322,8 +313,7 @@ function(add_cunit_executable TARGET)

add_executable(
${TARGET} "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.c" ${sources})
target_link_libraries(${TARGET} PRIVATE CUnit)
target_include_directories(${TARGET} PRIVATE "${CUNIT_DIR}/include")
target_link_libraries(${TARGET} PRIVATE CycloneDDS::ucunit)
if(MSVC)
target_compile_definitions(${TARGET} PRIVATE _CRT_SECURE_NO_WARNINGS)
endif()
Expand Down
Loading