Commit graph

660 commits

Author SHA1 Message Date
Dan Rose
d12b926ff1 Move IDLC to its own install component
This allows you to express a dependency on it as `find_package(CycloneDDS REQUIRED COMPONENTS idlc)`
Also added a warning if CycloneDDS was built with IDLC but IDLC is not requested.

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-14 10:02:01 +01:00
Scott K Logan
eeeea486c8 fixup! Allow BUILD_IDLC to be 'AUTO' based on Maven presence
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Scott K Logan
7b428f14b9 Allow BUILD_IDLC to be 'AUTO' based on Maven presence
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Scott K Logan
9260464be8 fixup! Set default BUILD_IDLC based on presence of Maven
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Scott K Logan
94524bfd76 Set default BUILD_IDLC based on presence of Maven
This will modify the default behavior to select BUILD_IDLC based on
whether Maven is discovered or not.

The behavior when `-DBUILD_IDLC` is specified on the command line remains
unchanged - the build will maintain the current behavior of failing to
configure if `BUILD_IDLC=ON` and Maven was later not found.

This reverts (part of) commit 860a6aadae.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-11-14 09:59:47 +01:00
Erik Boasson
ff79941aeb If possible, fail build on option doc mismatch
This adds a bunch of steps to the build process that verify
cyclonedds.xsd, cyclonedds.rnc and options.md as committed match the
configuration tables in the source.

The cyclonedds.rnc and options.md depend on having perl available,
cyclonedds.xsd on having Java and the "trang" conversion tool.  Not
having these tools simply means some of the checks are skipped.

Signed-off-by: Erik Boasson <eb@ilities.com>

makernc: more forgiving of line endings input

Signed-off-by: Erik Boasson <eb@ilities.com>

Ignore line endings comparing cyclonedds XSD, RNC

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 20:39:20 +01:00
Erik Boasson
c642f5676a Namespace generated XSD and add missing attributes
This adds two things to the XSD (and the RNC file and options.md):
* attributes previously missing because of a bug in the conversion
  script
