Skip to content

Commit

Permalink
Merge branch 'main' into iox-2-48-cargo-audit-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff authored Jan 5, 2024
2 parents 43fda38 + 87d0d8f commit 077cbf0
Show file tree
Hide file tree
Showing 83 changed files with 1,232 additions and 752 deletions.
13 changes: 1 addition & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,4 @@ macos_aarch64_stable_debug_task:
- rustup component add clippy rustfmt
set_toolchain_script: rustup default stable
<<: *IOX2_CARGO_FMT_AND_CLIPPY
<<: *IOX2_COMMON_BUILD_DEBUG
test_script:
- cargo test -p iceoryx2-pal-concurrency-sync
-p iceoryx2-pal-posix
-p iceoryx2-bb-container
-p iceoryx2-bb-elementary
-p iceoryx2-bb-lock-free
-p iceoryx2-bb-log
-p iceoryx2-bb-memory
-p iceoryx2-bb-system-types
-p iceoryx2-bb-testing
--lib --bins --tests --no-fail-fast
<<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG
45 changes: 45 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Contributing to Eclipse iceoryx2

1. Every new contributor must sign the
[Eclipse Contributor Agreement (ECA)](https://www.eclipse.org/legal/ECA.php)
first.
2. Before you start to work, please create an issue first.
3. Create a branch with the prefix `iox2-$ISSUE_NUMBER$`.
4. Every file requires this copyright header.

```
// Copyright (c) 2023 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT
```
5. Every commit must have the prefix `[#$ISSUE_NUMBER$]`.
6. When the work is done, please add your changes to the release notes in
`doc/release-notes/iceoryx2-unreleased.md`.
7. Create a pull request.
8. (optional) If you are a new contributor we would love to show our gratitude
for your support so please add yourself at the end of `README.md`.
The entry template looks like this:
```html
<td align="center" valign="top" width="14.28%">
<a href="https://github.com/$USER_NAME$">
<img src="https://avatars.githubusercontent.com/u/$ID_OF_YOUR_PROFILE_PICTURE$" width="120px;" alt="$FIRST_NAME$ »$COOL_NICK_NAME$« $LAST_NAME$"/><br />
<sub><b>$FIRST_NAME$ »$COOL_NICK_NAME$« $LAST_NAME$</b></sub></a></td>
```
**Notes:**
* The `$FIRST_NAME »$COOL_NICK_NAME$« $LAST_NAME$` is a suggestion but it can
be whatever you feel comfortable with.
* You can obtain the ID of your profile picture by clicking on your profile
icon on the top right, selecting `Your profile` and then right-clicking on
your profile picture and selecting `Copy image address`. The last number in
the URL is the ID of your profile picture.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ The support levels can be adjusted when required.
| Linux (x86_64) | done | tier 2 | tier 1 |
| Linux (aarch64) | done | tier 2 | tier 1 |
| Linux (32-bit) | in-progress | tier 3 | tier 1 |
| Mac OS | in-progress | tier 3 | tier 2 |
| Mac OS | done | tier 2 | tier 2 |
| QNX | planned | - | tier 1 |
| WatchOS | planned | - | tier 2 |
| Windows | done | tier 2 | tier 2 |
Expand Down
20 changes: 19 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
* [ ] `#![no_std]` on `stable` on all tier 1 platforms
* [ ] completely dynamic setup with dynamic shared memory

## Shared Memory Container & Types

* [ ] Make `iceoryx2_bb_container` public with announcement
* [ ] Create and document dynamic size container concept for shared memory and apply it
to all existing containers: `ByteString`, `Vec`, `Queue`
* Open Question: How can these containers be cloned, copied?
* [ ] Introduce additional containers: `HashMap`, `Tree`, `Set`, `List`
* [ ] Introduce elementary types, look into: `simple-si-units` crate
* Add types like: memory size, percentage, strict percentage (0..100), data throughput, resolution
(further types found in informatics)
* [ ] Add `derive` proc macro to ensure that only shm compatible types can be
transferred via zero-copy

## Language Bindings

* [ ] C
Expand Down Expand Up @@ -59,6 +72,7 @@
* [ ] Zero-copy GPU communication with Cuda, NvSci, Vulkan
* [ ] Zero-copy across hypervisor partitions
* [ ] Zero-copy via QEMU ivshmem: <https://www.qemu.org/docs/master/system/devices/ivshmem.html>
* [ ] dmabuf support, see: https://blaztinn.gitlab.io/post/dmabuf-texture-sharing/
* [ ] Support dynamic sized types in a memory efficient manner
* Buddy allocator for sender data-segment
* Introduce runtime fixed-size types
Expand All @@ -77,7 +91,7 @@
* [ ] Android
* [x] Linux
* [x] Windows
* [ ] Mac Os
* [x] Mac Os
* [ ] iOS
* [ ] WatchOS
* [x] FreeBSD
Expand Down Expand Up @@ -128,3 +142,7 @@
* simple use case: pub/sub + event to notify subscriber to notify sample send
* would reduce error handling: connect to service with wrong messaging pattern
* [ ] Implement Resizable SharedMemoryConcept that is able to extend the shared memory by adding additional posix shared memory objects

## Integration Into Other Projects

* [ ] Maybe Hyprland
16 changes: 10 additions & 6 deletions doc/release-notes/iceoryx2-unreleased.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
# iceoryx2 v?.?.?

## [vx.x.x](https://github.com/larry-robotics/iceoryx2/tree/vx.x.x) (xxxx-xx-xx) <!--NOLINT remove this when tag is set-->
## [vx.x.x](https://github.com/eclipse-iceoryx/iceoryx2/tree/vx.x.x) (xxxx-xx-xx) <!--NOLINT remove this when tag is set-->

[Full Changelog](https://github.com/larry-robotics/iceoryx2/compare/vx.x.x...vx.x.x) <!--NOLINT remove this when tag is set-->
[Full Changelog](https://github.com/eclipse-iceoryx/iceoryx2/compare/vx.x.x...vx.x.x) <!--NOLINT remove this when tag is set-->

### Features

* Example [#1](https://github.com/larry-robotics/iceoryx2/issues/1)
* MacOS Platform support [#51](https://github.com/eclipse-iceoryx/iceoryx2/issues/51)
* Services with the same name for different messaging patterns are supported [#16](https://github.com/eclipse-iceoryx/iceoryx2/issues/16)

### Bugfixes

* Example [#1](https://github.com/larry-robotics/iceoryx2/issues/1)
* Fix undefined behavior in `FixedSizeByteString::new_unchecked` [#61](https://github.com/eclipse-iceoryx/iceoryx2/issues/61)
* Fix suffix of static config [#66](https://github.com/eclipse-iceoryx/iceoryx2/issues/66)

### Refactoring

* Example [#1](https://github.com/larry-robotics/iceoryx2/issues/1)
* Example [#1](https://github.com/eclipse-iceoryx/iceoryx2/issues/1)

### Workflow

* add `cargo audit` for security vulnerability checking in dependencies [#48](https://github.com/eclipse-iceoryx/iceoryx2/issues/48)

### New API features

* Example [#1](https://github.com/larry-robotics/iceoryx2/issues/1)
* Add `FixedSizeByteString::from_bytes_truncated` [#56](https://github.com/eclipse-iceoryx/iceoryx2/issues/56)
* Add `Deref`, `DerefMut`, `Clone`, `Eq`, `PartialEq` and `extend_from_slice` to (FixedSize)Vec [#58](https://github.com/eclipse-iceoryx/iceoryx2/issues/58)
* `MessagingPattern` implements `Display` [#64](https://github.com/eclipse-iceoryx/iceoryx2/issues/64)

### API Breaking Changes

Expand Down
31 changes: 18 additions & 13 deletions iceoryx2-bb/container/src/byte_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,23 +207,12 @@ impl<const CAPACITY: usize> FixedSizeByteString<CAPACITY> {
///
/// * `bytes` len must be smaller or equal than [`FixedSizeByteString::capacity()`]
///
pub const unsafe fn new_unchecked(bytes: &[u8]) -> Self {
pub unsafe fn new_unchecked(bytes: &[u8]) -> Self {
if CAPACITY < bytes.len() {
panic!("Insufficient capacity to store bytes.");
}

let mut new_self = Self::new();
new_self.len = bytes.len();
std::ptr::copy(
bytes.as_ptr(),
new_self.data.as_ptr() as *mut u8,
bytes.len(),
);

let zero = 0u8;
std::ptr::copy(&zero, new_self.data.as_ptr().add(bytes.len()) as *mut u8, 1);

new_self
Self::from_bytes_truncated(bytes)
}

/// Creates a new [`FixedSizeByteString`] from a byte slice
Expand All @@ -237,6 +226,22 @@ impl<const CAPACITY: usize> FixedSizeByteString<CAPACITY> {
Ok(new_self)
}

/// Creates a new [`FixedSizeByteString`] from a byte slice. If the byte slice does not fit
/// into the [`FixedSizeByteString`] it will be truncated.
pub fn from_bytes_truncated(bytes: &[u8]) -> Self {
let mut new_self = Self::new();
new_self.len = std::cmp::min(bytes.len(), CAPACITY);
for (i, byte) in bytes.iter().enumerate().take(new_self.len) {
new_self.data[i].write(*byte);
}

if new_self.len < CAPACITY {
new_self.data[new_self.len].write(0);
}

new_self
}

/// Creates a new byte string from a given null-terminated string
///
/// # Safety
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-bb/container/src/semantic_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ macro_rules! semantic_string {
}

impl $string_name {
pub const unsafe fn new_unchecked(bytes: &[u8]) -> Self {
pub unsafe fn new_unchecked(bytes: &[u8]) -> Self {
Self {
value: iceoryx2_bb_container::byte_string::FixedSizeByteString::new_unchecked(bytes),
}
Expand Down
Loading

0 comments on commit 077cbf0

Please sign in to comment.