Skip to content

Commit

Permalink
Merge branch 'eclipse-iceoryx:main' into iox-#2330-add_notify_systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
khromenokroman authored Sep 1, 2024
2 parents ef310cb + 9f7a966 commit a5f4534
Show file tree
Hide file tree
Showing 198 changed files with 1,172 additions and 934 deletions.
1 change: 1 addition & 0 deletions .cirrus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ preflight_check_task:
clang_format_script: tools/scripts/clang_format.sh check
check_test_ids_script: tools/scripts/check_test_ids.sh
check_invalid_characters_script: tools/scripts/check_invalid_characters.sh
check_atomic_usage: tools/scripts/check_atomic_usage.sh
cmake_linter_script: tools/ci/cmake-linter.sh

#
Expand Down
2 changes: 2 additions & 0 deletions .github/actions/install-iceoryx-deps-and-clang/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ runs:
- name: Install iceoryx dependencies and clang-tidy
shell: bash
run: |
sudo dpkg --add-architecture i386
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
sudo apt-get update
sudo apt-get install -y libacl1-dev libncurses5-dev
sudo apt-get install -y libacl1-dev:i386 libc6-dev-i386 libc6-dev-i386-cross libstdc++6-i386-cross gcc-multilib g++-multilib
sudo apt-get install -y clang-format-15 clang-tidy-15 clang-tools-15 clang-15 lld
sudo rm /usr/bin/clang
sudo rm /usr/bin/clang++
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- run: ./tools/scripts/clang_format.sh check
- run: ./tools/scripts/check_test_ids.sh
- run: ./tools/scripts/check_invalid_characters.sh
- run: ./tools/scripts/check_atomic_usage.sh
- run: ./tools/ci/cmake-linter.sh

check-status-of-nightly-action:
Expand Down Expand Up @@ -54,17 +55,24 @@ jobs:
runs-on: ubuntu-20.04
needs: pre-flight-check
steps:
- uses: actions/checkout@v4
- uses: egor-tensin/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- name: Setup GCC
uses: egor-tensin/[email protected]
with:
# gcc 8.3 is compiler used in QNX 7.1
version: 8
platform: x64
- uses: jwlawson/[email protected]
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.3' # version used in Ubuntu 20.04 LTS
- run: ./tools/ci/build-test-ubuntu.sh



build-test-windows-msvc:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
Expand Down Expand Up @@ -171,6 +179,18 @@ jobs:
- name: Run Thread Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang tsan

build-test-ubuntu-32-bit:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- run: ./tools/ci/build-test-ubuntu.sh 32-bit-x86

# Bazel sanity check
build-test-ubuntu-bazel:
# prevent stuck jobs consuming runners for 6 hours
Expand Down
38 changes: 19 additions & 19 deletions doc/design/listener.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,22 @@ which event is attached, like in the _WaitSet_.
| - m_toBeDestroyed |
| - m_activeNotifications |
+---------------------------+
| 1 | 1
| |
| 1 | n
+-----------------------------------------------+ +--------------------------------------------------+
| ConditionListener | | ConditionNotifier |
| ConditionListener(ConditionVariableData & ) | | ConditionNotifier(ConditionVariableData &, |
| | | uint64_t notificationIndex) |
| bool wasNotified() | | |
| void destroy() | | void notify() |
| NotificationVector_t wait() | | |
| NotificationVector_t timedWait() | | - m_condVarDataPtr : ConditionVariableData* |
| | | - m_notificationIndex |
| - m_condVarDataPtr : ConditionVariableData* | +--------------------------------------------------+
| - m_toBeDestroyed : std::atomic_bool | | 1
+-----------------------------------------------+ |
| 1 | n
| 1 | 1
| |
| 1 | n
+------------------------------------------------------+ +--------------------------------------------------+
| ConditionListener | | ConditionNotifier |
| ConditionListener(ConditionVariableData & ) | | ConditionNotifier(ConditionVariableData &, |
| | | uint64_t notificationIndex) |
| bool wasNotified() | | |
| void destroy() | | void notify() |
| NotificationVector_t wait() | | |
| NotificationVector_t timedWait() | | - m_condVarDataPtr : ConditionVariableData* |
| | | - m_notificationIndex |
| - m_condVarDataPtr : ConditionVariableData* | +--------------------------------------------------+
| - m_toBeDestroyed : iox::concurrent::Atomic<bool> | | 1
+------------------------------------------------------+ |
| 1 | n
| +--------------------------------+
| 1 | TriggerHandle |
+-------------------------------------------------+ | bool isValid() |
Expand Down Expand Up @@ -171,8 +171,8 @@ Triggerable TriggerHandle ConditionNotifier ConditionListener
| | | | | m_events[notificationId] |
```

- **Triggerable goes out of scope:** The TriggerHandle is a member of the
Triggerable, therefore the d'tor of the TriggerHandle is called which removes
- **Triggerable goes out of scope:** The TriggerHandle is a member of the
Triggerable, therefore the d'tor of the TriggerHandle is called which removes
the trigger from the Listener via the `resetCallback`

```
Expand All @@ -183,7 +183,7 @@ Triggerable TriggerHandle Listener Event_t
| | via resetCallback | ------------> |
```

- **Listener goes out of scope:** The d'tor of the `Event_t` invalidates the
- **Listener goes out of scope:** The d'tor of the `Event_t` invalidates the
Trigger inside the Triggerable via the `invalidationCallback`

```
Expand Down
2 changes: 1 addition & 1 deletion doc/design/relocatable_pointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ the operations incur slightly more overhead compared to relocatable pointers.