* a name space (https://cdds.io/config)

Adding the name spacing requires a different set of attributes at the
top of a configuration file, which in turn need to be ignored by the
configuration parser, and which should be reflected in the configuration
example in the README.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 20:39:20 +01:00
Dan Rose
c5b22bf629 Fix most of the validation problems
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Dan Rose
4f2addef1a Allow xmlns attribute on the root element
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Dan Rose
ae1a8130c7 Namespace the schema and add references in xml files
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-11-06 20:39:20 +01:00
Erik Boasson
a1aaa2808f Check once for system-independent headers (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:39:01 +01:00
Erik Boasson
b9e5e8cd7d Xcode 11.1 for macOS 10.12 build, Xcode 9 via cron
The Xcode 9 builds often fail because of some nasty interaction between
it and the Travis build cache -- but not caching means they always take
forever because of homebrew updates.  This commit changes the build to
use a new Xcode but with a deployment target of 10.12 instead.

This means that macOS version macros for versions later than 10.12 are
available and that the tests run on a later version of macOS as well.
Therefore, it doesn't prove that a "real" Xcode 9 / macOS 10.12 build
will work.

ROS2 relies on macOS 10.12 so this introduces a (small) risk of build
failures over there.  To mitigate that, a pure Xcode 9 build is included
in the cron job.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:17:40 +01:00
Erik Boasson
3652fe6330 Update to Xcode 11.1 image on Travis CI
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:17:40 +01:00
Erik Boasson
389d6b1789 Remove repetitive debug print from "mpt_qosmatch"
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-06 14:17:40 +01:00
Erik Boasson
9e61bff9b9 Use unsigned char for XML input
Sign extension causes some character values to be interpreted as special
tokens, potentially causing the parser to hang, pass a null pointer as
element name to the "elem_open" callback (which would crash the
configuration processing).

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
5883b96f6a Handle unterminated comment in XML parser (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
d545551a60 Fix input buffer allocation in XML parser (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
151159a5ea Clear sa_mask in sigaction for DDS_LC_FATAL test
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Erik Boasson
57ac8a457b Skip irrelevant buckets in hopscotch lookup (#270)
When scanning buckets while looking for a specific element, it is faster
to only inspect those buckets for which the corresponding bit in
"hopinfo" is set.  Sadly, simple scanning is faster than the far more
elegant perfect hash based on a De Bruijn sequence.

Add a simple test/performance measurement.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-11-04 14:36:28 +01:00
Marcel Jordense
43ee3f87ca use ddsrt_malloc for allocating iov array
Signed-off-by: Marcel Jordense <marcel.jordense@adlinktech.com>
2019-10-28 21:45:41 +01:00
dennis-adlink
c8aa6fee5a Moved bswap functions to ddsrt (#297)
* Moved bswap functions to ddsrt

Moved the byte swapping functions from ddsi to ddsrt so that
these can be re-used in e.g. the security plugins and tests.

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>

* Moved  decarations for bswap functions to ddsrt

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-10-28 15:03:46 +01:00
Dan Rose
76fa688086 CMAKE_SOURCE_DIR -> CMAKE_CURRENT_SOURCE_DIR
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-23 09:36:38 +02:00
Scott K Logan
860a6aadae Drop IDLC when building with colcon
This will eliminate two large dependencies when building CycloneDDS with
colcon for ROS 2, which doesn't appear to need the IDLC.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-22 22:37:40 +02:00
Scott K Logan
1cc6caff14 First check the CMake Package Registry for CUnit
This is useful when building CycloneDDS on platforms that provide CMake
configuration for CUnit outside of Conan.

If no configuration is found in the system CMake registry the module
continues as before.

Co-authored-by: Steven! Ragnarök <steven@nuclearsandwich.com>
Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-22 22:33:10 +02:00
Martin Bremmer
41d36d59b2 Removed duplicate build from travis
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-10-22 20:28:34 +02:00
Thijs Sassen
36b1b9da3d Adjusted mpt qos test includes to be in line with other tests
Signed-off-by: Thijs Sassen <thijs.sassen@adlinktech.com>
2019-10-22 16:27:15 +02:00
Scott K Logan
a3b35a2aa4 Fix some unreliable STREQUAL calls in CMakeLists.txt
These conditionals may fail if the variable they're checking isn't
defined at all. Adding quotes makes the comparison against an empty
string in this case, which avoids the syntax error.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-22 15:22:56 +02:00
Scott K Logan
94e4c0915d Skip some tests when BUILD_IDLC=OFF
These tests use `idlc_generate`, which is not available when
`BUILD_IDLC` is not `ON`.

Signed-off-by: Scott K Logan <logans@cottsay.net>
2019-10-22 15:20:30 +02:00
Dan Rose
98ce7d1971 Stylistic CMake changes
No functional impact intended
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-22 15:18:26 +02:00
Dan Rose
418a70e7c3 Fix CI not finding pip3
Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-20 03:32:18 -07:00
Dan Rose
960d4f7358 Use PROJECT_NAME instead of CMAKE_PROJECT_NAME
CMAKE_PROJECT_NAME refers to the top-level project name, not the most recent project. So any CMake project that pulls this in as a dependency was in for a nasty surprise.
https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_NAME.html

Signed-off-by: Dan Rose <dan@digilabs.io>
2019-10-20 03:28:15 -07:00
Erik Boasson
8ec68e1d7d No printing of null pointers in config errors
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Erik Boasson
a71be9dcec Remove all occurrences of strncpy
Too many compilers warn about correct use of strncpy these days ...

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Erik Boasson
f8bff97736 Fix off-by-one error in dds_strretcode (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Erik Boasson
5a746cad81 Always abort on DDS_FATAL variants + test (#270)
The test only works on Linux and macOS because of the system
dependencies in catching an abort.  The logging code is platform
independent so testing only on these platforms still gives a good sanity
check.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Erik Boasson
50e63b3324 Correct ddsrt_gnuc, ddsrt_clang definitions (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Erik Boasson
14ffab2705 Always use atomic64 for writer seq_xmit (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Erik Boasson
8ce389dd85 IID generator: init and atomic64 ops (#270)
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-16 03:08:31 +02:00
Dennis Potman
cbc6dc5aa0 Increase thread test timeout to check if this caused the failing tests on travis win32
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
2019-10-15 19:29:18 +02:00
Erik Boasson
aa5236dea4 Prefix matching for config XML in CYCLONEDDS_URI
Allow unique prefix matches for elements and attributes specified in
directly in CYCLONEDDS_URI.  That mode already has a few niceties for
quickly specifying some configuration overrides, this is simply one
more.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-10 17:44:39 +02:00
Erik Boasson
a25b69be7d Exclude network channels from documentation
They are not supported yet.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-10 17:44:39 +02:00
Erik Boasson
d429045255 Add option documentation and add XSD
The ``docs/makernc.pl`` perl script can extract the options from the
source code for the configuration processing and turn these into a
GitHub MarkDown document and a RELAX NG Compact form (RNC) description
of the options.  Standard conversion tools can be used to turn the RNC
file into an XSD.

Although they are generated by a mechanical transformation, it is not
(yet) part of the build process, in no small part because there no
proper generation and publishing system has yet been set up for the
documentation.

Now that there is an XSD and a Markdown file for discovering the
options, there is no need to retain the configuration editing tool.  Any
decent editor will do a better job.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-10 17:44:39 +02:00
Erik Boasson
fde05810c6 Drop broken protection against casual eavesdroppers
From a distant past came code to encrypt data on the wire, but it hasn't
been functional in Cyclone for a long time and it only ever provided
protection against casual eavesdroppers.  It is better to delete it.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-10 17:44:39 +02:00
Thijs Sassen
0b57b74b93 Fix compile error when using rusage functionality on FreeRTOS
Signed-off-by: Thijs Sassen <thijs.sassen@adlinktech.com>
2019-10-07 14:12:27 +02:00
Jeroen Koekkoek
378b4b19d7 Add macOS 10.12 / Xcode 9 build on Travis CI
Signed-off-by: Jeroen Koekkoek <jeroen@koekkoek.nl>
2019-10-02 14:17:38 +02:00
Erik Boasson
0098cfcab7 Fix macOS 10.12 version check
Xcode 9 doesn't yet define MAC_OS_X_VERSION_10_13.

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-10-02 08:52:06 +02:00
eboasson
50b0611ad1
macOS pre-10.13 support (#264)
* macOS < 10.13: skip log tests for want of fmemopen

There is a dependency on fmemopen in the tests for the logging
functions, which macOS introduced only in version 10.13.  There should
be no other obstacle to building/running/testing on older versions of
macOS.  This commit does the pragmatic thing: remove the dependency and
turns the tests into no-ops in this one case.

Signed-off-by: Erik Boasson <eb@ilities.com>

* Fix macOS clock_gettime_nsec_np availability test

Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-30 09:13:49 +02:00
eboasson
78fc9c2e85
Merge pull request #260 from eboasson/plist-update
parameter list update: properties, fixes, unit tests
2019-09-27 13:32:46 +02:00
Erik Boasson
2289428991 Support optional tail in plist deserialisation
Signed-off-by: Erik Boasson <eb@ilities.com>
2019-09-27 13:12:54 +02:00
Martin Bremmer
bc6ece0bfb Fixed missing-field-initializers clang-4 warnings.
Signed-off-by: Martin Bremmer <martin.bremmer@adlinktech.com>
2019-09-27 10:07:54 +02:00