Skip to content

Commit

Permalink
Merge pull request eclipse-iceoryx#222 from elfenpiff/iox2-221-increa…
Browse files Browse the repository at this point in the history
…se-rust-min-version

[eclipse-iceoryx#221] Update all dependencies and set min rust version to 1.75.0
  • Loading branch information
elfenpiff committed May 27, 2024
2 parents 07ee2f0 + b54d3ae commit 2626216
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ubuntu_22_04_x64_min_version_debug_task:
only_if: false
depends_on: preflight_check
<<: *IOX2_CONTAINER_UBUNTU_22_04_X64
set_toolchain_script: rustup default 1.73.0
set_toolchain_script: rustup default 1.75.0
<<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG
linux_only_doc_test_script: cargo test --doc -- --ignored

Expand Down Expand Up @@ -189,7 +189,7 @@ ubuntu_22_04_aarch64_min_version_debug_task:
depends_on: preflight_check
skip: "changesIncludeOnly('.github/**', '**.md')"
<<: *IOX2_CONTAINER_UBUNTU_22_04_AARCH64
set_toolchain_script: rustup default 1.73.0
set_toolchain_script: rustup default 1.75.0
<<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG

ubuntu_22_04_aarch64_stable_debug_task:
Expand Down Expand Up @@ -286,7 +286,7 @@ freebsd_x64_min_version_debug_task:
PATH: /root/.cargo/bin:$PATH
HOME: /root # must be set manually to '/root' or 'rustup' will throw an error
<<: *IOX2_FREEBSD_SETUP
set_toolchain_script: rustup default 1.73.0
set_toolchain_script: rustup default 1.75.0
<<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG

freebsd_x64_stable_debug_task:
Expand Down Expand Up @@ -319,7 +319,7 @@ macos_aarch64_min_version_debug_task:
- uname -a
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path
- rustup component add clippy rustfmt
set_toolchain_script: rustup default 1.73.0
set_toolchain_script: rustup default 1.75.0
<<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG

macos_aarch64_stable_debug_task:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest] # [windows-latest, ubuntu-latest, macos-latest]
toolchain: [stable] # [stable, 1.73.0, beta, nightly]
toolchain: [stable] # [stable, 1.75.0, beta, nightly]
mode:
- name: "release"
arg: "--release"
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
toolchain: [stable, 1.73.0, beta, nightly]
toolchain: [stable, 1.75.0, beta, nightly]
mode:
- name: "release"
arg: "--release"
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
# strategy:
# matrix:
# architecture: ["aarch64"] # ["aarch64", "armv7"]
# toolchain: [ stable ] # [stable, 1.73.0, beta, nightly]
# toolchain: [ stable ] # [stable, 1.75.0, beta, nightly]
# mode: ["--release", ""]
# timeout-minutes: 30
# steps:
Expand All @@ -206,7 +206,7 @@ jobs:
strategy:
matrix:
freebsd_version: [ "14.0" ]
toolchain: [ "stable", "1.73.0" ] # [stable, 1.73.0, beta, nightly]
toolchain: [ "stable", "1.75.0" ] # [stable, 1.75.0, beta, nightly]
mode: [""] # ["--release", ""]
steps:
- uses: actions/checkout@v4
Expand Down
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ keywords = ["zero-copy", "communication", "ipc", "inter-process", "publish-subsc
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/eclipse-iceoryx/iceoryx2"
rust-version = "1.73"
rust-version = "1.75"
version = "0.3.0"

[workspace.dependencies]
Expand All @@ -56,23 +56,23 @@ iceoryx2-cal = { version = "0.3.0", path = "iceoryx2-cal" }

iceoryx2 = { version = "0.3.0", path = "iceoryx2/" }

bindgen = { version = "0.65.1" }
bitflags = { version = "1.3.2" }
cc = { version = "1.0" }
bindgen = { version = "0.69.4" }
bitflags = { version = "2.5.0" }
cc = { version = "1.0.98" }
cdr = { version = "0.2.4" }
clap = { version = "3.2.25", features = ["derive"] }
enum-iterator = { version = "1.2.0" }
clap = { version = "4.5.4", features = ["derive"] }
enum-iterator = { version = "2.1.0" }
generic-tests = { version = "0.1.2" }
lazy_static = { version = "1.4.0" }
log = { version = "0.4.20" }
once_cell = { version = "1.16.0" }
ouroboros = { version = "0.17.2" }
log = { version = "0.4.21" }
once_cell = { version = "1.19.0" }
ouroboros = { version = "0.18.4" }
pin-init = { version = "0.2.0" }
serde = { version = "1.0.139", features = ["derive"] }
serde = { version = "1.0.203", features = ["derive"] }
sha1_smol = { version = "1.0.0" }
termsize = { version = "0.1" }
termsize = { version = "0.1.6" }
tiny-fn = { version = "0.1.5" }
toml = { version = "0.5.9" }
toml = { version = "0.8.13" }
tracing = { version = "0.1.40" }
windows-sys = { version = "0.48.0", features = ["Win32_Security", "Win32_Security_Authorization", "Win32_System_Memory", "Win32_System_Threading", "Win32_Foundation", "Win32_System_WindowsProgramming", "Win32_Storage_FileSystem", "Win32_System_IO", "Win32_System_Diagnostics_Debug", "Win32_System_SystemInformation", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Console", "Win32_Networking_WinSock",
"Win32_System_SystemServices"] }
Expand Down
1 change: 1 addition & 0 deletions doc/release-notes/iceoryx2-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@

* `open`, `open_or_create` and `create` are untyped in pubsub-builder [#195](https://github.com/eclipse-iceoryx/iceoryx2/issues/195)
* use `ClockMode::Performance` instead of `ClockMode::Safety` in default deployment [#207](https://github.com/eclipse-iceoryx/iceoryx2/issues/207)
* Updated all dependencies and increased MSRV to 1.75 [#221](https://github.com/eclipse-iceoryx/iceoryx2/issues/221)

### Workflow

Expand Down
6 changes: 6 additions & 0 deletions iceoryx2-bb/memory/src/heap_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ pub use iceoryx2_bb_elementary::allocator::{AllocationError, Allocator, BaseAllo
#[derive(Debug)]
pub struct HeapAllocator {}

impl Default for HeapAllocator {
fn default() -> Self {
Self::new()
}
}

impl HeapAllocator {
pub const fn new() -> HeapAllocator {
HeapAllocator {}
Expand Down
5 changes: 4 additions & 1 deletion iceoryx2-bb/posix/src/file_descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ pub struct FileDescriptor {
impl Clone for FileDescriptor {
fn clone_from(&mut self, source: &Self) {
self.close();
*self = source.clone();
// TODO: [#223] START: rewrite lines to: let *self = source.clone()
let temp = source.clone();
*self = temp;
// TODO: [#223] END
}

fn clone(&self) -> Self {
Expand Down
15 changes: 9 additions & 6 deletions iceoryx2-bb/posix/src/permission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ use std::fmt::Display;

type ModeType = posix::mode_t;

/// Defines the permission of a file or directory in a POSIX system.
#[derive(Default, Debug, Clone, Copy, PartialEq, Eq)]
pub struct Permission(ModeType);

bitflags! {
/// Defines the permission of a file or directory in a POSIX system.
#[derive(Default)]
pub struct Permission: ModeType {
impl Permission: ModeType {
const OWNER_READ = 0o0400;
const OWNER_WRITE = 0o0200;
const OWNER_EXEC = 0o0100;
Expand All @@ -48,12 +50,13 @@ bitflags! {

const MASK = 0o7777;
const UNKNOWN = 0xFFFF;
const _ = !0;
}
}

impl Permission {
pub fn none() -> Self {
Self { bits: 0 }
Self(0)
}
}

Expand Down Expand Up @@ -118,12 +121,12 @@ impl PermissionExt for posix::mode_t {
impl Permission {
/// Returns true when self contains the permissions of the rhs, otherwise false.
pub fn has(&self, rhs: Permission) -> bool {
(*self & rhs) != Permission::none()
(self.0 & rhs.0) != 0
}

/// Converts the permissions into the C type mode_t
pub fn as_mode(&self) -> posix::mode_t {
self.bits
self.0
}
}

Expand Down
16 changes: 8 additions & 8 deletions iceoryx2-bb/posix/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,22 @@ impl ThreadBuilder {
}
}

pub fn spawn<'a, T: Debug, F>(self, f: F) -> Result<Thread<'a>, ThreadSpawnError>
pub fn spawn<'a, T, F>(self, f: F) -> Result<Thread<'a>, ThreadSpawnError>
where
T: Send + 'static,
T: Debug + Send + 'static,
F: FnOnce() -> T + Send + 'static,
{
self.spawn_impl(f, None)
}

/// Creates a new thread with the provided callable `f`.
fn spawn_impl<'a, T: Debug, F>(
fn spawn_impl<'a, T, F>(
self,
f: F,
stack: Option<&'a mut [u8]>,
) -> Result<Thread<'a>, ThreadSpawnError>
where
T: Send + 'static,
T: Debug + Send + 'static,
F: FnOnce() -> T + Send + 'static,
{
let mut attributes = ScopeGuardBuilder::new( posix::pthread_attr_t::new())
Expand Down Expand Up @@ -561,9 +561,9 @@ impl ThreadGuardedStackBuilder {
}

/// See: [`ThreadBuilder::spawn()`]
pub fn spawn<'a, T: Debug, F>(self, f: F) -> Result<Thread<'a>, ThreadSpawnError>
pub fn spawn<'a, T, F>(self, f: F) -> Result<Thread<'a>, ThreadSpawnError>
where
T: Send + 'static,
T: Debug + Send + 'static,
F: FnOnce() -> T + Send + 'static,
{
self.config.spawn_impl(f, None)
Expand All @@ -580,9 +580,9 @@ pub struct ThreadCustomStackBuilder<'a> {

impl<'a> ThreadCustomStackBuilder<'a> {
/// See: [`ThreadBuilder::spawn()`]
pub fn spawn<T: Debug, F>(self, f: F) -> Result<Thread<'a>, ThreadSpawnError>
pub fn spawn<T, F>(self, f: F) -> Result<Thread<'a>, ThreadSpawnError>
where
T: Send + 'static,
T: Debug + Send + 'static,
F: FnOnce() -> T + Send + 'static,
{
self.config.spawn_impl(f, Some(self.stack))
Expand Down
1 change: 0 additions & 1 deletion iceoryx2-cal/src/serialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub mod toml;
/// Failure emitted by [`Serialize::serialize()`]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum SerializeError {
UnsupportedType,
InternalError,
}

Expand Down
13 changes: 4 additions & 9 deletions iceoryx2-cal/src/serialize/toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ impl Serialize for Toml {
fn serialize<T: serde::Serialize>(value: &T) -> Result<Vec<u8>, SerializeError> {
let msg = "Failed to serialize object";
let mut buffer = String::new();
let mut serializer = toml::ser::Serializer::new(&mut buffer);
match value.serialize(&mut serializer) {
let serializer = toml::ser::Serializer::new(&mut buffer);
match value.serialize(serializer) {
Ok(()) => Ok(unsafe { buffer.as_mut_vec().clone() }),
Err(toml::ser::Error::UnsupportedType) => {
fail!(from "Toml::serialize",
with SerializeError::UnsupportedType,
"{} since the type \"{}\" is not supported.", msg, std::any::type_name::<T>());
}
Err(e) => {
fail!(from "Toml::serialize",
with SerializeError::InternalError,
Expand All @@ -43,8 +38,8 @@ impl Serialize for Toml {

fn deserialize<T: serde::de::DeserializeOwned>(bytes: &[u8]) -> Result<T, DeserializeError> {
let value = String::from_utf8_lossy(bytes);
let mut deserializer = toml::Deserializer::new(&value);
match T::deserialize(&mut deserializer) {
let deserializer = toml::Deserializer::new(&value);
match T::deserialize(deserializer) {
Ok(result) => Ok(result),
Err(e) => {
fail!(from "Toml::deserialize",
Expand Down
7 changes: 4 additions & 3 deletions iceoryx2-pal/posix/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
extern crate bindgen;
extern crate cc;

use bindgen::*;
use std::env;
use std::path::PathBuf;

Expand All @@ -27,7 +28,7 @@ fn main() {
let bindings = if std::env::var("DOCS_RS").is_ok() {
bindgen::Builder::default()
.header("src/c/posix.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.parse_callbacks(Box::new(CargoCallbacks::new()))
.clang_arg("-D IOX2_DOCS_RS_SUPPORT")
.use_core()
.generate()
Expand All @@ -37,7 +38,7 @@ fn main() {
{
bindgen::Builder::default()
.header("src/c/posix.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.parse_callbacks(Box::new(CargoCallbacks::new()))
.use_core()
.generate()
.expect("Unable to generate bindings")
Expand All @@ -47,7 +48,7 @@ fn main() {
{
bindgen::Builder::default()
.header("src/c/posix.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.parse_callbacks(Box::new(CargoCallbacks::new()))
.clang_arg("-D IOX2_ACL_SUPPORT")
.generate()
.expect("Unable to generate bindings")
Expand Down
2 changes: 1 addition & 1 deletion internal/docker/archlinux-base-devel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN echo "#### Installing dependencies" \
&& rustup toolchain add \
beta \
nightly \
1.73.0 \
1.75.0 \
&& echo "#### Adding more components like 'clippy', 'rustfmt', etc." \
&& rustup component add \
clippy \
Expand Down
2 changes: 1 addition & 1 deletion internal/docker/ubuntu-22.04
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN echo "#### Installing dependencies" \
&& rustup toolchain add \
beta \
nightly \
1.73.0 \
1.75.0 \
&& echo "#### Adding more components like 'clippy', 'rustfmt', etc." \
&& rustup component add \
clippy \
Expand Down
2 changes: 1 addition & 1 deletion internal/scripts/ci_prepare_archlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

pacman -Syu --noconfirm clang git rustup
pacman -Scc --noconfirm
rustup toolchain add beta nightly stable 1.73.0
rustup toolchain add beta nightly stable 1.75.0
rustup component add clippy llvm-tools-preview rustfmt
rustup default stable
groupadd users
Expand Down
2 changes: 1 addition & 1 deletion internal/scripts/ci_prepare_freebsd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pkg update
pkg install -y curl git llvm
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path
export PATH=$PATH:$HOME/.cargo/bin
rustup toolchain add beta nightly 1.73.0 stable
rustup toolchain add beta nightly 1.75.0 stable
rustup component add clippy rustfmt
rustup default stable
cargo install cargo-nextest --locked
Expand Down

0 comments on commit 2626216

Please sign in to comment.