## Atomic usage

There is a technical problem using both `relocatable_ptr` and `RelativePointer` as a type in a `std::atomic`.
There is a technical problem using both `relocatable_ptr` and `RelativePointer` as a type in a `iox::concurrent::Atomic`.
This is essentially impossible as an atomic requires its type to be copyable/movable (to be loaded) but on the other hand,
this copy constructor must be trivial, i.e. performable with a (shallow) memcpy. Therefore, the types used in atomic cannot implement
custom copy/move. This is not possible for `relocatable_ptr` and `RelativePointer` as both require operations performed
Expand Down
7 changes: 7 additions & 0 deletions doc/website/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ You will need to install the following packages:
sudo apt install gcc g++ cmake libacl1-dev libncurses5-dev pkg-config
```

To build iceoryx as 32-bit library, the following packages need to be installed additionally:

```bash
sudo dpkg --add-architecture i386
sudo apt install libacl1-dev:i386 libc6-dev-i386 libc6-dev-i386-cross libstdc++6-i386-cross gcc-multilib g++-multilib
```

Additionally, there is an optional dependency to the [cpptoml](https://github.com/skystrife/cpptoml) library, which is used to parse the RouDi config file containing mempool configuration.

### QNX
Expand Down
6 changes: 4 additions & 2 deletions doc/website/release-notes/iceoryx-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- The minimal supported GCC compiler is now 8.3
- The required C++ standard is now C++17
- Experimental 32-bit support for all platforms supporting 64-bit atomic operations

**Features:**

Expand Down Expand Up @@ -73,6 +74,7 @@ class to enable or disable systemd support when running iceoryx [#2330](https://

**Bugfixes:**

- Fix compile-time conflict with Apache Arrow [\#2327](https://github.com/eclipse-iceoryx/iceoryx/issues/2327)
- FreeBSD CI build is broken [\#1338](https://github.com/eclipse-iceoryx/iceoryx/issues/1338)
- High CPU load in blocked publisher is reduced by introducing smart busy loop waiting (adaptive_wait) [\#1347](https://github.com/eclipse-iceoryx/iceoryx/issues/1347)
- Compile Error : iceoryx_dds/Mempool.hpp: No such file or directory [\#1364](https://github.com/eclipse-iceoryx/iceoryx/issues/1364)
Expand Down Expand Up @@ -139,6 +141,8 @@ class to enable or disable systemd support when running iceoryx [#2330](https://
- Listener examples need to take all samples in the callback [#2251](https://github.com/eclipse-iceoryx/iceoryx/issues/2251)
- 'iox::string' tests can exceed the translation unit compilation timeout [#2278](https://github.com/eclipse-iceoryx/iceoryx/issues/2278)
- Building iceoryx with bazel on Windows is broken [#2320](https://github.com/eclipse-iceoryx/iceoryx/issues/2320)
- Fix wrong memory orders in SpscSoFi [#2177](https://github.com/eclipse-iceoryx/iceoryx/issues/2177)
- ssize_t: redefinition; different basic types [#2209](https://github.com/eclipse-iceoryx/iceoryx/issues/2209)

**Refactoring:**

Expand Down Expand Up @@ -1471,5 +1475,3 @@ class to enable or disable systemd support when running iceoryx [#2330](https://
```
64. The non-functional `iox::popo::Node` was removed
65. 32-bit support is disabled by default. For development purposes iceoryx can be build with the `-DIOX_IGNORE_32_BIT_CHECK=ON`
20 changes: 10 additions & 10 deletions iceoryx_binding_c/include/iceoryx_binding_c/client.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2022 by Apex.AI Inc. All rights reserved.
// Copyright (c) 2024 by Michael Bentley <[email protected]>. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -23,7 +24,7 @@
#include "iceoryx_binding_c/types.h"

/// @brief client handle
typedef CLASS UntypedClient* iox_client_t;
typedef IOX_C_CLASS UntypedClient* iox_client_t;

/// @brief options to be set for a client
typedef struct
Expand All @@ -38,10 +39,10 @@ typedef struct
bool connectOnCreate;

