Skip to content

Commit

Permalink
build: Sync with eclipse-zenoh/zenoh@357945b from 2024-08-28 (#627)
Browse files Browse the repository at this point in the history
* Add z_timestamp_new and tests

* fix clippy warning

* Add z_publisher_set_* methods

* Add missing properties to z_query_reply_options_t

* Add check, null, loan, drop for source info.

* Move z_*_source_info_t, z_entity_global_id_t out from commons

* renamed zc_liveliness_declare_subscriber_options_t -> zc_liveliness_subscriber_options_t;
added zc_liveliness_token_loan function;
added tests for liveliness;

* fmt

* test update

* Add reply_del support

* Add clang-format CI check

* Update codebase with clang-format

* Remove z_query_value

* Fix default congestion_control for z_query_reply_options_t

* Fix default congestion_control for z_query_reply_del_options_t

* Exclude autogenerated files from clang-format

* Add z_publisher_loan_mut

* Add z_reply_err_t and methods

* Add missing properties to z_get_options_t

* Remove publisher set methods

* Add z_reply_replier_id

* chore: Sync Rust toolchain

* Add publisher id getter (#448)

* Add publisher id getter

* Add z_publisher_id to docs/api.rst

* Support recent zenoh (no shm renaming!)

* SHM renaming support

* remove unnecessary .clone() call (#437)

* format tests

* Fix INTERFACE includes (was incorrect when Cargo is generating to custom directory)

* rename z_bytes_encode/decode into z_bytes_serialize/deserialize

* format

* cargo fmt

* Remove unused variable

* more build system fixes

* Fix build with CMAKE_BUILD_TYPE=None

This is the default build type for debhelper (Debian).

* chore: Update artifacts action to v4 (#421)

artifacts actions v3 are deprecated

* Enable releasing from any branch (#456)

* Replace `-rc` with `-pre` and document versioning (#466)

* Update README and specify Rust version (#342)

* Clean up the Markdown format.

Signed-off-by: ChenYing Kuo <[email protected]>

* Specify Rust version in README.

Signed-off-by: ChenYing Kuo <[email protected]>

---------

Signed-off-by: ChenYing Kuo <[email protected]>

* chore: Update artifacts action to v4 (#421)

artifacts actions v3 are deprecated

* build: Sync  with eclipse-zenoh/zenoh@65e5df7 from 2024-06-21 (#468)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@a6d117b from 2024-06-21 (#474)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Align Zenoh (#476)

* build: Sync  with eclipse-zenoh/zenoh@fc18f90 from 2024-06-26 (#477)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@1790d59 from 2024-06-26 (#483)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* simplify transmute mod for easier understanding the code (#472)

* from/into types

* inplace2 for Config

* z_config_default fix

* separating CSlice - unfinished

* slice/string rework unfinshed

* collections unfinished

* collections updated

* clippy fix

* cargo fmt

* copy transmute, only a_c_type kept

* clippy fix

* sample converted

* encoding converted

* EntityGlobalId converted

* sourceInfo updated

* publisher updated

* clippy fix

* queryable updated

* query updated

* reply_error

* querying_subscriber update

* slice_map converted

* string_array updated

* reply updated

* keyexpr updated

* liveliness token updated

* ZBytes updated

* zbytes writer updated

* zbyes reader updated

* ZenohId updated

* zbytesiterator updated

* publication cache updated

* scouting updated

* session updated

* subscriber updated

* owned_matching_listener updated

* closure hello updated

* matching status closure update

* cargo fmt, doc comments corrected

* query channel

* query_channel updated

* query_closure updated

* reply_closure updated

* fifo_handler_reply updated

* response_channel updated

* sample channel updated

* sample closure updated

* sample channel updated

* zenoh_id closure updated

* zmutex updated

* condvar covered

* task covered

* z_owned_shm_t updated

* shm_mut updated

* shm_client updated

* owned_shm_client_list updated

* shm_client_storage updated

* alloc_layout, alloc_result converted

* shm provider update

* alloc alignment converted

* memory layout updated

* chunk alloc resut updated

* rename transmute2 to transmute

* lifetime corrected

* tests fixed, uninit test updated

* lib name restored

* renamed "ctype" to "c_type", like "rust_type"

* write empty on error

* year updated

* regenerated headers wihtout shm

* String names normalization (#495)

* fix string-related function names in docs (#496)

* updated docs after pr #495

* updated docs

* change order of arguments for ..._clone methods to that of zenoh-pico (#497)

* fix_what_am_i_to_str name and docs (#503)

* add encoding tests (#502)

* add encoding tests

* format

* feat: bump zenoh version (#485)

* chore: rebase onto dev/1.0.0

* fix: fix clippy lint

* fix: comment entity_global_id...

* fix: fix comment

* fix: comment eid in the test

* fix: fix test

* fix: fix test

* fix: fix test

* fix: add comment

* build: Sync  with eclipse-zenoh/zenoh@cae8697 from 2024-07-05 (#505)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@6df74c7 from 2024-07-07 (#506)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@12b11ee from 2024-07-08 (#507)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@9e1c4a8 from 2024-07-08 (#509)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* api fixes for compatibility with zenoh-pico (#510)

* api fixes for compatibility with zenoh-pico

* clippy fixes

* remove unneeded enumerators from z_whatami_t

* fix: Rename `bump.bash` to `bump-and-tag.bash`

* feat: Add `version.txt` and infer version in `bump-and-tag.bash`

* fix: Clone repository using actions/checkout

* fix: Don't bump deps when pattern is undefined

* fix: Specify git remote when pushing the tag

* fix: Require `VERSION`in `bump-and-tag.bash`

* fix: Override release tag if it already exists

* fix: Support jq 1.6

ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator.

See: jqlang/jq#1168.

* align api with zenoh-pico (#519)

* remove z_slice_map;
make z_timestamp_new, use id of session and current wall clock time;

* format

* fix tests

* format

* removed z_owned_closure_owned_query_t

* fix: typos of attachment (#478)

* added default encoding for publisher (#520)

* add default enum constants (#521)

* chore: replace log by tracing (#514)

* chore: replace log by tracing

* fix: update Cargo.toml.in

* fix: remove useless dependencies

* fix: fix Cargo.toml.in

* add get is_express option (#522)

* chore: Sync Rust toolchain

* chore: Sync Rust toolchain

* support for enable/disable unstable features via #define

* fmt

* Encoding alignment with Zenoh-rust (#523)

* add z_encoding_set_schema functions (corresponding to zenoh-rust Encoding::with_schema);
add predefined encoding constants;

* docs update

* clippy

* fmt

* fmt

* add zc_config_from_env function (#527)

* readme update to explain how to enable optional features

* move SourceInfo, liveliness, KeyExpr::relation_to and zenoh-ext functionality under unstable feature

* fix: Add step to run cargo build for docs

Some auto generated files (e.g. include/zenoh_opaque.h) are platform
specific so they are git ignored. They contain documentation that should
be published as well, so this step makes sure all the files are in the
checkout before publishing them to readthedocs.io

* propagate options to cmake find_package (#531)

* propagate options to cmake find_package

* output feature variables

* Pre release SHM

* Fix SHM config key and examples

* Revert Cargo.toml change

* Fix examples

* - do not trigger error if SHARED_MEMORY enabled without UNSTABLE
- fix clippy
- review fixes

* remove redundant compile definitions (#534)

* Address review comments

* Add SHM config to z_sub_thr

* remove redundant compile definitions (#534)

* align with recent zenoh

* unstable is not default

* Fix z_pub_shm_thr. Fix shm API.

* Adopt keyexpr tests for new behavior

* Add check in z_pub_shm_thr

* Add z_bytes_serialize_from_shm check in examples

* Rename z_error_t to z_result_t

* Rename errors.rs to result.rs

* no longer use cpp, awk and sed for cbindgen output processing

* typo fix

* Address review comments

* refactor features usage

* fix docs

* add SHM examples

* build: Sync  with eclipse-zenoh/zenoh@4827f39 from 2024-07-24 (#540)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* typo fix (how did that compile????)

* Ensure that find_package(zenohc) can be called two times (#470)

* Update CMakeLists.txt (#473)

* Install zenohc.dll in <prefix>/bin on Windows (#471)

* Fix shm doc

* fix cbindgen in ptr to const ptr case

* Align SHM examples

* don't need this

* build: Sync  with eclipse-zenoh/zenoh@0c43c08 from 2024-07-25 (#547)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Remove legacy slice methods

* build: Sync  with eclipse-zenoh/zenoh@32bdded from 2024-07-26 (#550)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* simplify tests and examples with attachment

* address review comments

* build: Sync  with eclipse-zenoh/zenoh@502d3be from 2024-07-30 (#558)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix queryable examples to account for an empty payload

* Update dependencies to have 1.80 build

* Allow providing custom delete function when serializing from pointers (#554)

* remove z_serialize_xxx_copy;
z_serialize_from_slice now consumes z_owned_slice_t;
z_serialize_from_str is renamed into z_serialize_from_string and is now consuming z_owned_string_t
introduce z_serialize_from_buf/from_str allowing to consume raw pointers by taking custom delete function;

* format

* clippy

* add support for creating string/slice with custom deleter;
align serialization functions;

* intorduce z_bytes_from_static_str and z_bytes_from_static_buf

* rename slice/string constructors according to zenoh-pico review comments

* build: Sync  with eclipse-zenoh/zenoh@5d09cf7 from 2024-08-01 (#562)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build fix after cargo.lock update (#564)

* - add z_byte_writer_write_all
- z_byte_writer_write now has interface that intends that it can write not all

* add  doxygenfunction:: z_bytes_writer_write_all

* change output parameter position

* Rename `close` to `undeclare` for Publication Cache and Querying Subscriber

* Temporarily use original pull request branch

* Update to eclipse-zenoh/zenoh@ce4e9bf

* Fix `z_ref_shm_client_storage_global`

* Update Cargo.toml

* leave only z_bytes_writer_write_all

* Kick CI

* Kick CI

* log error messages when failing to manipulate the config (#563)

* generate panic messages only if explicitly asked (#569)

* generate panic messages only if explicitly asked

* doc comments restored

* remove unnecessary build artifacts (#571)

* build: Sync  with eclipse-zenoh/zenoh@b1e4dba from 2024-08-05 (#573)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@b7d42ef from 2024-08-06 (#574)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@2d5ab7c from 2024-08-06 (#575)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* z_recv/z_try_recv without the need of z_check (#570)

* make z_recv/z_try_recv return z_result_t to allow differentiating between different cases without the need to call z_check on constructed object

* format

* Logging (#580)

* renamed zc_init_logger -> zc_init_logging;
added support for providing custom callbacks for logging messages;

* format

* clippy

* add missing dependency

* z_bytes_reader and z_bytes_writer update (#583)

* made z_bytes_writer non-owned;
added z_bytes_writer_append(...) and z_bytes_writer append_bounded(...) (aka writer.serialize());
added z_bytes_reader_read_bounded(...);

* fix initializer

* fix initializer

* rename zc_publisher_matching_listener_callback -> zc_publisher_matching_listener_declare; (#581)

added zc_publisher_get_matching_status;

* docs: fix doxygen (#578)

* chore: ignore docs/doxyxml

* docs: update the README of doxygen

* docs: fix the warnings

* docs: remove the unnecessary step in macOS

* chore: address the review comment

* add valgrind memory leaks check (#584)

* added pub sub test for memory leaks

* added valgrind test

* format

* ci fix

* ci fix

* add queryable-get memory leaks test

* do not copy memory leaks script

* fixed memory leak in handlers

* docs update

* format

* format

* attempt to address ci no more space issue (#585)

* attempt to address ci no more space issue

* remove env settings

* add CARGO_PROFILE_DEV_DEBUG=false

* Move protection (#488)

* macro generation

* moved types added to decl

* moved type drop

* switched rust to z_moved

* moved closures

* build macros fixed

* z_move name restored

* into_rust_type for moved, payloads

* tests updated

* cargo fmt

* moved structs in some drops/undeclares

* moved as separate parameter

* removed asref from moved

* moved unfinished

* moved type with into_rust_type trait, comiles without shm

* build with shm passed

* option added to some decl_c_type

* clippy fix

* build fix

* moved types added

* task moved used

* some examples fixes

* macros corrected to use auto derive loaned type from owned feature

* optional comma allowed in macros where forgotten

* property moved get

* put options move

* publisher delete options made simpler

* put options with moved

* delete options timestamp simplified

* more moved in options, timestamp simplified

* examples,tests updated

* tests compile fixes

* fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory

* cargo fmt imports

* build fixes

* some xompile errors fixed

* some build errors fixed

* some build errors fixed

* build fixes

* cargo fmt

* into_rust_type usage fixes

* encoding drop fixed

* restored headers

* zcu renamed back to zc

* zcu renamed back to zc

* z_xxx_move is static inline, cpp fixes

* clang format from start

* cargo fmt

* macros contains funcions now, it needs types defined

* removed zenoh_macros include

* zenoh_macros include returned back to place

* C++ build test added, fails for now

* C++ enabling correction

* C++ compilation for tests added

* C++ build test

* cargo lock update

* retrun value if not void from template functions

* cargo fmt

* build fixes

* build fix after cargo.lock update

* moved types for buffer creation functions

* clippy fix

* clippy fix: c_char can be i8 or u8 depending on platform

* headers restored

* cargo fmt

* -c c++ flag for clang only

* c++ build fix - brackets removed

* type specific take functions added, _ptr in moved

* generic_take_cpp

* z_take impls at the end

* take funcs before generics

* take moved after null

* names fix

* missing null functioj added

* tests fixed for c++

* explicit null calls

* fix generic parameter names c compilation

* null call fix

* misprint fixed

* return removed

* Rename `close` to `undeclare` for Publication Cache and Querying Subscriber

* Temporarily use original pull request branch

* Update to eclipse-zenoh/zenoh@ce4e9bf

* Fix `z_ref_shm_client_storage_global`

* Update Cargo.toml

* build fixes

* zc_ prefix for log function

* zc_ prefix in example

* regenerated files

* cargo fmt

* undeclare as drop

* removed _undeclare parsing

* missing drop/check funcs added. verification added to build.rs

* cargo fmt

* tests fix

* test fix

* cmake fix

* null drop test same as in pico, take corrected

---------

Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Luca Cominardi <[email protected]>

* fix: use `z_move` in shm examples (#589)

* fix tests and examples for SHM (#592)

* SHM is now enabled by default in the Config, so no need to set it explicitly in examples

* build: Sync  with eclipse-zenoh/zenoh@0e2f78a from 2024-08-14 (#596)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* update zenoh

* fix clang

* dropper autogeneration

* dropper type

* unfinished - into_rust_type approach failed

* compiles

* compile with all features

* drop functions updated

* "this" parameter name globally renamed to this_ to avoid using C++ keyword

* compile fix

* generic functions update

* drop generic fix

* clippy fix

* cargo fmt

* headers updated

* cargo fmt fix

* check in build.rs restored

* fix: misuse the callback in z_info

* chore: Bump version to `1.0.0.0`

* chore: Bump libzenohc-dev version to `1.0.0~dev-1`

* chore: Bump `/zenoh.*/` dependencies to `1.0.0-dev`

* chore: Update Cargo.lock to `1.0.0-dev`

* chore: Bump build-resources/opaque-types version to `1.0.0-dev`

* merge main branch into dev/1.0.0 (after "moved_as_ptr" update) (#600)

* fix: Rename `bump.bash` to `bump-and-tag.bash`

* feat: Add `version.txt` and infer version in `bump-and-tag.bash`

* fix: Clone repository using actions/checkout

* fix: Add `CMakeFiles` to `.gitignore`

* fix: Add `debug` and `release` to `.gitignore`

* fix: Provide default release number for testing

* fix: Don't bump deps when pattern is undefined

* fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t

* build: Sync  with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix: Specify git remote when pushing the tag

* fix: Require `VERSION`in `bump-and-tag.bash`

* fix: Override release tag if it already exists

* feat(tracing): using tracing and zenoh-util init_log (#308)

* feat(tracing): using tracing and zenoh-util init_log

Signed-off-by: gabrik <[email protected]>

* chore: adding Cargo.lock

Signed-off-by: gabrik <[email protected]>

* chore: updated Cargo.toml.in

Signed-off-by: gabrik <[email protected]>

* feat(tracing): using zenoh main branch

Signed-off-by: gabrik <[email protected]>

---------

Signed-off-by: gabrik <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix: Support jq 1.6

ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator.

See: jqlang/jq#1168.

* chore: using new try_init_log_from_env

Signed-off-by: gabrik <[email protected]>

* Align examples and remove reading from stdin (#255)

* Remove reading from stdin, align example implementations

* Add argument parsing implementation for examples

* Add argument parsing to examples, format files

* Replace getchar with sleep in z_pong example

* Fix typo in include

* Use null-pointers instead of empty strings, remove unnecessary mallocs

* Free returned pointer after parse_pos_args usage

* Add common and positional args parsing to z_ping example

* Add formatting for parsed config options

* Add const to function parameters

* Update mode option help

* Fix pos_args memory leak

* Refactor parse_args, remove possible strcpy buffer overflow

* Change parse_args function returns to const where applicable

* Fix const initialization warning

* Remove redundant const for value parameters

* Fix buf variable memory leak

* Update insert json-list config error message

* Add usage example for -e and -l arguments in help

* Update example notation in help message

Co-authored-by: Alexander <[email protected]>

* Update example notation in help message (2/2)

* Fix parameter in error message

Co-authored-by: Alexander <[email protected]>

---------

Co-authored-by: Alexander <[email protected]>

* Bugfix: Unable to build z_queryable_with_channels.c (#340)

Signed-off-by: ChenYing Kuo <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update README and specify Rust version (#342)

* Clean up the Markdown format.

Signed-off-by: ChenYing Kuo <[email protected]>

* Specify Rust version in README.

Signed-off-by: ChenYing Kuo <[email protected]>

---------

Signed-off-by: ChenYing Kuo <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Fix build with CMAKE_BUILD_TYPE=None

This is the default build type for debhelper (Debian).

* build: Sync  with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* chore: Update artifacts action to v4 (#421)

artifacts actions v3 are deprecated

* build: Sync  with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Enable releasing from any branch (#456)

* build: Sync  with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update to latest zenoh

* Replace `-rc` with `-pre` and document versioning (#466)

* build: Sync  with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* macro generation

* moved types added to decl

* moved type drop

* switched rust to z_moved

* moved closures

* build macros fixed

* z_move name restored

* into_rust_type for moved, payloads

* tests updated

* cargo fmt

* moved structs in some drops/undeclares

* moved as separate parameter

* removed asref from moved

* moved unfinished

* build: Sync  with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* moved type with into_rust_type trait, comiles without shm

* build with shm passed

* option added to some decl_c_type

* clippy fix

* build fix

* moved types added

* task moved used

* build: Sync  with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* some examples fixes

* macros corrected to use auto derive loaned type from owned feature

* optional comma allowed in macros where forgotten

* property moved get

* put options move

* publisher delete options made simpler

* put options with moved

* delete options timestamp simplified

* more moved in options, timestamp simplified

* examples,tests updated

* tests compile fixes

* fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory

* cargo fmt imports

* build fixes

* build: Sync  with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Ensure that find_package(zenohc) can be called two times (#470)

* Update CMakeLists.txt (#473)

* Install zenohc.dll in <prefix>/bin on Windows (#471)

* build: Sync  with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* some xompile errors fixed

* some build errors fixed

* some build errors fixed

* build fixes

* cargo fmt

* into_rust_type usage fixes

* encoding drop fixed

* restored headers

* zcu renamed back to zc

* zcu renamed back to zc

* z_xxx_move is static inline, cpp fixes

* build: Sync  with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* clang format from start

* cargo fmt

* macros contains funcions now, it needs types defined

* removed zenoh_macros include

* zenoh_macros include returned back to place

* C++ build test added, fails for now

* C++ enabling correction

* C++ compilation for tests added

* C++ build test

* cargo lock update

* retrun value if not void from template functions

* cargo fmt

* build fixes

* build fix after cargo.lock update

* moved types for buffer creation functions

* clippy fix

* clippy fix: c_char can be i8 or u8 depending on platform

* headers restored

* cargo fmt

* -c c++ flag for clang only

* c++ build fix - brackets removed

* type specific take functions added, _ptr in moved

* generic_take_cpp

* z_take impls at the end

* take funcs before generics

* take moved after null

* names fix

* missing null functioj added

* tests fixed for c++

* explicit null calls

* fix generic parameter names c compilation

* null call fix

* misprint fixed

* return removed

* Rename `close` to `undeclare` for Publication Cache and Querying Subscriber

* Temporarily use original pull request branch

* Update to eclipse-zenoh/zenoh@ce4e9bf

* Fix `z_ref_shm_client_storage_global`

* Update Cargo.toml

* decl_c_type corrected

* cargo check run

* borrow error fix

* compilation fix

* parse arg fix

* example compilation fix

* examples compile fix

* examples build fixes

* removed duplicated z_config_default (it's called in parsing args later)

* clang format

* clang format

* cargo.toml restore

---------

Signed-off-by: gabrik <[email protected]>
Signed-off-by: ChenYing Kuo <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Denis Biryukov <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Gabriele Baldoni <[email protected]>
Co-authored-by: gabrik <[email protected]>
Co-authored-by: oteffahi <[email protected]>
Co-authored-by: Alexander <[email protected]>
Co-authored-by: ChenYing Kuo (CY) <[email protected]>
Co-authored-by: Jochen Sprickerhof <[email protected]>
Co-authored-by: Diogo Matsubara <[email protected]>
Co-authored-by: OlivierHecart <[email protected]>
Co-authored-by: Silvio Traversaro <[email protected]>
Co-authored-by: Luca Cominardi <[email protected]>

* `z_check` and `z_null` made internal (#605)

* fix: Rename `bump.bash` to `bump-and-tag.bash`

* feat: Add `version.txt` and infer version in `bump-and-tag.bash`

* fix: Clone repository using actions/checkout

* fix: Add `CMakeFiles` to `.gitignore`

* fix: Add `debug` and `release` to `.gitignore`

* fix: Provide default release number for testing

* fix: Don't bump deps when pattern is undefined

* fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t

* build: Sync  with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix: Specify git remote when pushing the tag

* fix: Require `VERSION`in `bump-and-tag.bash`

* fix: Override release tag if it already exists

* feat(tracing): using tracing and zenoh-util init_log (#308)

* feat(tracing): using tracing and zenoh-util init_log

Signed-off-by: gabrik <[email protected]>

* chore: adding Cargo.lock

Signed-off-by: gabrik <[email protected]>

* chore: updated Cargo.toml.in

Signed-off-by: gabrik <[email protected]>

* feat(tracing): using zenoh main branch

Signed-off-by: gabrik <[email protected]>

---------

Signed-off-by: gabrik <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* fix: Support jq 1.6

ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator.

See: jqlang/jq#1168.

* chore: using new try_init_log_from_env

Signed-off-by: gabrik <[email protected]>

* Align examples and remove reading from stdin (#255)

* Remove reading from stdin, align example implementations

* Add argument parsing implementation for examples

* Add argument parsing to examples, format files

* Replace getchar with sleep in z_pong example

* Fix typo in include

* Use null-pointers instead of empty strings, remove unnecessary mallocs

* Free returned pointer after parse_pos_args usage

* Add common and positional args parsing to z_ping example

* Add formatting for parsed config options

* Add const to function parameters

* Update mode option help

* Fix pos_args memory leak

* Refactor parse_args, remove possible strcpy buffer overflow

* Change parse_args function returns to const where applicable

* Fix const initialization warning

* Remove redundant const for value parameters

* Fix buf variable memory leak

* Update insert json-list config error message

* Add usage example for -e and -l arguments in help

* Update example notation in help message

Co-authored-by: Alexander <[email protected]>

* Update example notation in help message (2/2)

* Fix parameter in error message

Co-authored-by: Alexander <[email protected]>

---------

Co-authored-by: Alexander <[email protected]>

* Bugfix: Unable to build z_queryable_with_channels.c (#340)

Signed-off-by: ChenYing Kuo <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update README and specify Rust version (#342)

* Clean up the Markdown format.

Signed-off-by: ChenYing Kuo <[email protected]>

* Specify Rust version in README.

Signed-off-by: ChenYing Kuo <[email protected]>

---------

Signed-off-by: ChenYing Kuo <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Fix build with CMAKE_BUILD_TYPE=None

This is the default build type for debhelper (Debian).

* build: Sync  with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* chore: Update artifacts action to v4 (#421)

artifacts actions v3 are deprecated

* build: Sync  with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Enable releasing from any branch (#456)

* build: Sync  with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Update to latest zenoh

* Replace `-rc` with `-pre` and document versioning (#466)

* build: Sync  with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* macro generation

* moved types added to decl

* moved type drop

* switched rust to z_moved

* moved closures

* build macros fixed

* z_move name restored

* into_rust_type for moved, payloads

* tests updated

* cargo fmt

* moved structs in some drops/undeclares

* moved as separate parameter

* removed asref from moved

* moved unfinished

* build: Sync  with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* moved type with into_rust_type trait, comiles without shm

* build with shm passed

* option added to some decl_c_type

* clippy fix

* build fix

* moved types added

* task moved used

* build: Sync  with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* some examples fixes

* macros corrected to use auto derive loaned type from owned feature

* optional comma allowed in macros where forgotten

* property moved get

* put options move

* publisher delete options made simpler

* put options with moved

* delete options timestamp simplified

* more moved in options, timestamp simplified

* examples,tests updated

* tests compile fixes

* fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory

* cargo fmt imports

* build fixes

* build: Sync  with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* Ensure that find_package(zenohc) can be called two times (#470)

* Update CMakeLists.txt (#473)

* Install zenohc.dll in <prefix>/bin on Windows (#471)

* build: Sync  with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* build: Sync  with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* some xompile errors fixed

* some build errors fixed

* some build errors fixed

* build fixes

* cargo fmt

* into_rust_type usage fixes

* encoding drop fixed

* restored headers

* zcu renamed back to zc

* zcu renamed back to zc

* z_xxx_move is static inline, cpp fixes

* build: Sync  with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* clang format from start

* cargo fmt

* macros contains funcions now, it needs types defined

* removed zenoh_macros include

* zenoh_macros include returned back to place

* C++ build test added, fails for now

* C++ enabling correction

* C++ compilation for tests added

* C++ build test

* cargo lock update

* retrun value if not void from template functions

* cargo fmt

* build fixes

* build fix after cargo.lock update

* moved types for buffer creation functions

* clippy fix

* clippy fix: c_char can be i8 or u8 depending on platform

* headers restored

* cargo fmt

* -c c++ flag for clang only

* c++ build fix - brackets removed

* type specific take functions added, _ptr in moved

* generic_take_cpp

* z_take impls at the end

* take funcs before generics

* take moved after null

* names fix

* missing null functioj added

* tests fixed for c++

* explicit null calls

* fix generic parameter names c compilation

* null call fix

* misprint fixed

* return removed

* Rename `close` to `undeclare` for Publication Cache and Querying Subscriber

* Temporarily use original pull request branch

* Update to eclipse-zenoh/zenoh@ce4e9bf

* Fix `z_ref_shm_client_storage_global`

* Update Cargo.toml

* decl_c_type corrected

* cargo check run

* borrow error fix

* compilation fix

* parse arg fix

* example compilation fix

* examples compile fix

* examples build fixes

* removed duplicated z_config_default (it's called in parsing args later)

* clang format

* clang format

* cargo.toml restore

* added underscore to _z_null and _z_check

* missing functions updated

* rename to z_internal_null/check

* clang format fix

* restored headers, corrected cargo.toml

---------

Signed-off-by: gabrik <[email protected]>
Signed-off-by: ChenYing Kuo <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Denis Biryukov <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Gabriele Baldoni <[email protected]>
Co-authored-by: gabrik <[email protected]>
Co-authored-by: oteffahi <[email protected]>
Co-authored-by: Alexander <[email protected]>
Co-authored-by: ChenYing Kuo (CY) <[email protected]>
Co-authored-by: Jochen Sprickerhof <[email protected]>
Co-authored-by: Diogo Matsubara <[email protected]>
Co-authored-by: OlivierHecart <[email protected]>
Co-authored-by: Silvio Traversaro <[email protected]>
Co-authored-by: Luca Cominardi <[email protected]>

* made reliability option unstable (#612)

* Update api.rst (#613)

* Adopt SHM for recent API changes (#615)

* Ensure build directory contains a copy of rust-toolchain.toml.

When building using cargo's --manifest-path option the toolchain configuration file within the manifest directory is ignored. Ensuring a copy of the rust-toolchain.toml file is in the build directory ensures the toolchain settings are pciked up when building via cmake.

* Shm ci (#593)

* fix tests and examples for SHM

* Add feature tests in CI

* Adopt SHM for recent API changes

* Update ci.yml and CMakeLists.txt

* fix build for windows

* build in separate directory failure fix (#617)

* test for build in separate directory

* builds dir from ci variable

* using CI_PROJECT_DIR variable

* relarive build examples

* updated "time" version, suppressed "unused trait" warnings

* build: Sync  with eclipse-zenoh/zenoh@8b027e9 from 2024-08-22 (#619)

Co-authored-by: eclipse-zenoh-bot <[email protected]>

* cargo.lock update

* fix: properly apply `z_get_options_t` in `ze_querying_subscriber_get` (#621)

* Revert "Merge dev1.0.0 into main"

* merging error fix

* build: Sync Cargo lockfile with Zenoh's

---------

Signed-off-by: ChenYing Kuo <[email protected]>
Signed-off-by: gabrik <[email protected]>
Co-authored-by: Alexander Bushnev <[email protected]>
Co-authored-by: yellowhatter <[email protected]>
Co-authored-by: Michael Ilyin <[email protected]>
Co-authored-by: Denis Biryukov <[email protected]>
Co-authored-by: eclipse-zenoh-bot <[email protected]>
Co-authored-by: yellowhatter <[email protected]>
Co-authored-by: Jochen Sprickerhof <[email protected]>
Co-authored-by: Diogo Matsubara <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: ChenYing Kuo (CY) <[email protected]>
Co-authored-by: Luca Cominardi <[email protected]>
Co-authored-by: DenisBiryukov91 <[email protected]>
Co-authored-by: Joseph Perez <[email protected]>
Co-authored-by: Mahmoud Mazouz <[email protected]>
Co-authored-by: Yuyuan Yuan <[email protected]>
Co-authored-by: Diogo Mendes Matsubara <[email protected]>
Co-authored-by: Silvio Traversaro <[email protected]>
Co-authored-by: Gabriele Baldoni <[email protected]>
Co-authored-by: gabrik <[email protected]>
Co-authored-by: oteffahi <[email protected]>
Co-authored-by: Alexander <[email protected]>
Co-authored-by: OlivierHecart <[email protected]>
Co-authored-by: Geoff Martin <[email protected]>
  • Loading branch information
24 people authored Aug 29, 2024
1 parent 134dbfa commit 79b4468
Show file tree
Hide file tree
Showing 147 changed files with 28,605 additions and 9,026 deletions.
50 changes: 40 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,30 @@ on:
schedule:
- cron: "0 6 * * 1-5"

env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_PROFILE_DEV_DEBUG: false

jobs:
check_format:
name: Check codebase format with clang-format
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run clang-format dry-run
run: find include/ src/ tests/ examples/ -iname "*.h" -o -iname "*.c" | xargs clang-format -n -Werror

build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
shm: [false, true]
unstable: [false, true]

steps:
- uses: actions/checkout@v4
Expand All @@ -27,7 +43,7 @@ jobs:
run: cargo clippy --all-targets --all-features -- --deny warnings

- name: Run rustfmt
run: cargo fmt --check
run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"

- name: Check for feature leaks
run: cargo test --no-default-features
Expand All @@ -36,22 +52,33 @@ jobs:
shell: bash
run: |
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }}
cmake --build . --target install --config Release
- name: Install valgrind
uses: taiki-e/install-action@valgrind
if: matrix.os == 'ubuntu-latest'

- name: Run cmake tests with zenoh-c as dynamic library
shell: bash
run: |
cd build
cmake .. -DZENOHC_LIB_STATIC=FALSE -DCMAKE_BUILD_TYPE=Release
cmake .. -DZENOHC_LIB_STATIC=FALSE -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }}
cmake --build . --target tests --config Release
ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_static)"
- name: Build cmake tests with C++ compiler to make sure that C API is C++ compatible
shell: bash
run: |
cd build
cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Debug -DZENOHC_BUILD_TESTS_WITH_CXX=TRUE -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }}
cmake --build . --target tests --config Debug
- name: Run cmake tests with zenoh-c as static library
shell: bash
run: |
cd build
cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Release
cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }}
cmake --build . --target tests --config Release
ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_shared)"
Expand All @@ -61,24 +88,27 @@ jobs:
cd build
cmake --build . --target examples
- name: Build examples with zenoh-c as subbroject and static library and in debug mode
- name: Build examples with zenoh-c as subbroject and static library and in debug mode and in separate directory
shell: bash
run: |
mkdir -p build_examples_subproj && cd build_examples_subproj
cmake ../examples -DCMAKE_BUILD_TYPE=Debug -DZENOHC_LIB_STATIC=TRUE
cmake --build . --config Debug
mkdir -p ../build_examples
cmake -S examples -B ../build_examples -DCMAKE_BUILD_TYPE=Debug -DZENOHC_LIB_STATIC=TRUE
cmake --build ../build_examples --config Debug
rm -rf ../build_examples
- name: Build examples with zenoh-c as installed package
shell: bash
run: |
mkdir -p build_examples_findproj && cd build_examples_findproj
mkdir -p build_examples && cd build_examples
cmake ../examples -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHC_SOURCE=PACKAGE
cmake --build . --config Release
cd .. && rm -rf build_examples
- name: Run rust tests
run: cargo test --verbose --release --features=logger-autoinit --features=shared-memory
run: cargo test --verbose --release --features=logger-autoinit

- name: Upload artifact
if: ${{ matrix.unstable == 'false' && matrix.shm == 'false' }}
uses: actions/upload-artifact@v4
with:
# Artifact name
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ dkms.conf

# Platform dependent generated files
include/zenoh_configure.h
include/zenoh_opaque.h

# Build resources
.build_resources*
src/opaque_types/mod.rs

# CMake
CMakeFiles/
debug/
release/
release/
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright (c) 2024 ZettaScale Technology
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# ZettaScale Zenoh Team, <[email protected]>
#
repos:
- repo: local
hooks:
- id: fmt
name: fmt
entry: cargo fmt -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate"
language: system
types: [rust]
8 changes: 8 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ build:
os: ubuntu-22.04
tools:
python: "3.11"
rust: "1.75"
apt_packages:
- cargo
jobs:
# Run cargo build to build git ignored files that are platform specific (e.g. include/zenoh_opaque.h)
pre_build:
- cargo build --release --manifest-path=./Cargo.toml --features=logger-autoinit --features=unstable --features=shared-memory


# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
31 changes: 27 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(
VERSION ${version}
DESCRIPTION "The C bindings for Zenoh"
HOMEPAGE_URL "https://github.com/eclipse-zenoh/zenoh-c"
LANGUAGES C
LANGUAGES C CXX
)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
Expand All @@ -28,7 +28,9 @@ enable_testing()
#
declare_cache_var_true_if_vscode(ZENOHC_BUILD_IN_SOURCE_TREE "Do build inside source tree")
declare_cache_var(ZENOHC_BUILD_WITH_LOGGER_AUTOINIT TRUE BOOL "Enable logger-autoinit zenoh-c feature")
declare_cache_var(ZENOHC_BUILD_WITH_SHARED_MEMORY TRUE BOOL "Enable shared-memory zenoh-c feature")
declare_cache_var(ZENOHC_BUILD_WITH_SHARED_MEMORY FALSE BOOL "Enable shared-memory zenoh-c feature")
declare_cache_var(ZENOHC_BUILD_WITH_UNSTABLE_API TRUE BOOL "Enable unstable API feature")
declare_cache_var(ZENOHC_BUILD_TESTS_WITH_CXX FALSE BOOL "Use C++ compiler for building tests to check API's C++ compatibility")
declare_cache_var(ZENOHC_CUSTOM_TARGET "" STRING "Rust target for cross compilation, 'aarch64-unknown-linux-gnu' for example")
declare_cache_var(ZENOHC_CARGO_CHANNEL "" STRING "Cargo channel parameter. Should be '+stable', '+nightly' or empty value")
declare_cache_var(ZENOHC_CARGO_FLAGS "" STRING "Additional cargo flags")
Expand Down Expand Up @@ -115,6 +117,11 @@ function(configure_cargo_toml cargo_toml_dir CARGO_PROJECT_VERSION CARGO_LIB_NAM
${CMAKE_CURRENT_SOURCE_DIR}/Cargo.lock
${CMAKE_CURRENT_SOURCE_DIR}/rust-toolchain.toml
DESTINATION ${cargo_toml_dir})
file(COPY
${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh.h
${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh_memory.h
${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh_constants.h
DESTINATION ${cargo_toml_dir}/include/)
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml.in" "${cargo_toml_dir}/Cargo.toml" @ONLY)
endfunction()
Expand Down Expand Up @@ -142,6 +149,16 @@ else()
configure_cargo_toml(${cargo_toml_dir_release} ${project_version} ${cargo_lib_name_release})
endif()

#
# Copy toolchain configuration to build directory to ensure it is used when cargo is invoked from a directory other
# than the directory containing the manifest file
#
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/rust-toolchain.toml")
file(COPY
${CMAKE_CURRENT_SOURCE_DIR}/rust-toolchain.toml
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()

#
# Configure result library names
#
Expand Down Expand Up @@ -191,6 +208,11 @@ if(ZENOHC_BUILD_WITH_SHARED_MEMORY)
set(cargo_flags ${cargo_flags} --features=shared-memory)
endif()

if(ZENOHC_BUILD_WITH_UNSTABLE_API)
set(cargo_flags ${cargo_flags} --features=unstable)
endif()


if(NOT(ZENOHC_CUSTOM_TARGET STREQUAL ""))
set(cargo_flags ${cargo_flags} --target=${ZENOHC_CUSTOM_TARGET})
endif()
Expand Down Expand Up @@ -270,12 +292,13 @@ endif()
# Define include directories for library targets
status_print(source_include_dir)
status_print(cargo_generated_include_dir)
target_include_directories(zenohc_static INTERFACE ${source_include_dir})
target_include_directories(zenohc_shared INTERFACE ${source_include_dir})

if(NOT(cargo_generated_include_dir STREQUAL ${source_include_dir}))
target_include_directories(zenohc_static INTERFACE ${cargo_generated_include_dir})
target_include_directories(zenohc_shared INTERFACE ${cargo_generated_include_dir})
else()
target_include_directories(zenohc_static INTERFACE ${source_include_dir})
target_include_directories(zenohc_shared INTERFACE ${source_include_dir})
endif()

set_target_properties(zenohc_shared zenohc_static PROPERTIES IMPORTED_GLOBAL TRUE)
Expand Down
Loading

0 comments on commit 79b4468

Please sign in to comment.