/// @brief Sets whether the server blocks when the client response queue is full
ENUM iox_QueueFullPolicy responseQueueFullPolicy;
enum iox_QueueFullPolicy responseQueueFullPolicy;

/// @brief Sets whether the client blocks when the server request queue is full
ENUM iox_ConsumerTooSlowPolicy serverTooSlowPolicy;
enum iox_ConsumerTooSlowPolicy serverTooSlowPolicy;

/// @brief this value will be set exclusively by 'iox_client_options_init' and is not supposed to be modified
/// otherwise
Expand Down Expand Up @@ -87,9 +88,8 @@ void iox_client_deinit(iox_client_t const self);
/// describes the error
/// @note for the user-payload alignment 'IOX_C_CHUNK_DEFAULT_USER_PAYLOAD_ALIGNMENT' is used
/// for a custom user-payload alignment please use 'iox_client_loan_aligned_request'
ENUM iox_AllocationResult iox_client_loan_request(iox_client_t const self,
void** const payload,
const uint64_t payloadSize);
enum iox_AllocationResult
iox_client_loan_request(iox_client_t const self, void** const payload, const uint64_t payloadSize);

/// @brief allocates a request in the shared memory with a custom alignment for the user-payload
/// @param[in] self handle of the client
Expand All @@ -98,7 +98,7 @@ ENUM iox_AllocationResult iox_client_loan_request(iox_client_t const self,
/// @param[in] payloadAlignment user-payload alignment of the allocated request
/// @return on success it returns AllocationResult_SUCCESS otherwise a value which
/// describes the error
ENUM iox_AllocationResult iox_client_loan_aligned_request(iox_client_t const self,
enum iox_AllocationResult iox_client_loan_aligned_request(iox_client_t const self,
void** const payload,
const uint64_t payloadSize,
const uint32_t payloadAlignment);
Expand All @@ -114,7 +114,7 @@ void iox_client_release_request(iox_client_t const self, void* const payload);
/// @param[in] payload pointer to the user-payload of the request which should be send
/// @return on success it returns ClientSendResult_SUCCESS otherwise a value which
/// describes the error
ENUM iox_ClientSendResult iox_client_send(iox_client_t const self, void* const payload);
enum iox_ClientSendResult iox_client_send(iox_client_t const self, void* const payload);

/// @brief connects to the service
/// @param[in] self handle to the client
Expand All @@ -128,14 +128,14 @@ void iox_client_disconnect(iox_client_t const self);
/// @param[in] self handle to the client
/// @return ConnectionState_CONNECTED when successfully connected otherwise an enum which
/// describes the current state
ENUM iox_ConnectionState iox_client_get_connection_state(iox_client_t const self);
enum iox_ConnectionState iox_client_get_connection_state(iox_client_t const self);

/// @brief retrieve a received respone
/// @param[in] self handle to the client
/// @param[in] payload pointer in which the pointer to the user-payload of the response is stored
/// @return if a chunk could be received it returns ChunkReceiveResult_SUCCESS otherwise
/// an enum which describes the error
ENUM iox_ChunkReceiveResult iox_client_take_response(iox_client_t const self, const void** const payload);
enum iox_ChunkReceiveResult iox_client_take_response(iox_client_t const self, const void** const payload);

/// @brief release a previously acquired response (via iox_client_take_response)
/// @param[in] self handle to the client
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
// Copyright (c) 2024 by Michael Bentley <[email protected]>. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -21,16 +22,14 @@

#include <cstdint>

#define CLASS class
#define ENUM
#define IOX_C_CLASS class

#else

#include <stdbool.h>
#include <stdint.h>

#define CLASS struct
#define ENUM enum
#define IOX_C_CLASS struct

#endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2021 - 2022 by Apex.AI Inc. All rights reserved.
// Copyright (c) 2024 by Michael Bentley <[email protected]>. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -24,8 +25,8 @@

namespace c2cpp
{
iox::popo::ConsumerTooSlowPolicy consumerTooSlowPolicy(const ENUM iox_ConsumerTooSlowPolicy policy) noexcept;
iox::popo::QueueFullPolicy queueFullPolicy(const ENUM iox_QueueFullPolicy policy) noexcept;
iox::popo::ConsumerTooSlowPolicy consumerTooSlowPolicy(const enum iox_ConsumerTooSlowPolicy policy) noexcept;
iox::popo::QueueFullPolicy queueFullPolicy(const enum iox_QueueFullPolicy policy) noexcept;
iox::popo::SubscriberEvent subscriberEvent(const iox_SubscriberEvent value) noexcept;
iox::popo::SubscriberState subscriberState(const iox_SubscriberState value) noexcept;

Expand Down
Loading

0 comments on commit a5f4534

Please sign in to comment.