From a6f1828596ac2c3c599849fa523f318a50db0208 Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Fri, 5 Jan 2024 23:18:15 +0100 Subject: [PATCH 1/5] [#72] Use 'is-terminal' crate to reduce rust version to 1.65 --- Cargo.toml | 3 ++- iceoryx2-bb/log/Cargo.toml | 1 + iceoryx2-bb/log/src/logger/console.rs | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9d7037e2f..ab24f9e9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ keywords = ["zero-copy", "ipc", "shared-memory", "publish-subscribe", "request-r license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/eclipse-iceoryx/iceoryx2" -rust-version = "1.72.1" +rust-version = "1.65" version = "0.1.1" [workspace.dependencies] @@ -66,6 +66,7 @@ log = { version = "0.4.20" } once_cell = { version = "1.16.0" } ouroboros = { version = "0.17.2" } pin-init = { version = "0.2.0" } +is-terminal = { version = "0.4.10" } serde = { version = "1.0.139", features = ["derive"] } sha1_smol = { version = "1.0.0" } termsize = { version = "0.1" } diff --git a/iceoryx2-bb/log/Cargo.toml b/iceoryx2-bb/log/Cargo.toml index 8980ade0c..a48c78ad9 100644 --- a/iceoryx2-bb/log/Cargo.toml +++ b/iceoryx2-bb/log/Cargo.toml @@ -17,6 +17,7 @@ logger_log = ["dep:log"] logger_tracing = ["dep:tracing"] [dependencies] +is-terminal = { workspace = true } termsize = { workspace = true } log = { workspace = true, optional = true } tracing = { workspace = true, optional = true } diff --git a/iceoryx2-bb/log/src/logger/console.rs b/iceoryx2-bb/log/src/logger/console.rs index af0aca15a..c0e5c7306 100644 --- a/iceoryx2-bb/log/src/logger/console.rs +++ b/iceoryx2-bb/log/src/logger/console.rs @@ -12,10 +12,8 @@ //! The default [`Logger`] implementation. -use std::{ - io::IsTerminal, - sync::atomic::{AtomicU64, Ordering}, -}; +use is_terminal::IsTerminal; +use std::sync::atomic::{AtomicU64, Ordering}; use termsize::Size; From b0f2bdcf51196dd3ad8c52dbef0d468430e6bc9d Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Fri, 5 Jan 2024 23:45:29 +0100 Subject: [PATCH 2/5] [#72] Add CI test to check that minimum version is really supported --- .cirrus.yml | 38 +++++++ .github/workflows/build-test.yml | 130 +++++------------------ Cargo.toml | 3 +- doc/release-notes/iceoryx2-unreleased.md | 1 + iceoryx2-bb/log/Cargo.toml | 1 - iceoryx2-bb/log/src/logger/console.rs | 6 +- internal/docker/archlinux-base-devel | 1 + internal/docker/ubuntu-22.04 | 1 + 8 files changed, 74 insertions(+), 107 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index a5154d4c5..6736fb075 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -119,6 +119,13 @@ preflight_check_task: # Pipeline 2 +ubuntu_22_04_x64_min_version_debug_task: + depends_on: preflight_check + <<: *IOX2_CONTAINER_UBUNTU_22_04_X64 + set_toolchain_script: rustup default 1.70.0 + <<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG + linux_only_doc_test_script: cargo test --doc -- --ignored + ubuntu_22_04_x64_stable_debug_task: depends_on: preflight_check <<: *IOX2_CONTAINER_UBUNTU_22_04_X64 @@ -154,6 +161,13 @@ ubuntu_22_04_x64_stable_release_task: # Pipeline 4 +### TODO commented out due to limited CI time +### ubuntu_22_04_aarch64_min_version_debug_task: +### depends_on: preflight_check +### <<: *IOX2_CONTAINER_UBUNTU_22_04_AARCH64 +### set_toolchain_script: rustup default 1.70.0 +### <<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG + ubuntu_22_04_aarch64_stable_debug_task: depends_on: preflight_check <<: *IOX2_CONTAINER_UBUNTU_22_04_AARCH64 @@ -232,6 +246,17 @@ windows_server_2019_x64_stable_release_task: # Pipeline 9 +### TODO commented out due to limited CI time +### freebsd_x64_min_version_debug_task: +### depends_on: preflight_check +### <<: *IOX2_CONTAINER_FREEBSD_X64 +### env: +### 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.70.0 +### <<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG + freebsd_x64_stable_debug_task: depends_on: preflight_check <<: *IOX2_CONTAINER_FREEBSD_X64 @@ -260,6 +285,19 @@ freebsd_x64_stable_debug_task: # Pipeline 10 +### TODO commented out due to limited CI time +### macos_aarch64_min_version_debug_task: +### depends_on: preflight_check +### <<: *IOX2_CONTAINER_MACOS_AARCH64 +### env: +### PATH: /Users/admin/.cargo/bin:$PATH +### setup_script: +### - 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.70.0 +### <<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG + macos_aarch64_stable_debug_task: depends_on: preflight_check <<: *IOX2_CONTAINER_MACOS_AARCH64 diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index d2a089ca6..585720064 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -20,7 +20,7 @@ jobs: - name: Check license header run: ./internal/scripts/ci_test_spdx_license_header.sh - windows: + windows-stable: needs: preflight-check timeout-minutes: 10 runs-on: windows-latest @@ -53,6 +53,33 @@ jobs: - name: Run cargo test run: cargo test --workspace --no-fail-fast + windows-min-version: + needs: preflight-check + timeout-minutes: 10 + runs-on: windows-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Setup Rust + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: 1.70.0 + components: rustfmt, clippy + + - name: Prepare system + run: | + mkdir "C:\Temp\iceoryx2\services" + mkdir "C:\Temp\iceoryx2\tests" + mkdir "C:\Temp\iceoryx2\shm" + icacls "C:\Temp" /t /c /grant Everyone:F + + - name: Run cargo build + run: cargo build --workspace --all-targets + + - name: Run cargo test + run: cargo test --workspace --no-fail-fast + grcov: needs: preflight-check timeout-minutes: 10 @@ -122,104 +149,3 @@ jobs: with: file: target/debug/coverage/lcov.info fail_ci_if_error: true - -# linux_x64: -# timeout-minutes: 10 -# runs-on: ubuntu-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v3 -# -# - name: Install dependencies -# run: sudo apt-get -y install libacl1-dev -# -# - name: Create test users and groups -# run: | -# sudo useradd testuser1 -# sudo useradd testuser2 -# sudo groupadd testgroup1 -# sudo groupadd testgroup2 -# -# - name: Setup Rust -# uses: dtolnay/rust-toolchain@v1 -# with: -# toolchain: stable -# components: rustfmt, clippy -# -# - name: Run cargo fmt -# run: cargo fmt --all -- --check -# -# - name: Run cargo clippy -# run: cargo clippy -- -D warnings -# -# - name: Run cargo build -# run: cargo build --workspace --all-targets -# -# - name: Run cargo test -# run: cargo test --workspace --no-fail-fast -# -# freebsd: -# timeout-minutes: 20 -# runs-on: macos-12 -# steps: -# - name: Checkout sources -# uses: actions/checkout@v3 -# -# - name: Install FreeBSD -# id: Test -# uses: vmactions/freebsd-vm@v0 -# with: -# usesh: true -# copyback: false -# mem: 4096 -# prepare: | -# pkg install -y git curl bash llvm17 -# pw user add testuser1 -# pw user add testuser2 -# pw group add testgroup1 -# pw group add testgroup2 -# mkdir -p /mnt/mqueue/ -# mount -t mqueuefs null /mnt/mqueue/ -# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# git config --global --add safe.directory /Users/runner/work/iceoryx2/iceoryx2 -# run: | -# ln -sf ~/.cargo/bin/* /usr/bin/ -# cargo fmt --all -- --check -# cargo clippy -- -D warnings -# cargo test --workspace -- --test-threads=1 -# -# mac_os_no_bb_posix__cal__iceoryx2: -# timeout-minutes: 20 -# runs-on: macos-latest -# steps: -# - name: Checkout sources -# uses: actions/checkout@v3 -# -# - name: Setup Rust -# uses: dtolnay/rust-toolchain@v1 -# with: -# toolchain: stable -# components: rustfmt, clippy -# -# - name: Run cargo fmt -# run: cargo fmt --all -- --check -# -# - name: Run cargo clippy -# run: cargo clippy -- -D warnings -# -# - name: Run cargo build -# run: cargo build --workspace --all-targets - -# - name: Run cargo test subset -# run: | -# 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 diff --git a/Cargo.toml b/Cargo.toml index ab24f9e9b..3a2139d33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ keywords = ["zero-copy", "ipc", "shared-memory", "publish-subscribe", "request-r license = "MIT OR Apache-2.0" readme = "README.md" repository = "https://github.com/eclipse-iceoryx/iceoryx2" -rust-version = "1.65" +rust-version = "1.70" version = "0.1.1" [workspace.dependencies] @@ -66,7 +66,6 @@ log = { version = "0.4.20" } once_cell = { version = "1.16.0" } ouroboros = { version = "0.17.2" } pin-init = { version = "0.2.0" } -is-terminal = { version = "0.4.10" } serde = { version = "1.0.139", features = ["derive"] } sha1_smol = { version = "1.0.0" } termsize = { version = "0.1" } diff --git a/doc/release-notes/iceoryx2-unreleased.md b/doc/release-notes/iceoryx2-unreleased.md index 6b837964a..1cf48e60f 100644 --- a/doc/release-notes/iceoryx2-unreleased.md +++ b/doc/release-notes/iceoryx2-unreleased.md @@ -18,6 +18,7 @@ ### Refactoring * Rename char in platform to c_char [#54](https://github.com/eclipse-iceoryx/iceoryx2/issues/54) + * Set reasonable rust min version to 1.65 and verify it with additional CI targets [#72](https://github.com/eclipse-iceoryx/iceoryx2/issues/72) ### Workflow diff --git a/iceoryx2-bb/log/Cargo.toml b/iceoryx2-bb/log/Cargo.toml index a48c78ad9..8980ade0c 100644 --- a/iceoryx2-bb/log/Cargo.toml +++ b/iceoryx2-bb/log/Cargo.toml @@ -17,7 +17,6 @@ logger_log = ["dep:log"] logger_tracing = ["dep:tracing"] [dependencies] -is-terminal = { workspace = true } termsize = { workspace = true } log = { workspace = true, optional = true } tracing = { workspace = true, optional = true } diff --git a/iceoryx2-bb/log/src/logger/console.rs b/iceoryx2-bb/log/src/logger/console.rs index c0e5c7306..af0aca15a 100644 --- a/iceoryx2-bb/log/src/logger/console.rs +++ b/iceoryx2-bb/log/src/logger/console.rs @@ -12,8 +12,10 @@ //! The default [`Logger`] implementation. -use is_terminal::IsTerminal; -use std::sync::atomic::{AtomicU64, Ordering}; +use std::{ + io::IsTerminal, + sync::atomic::{AtomicU64, Ordering}, +}; use termsize::Size; diff --git a/internal/docker/archlinux-base-devel b/internal/docker/archlinux-base-devel index cf5d7a7f2..311fcfe7c 100644 --- a/internal/docker/archlinux-base-devel +++ b/internal/docker/archlinux-base-devel @@ -19,6 +19,7 @@ RUN echo "#### Installing dependencies" \ && rustup toolchain add \ beta \ nightly \ + 1.70.0 \ && echo "#### Adding more components like 'clippy', 'rustfmt', etc." \ && rustup component add \ clippy \ diff --git a/internal/docker/ubuntu-22.04 b/internal/docker/ubuntu-22.04 index 45a68dcd4..e3da112e2 100644 --- a/internal/docker/ubuntu-22.04 +++ b/internal/docker/ubuntu-22.04 @@ -25,6 +25,7 @@ RUN echo "#### Installing dependencies" \ && rustup toolchain add \ beta \ nightly \ + 1.70.0 \ && echo "#### Adding more components like 'clippy', 'rustfmt', etc." \ && rustup component add \ clippy \ From 0ac711c939057dd44591dae55d408aec7d0c5a65 Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Sat, 6 Jan 2024 00:19:56 +0100 Subject: [PATCH 3/5] [#72] Remove explicit ports in udp socket tests, otherwise ports already in use will be used in tests --- iceoryx2-bb/posix/tests/udp_socket_tests.rs | 69 ++++++++++----------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/iceoryx2-bb/posix/tests/udp_socket_tests.rs b/iceoryx2-bb/posix/tests/udp_socket_tests.rs index 2aacccfdc..e3e0b73a5 100644 --- a/iceoryx2-bb/posix/tests/udp_socket_tests.rs +++ b/iceoryx2-bb/posix/tests/udp_socket_tests.rs @@ -19,10 +19,7 @@ use iceoryx2_bb_posix::{ barrier::{BarrierBuilder, BarrierHandle}, udp_socket::*, }; -use iceoryx2_bb_system_types::{ - ipv4_address::{self, Ipv4Address}, - port::Port, -}; +use iceoryx2_bb_system_types::ipv4_address::{self, Ipv4Address}; use iceoryx2_bb_testing::assert_that; const TIMEOUT: Duration = Duration::from_millis(25); @@ -71,15 +68,14 @@ fn udp_socket_send_receive_works() { #[test] fn udp_socket_server_with_same_address_and_port_fails() { - let _sut_server_1 = UdpServerBuilder::new() + let sut_server_1 = UdpServerBuilder::new() .address(Ipv4Address::new(127, 0, 0, 1)) - .port(Port::new(55555)) .listen() .unwrap(); let sut_server_2 = UdpServerBuilder::new() .address(Ipv4Address::new(127, 0, 0, 1)) - .port(Port::new(55555)) + .port(sut_server_1.port()) .listen(); assert_that!(sut_server_2.err().unwrap(), eq UdpServerCreateError::AddressAlreadyInUse); @@ -87,17 +83,18 @@ fn udp_socket_server_with_same_address_and_port_fails() { #[test] fn udp_socket_when_socket_goes_out_of_scope_address_is_free_again() { + let port; { - let _sut_server_1 = UdpServerBuilder::new() + let sut_server_1 = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55555)) .listen() .unwrap(); + port = sut_server_1.port(); } let sut_server_2 = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55555)) + .port(port) .listen(); assert_that!(sut_server_2, is_ok); @@ -105,42 +102,49 @@ fn udp_socket_when_socket_goes_out_of_scope_address_is_free_again() { #[test] fn udp_socket_server_has_correct_address() { + let port; + { + let sut_server_1 = UdpServerBuilder::new() + .address(ipv4_address::LOCALHOST) + .listen() + .unwrap(); + port = sut_server_1.port(); + } + let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55223)) + .port(port) .listen() .unwrap(); assert_that!(sut_server.address(), eq ipv4_address::LOCALHOST); - assert_that!(sut_server.port(), eq Port::new(55223)); + assert_that!(sut_server.port(), eq port); } #[test] fn udp_socket_client_returns_address_of_server() { - let _sut_server = UdpServerBuilder::new() + let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); - assert_that!(sut_client.address(), eq ipv4_address::LOCALHOST); - assert_that!(sut_client.port(), eq Port::new(55222)); + assert_that!(sut_client.address(), eq sut_server.address()); + assert_that!(sut_client.port(), eq sut_server.port()); } #[test] fn udp_socket_client_can_send_data_to_server() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let send_buffer = [12u8, 24u8, 36u8]; @@ -154,12 +158,11 @@ fn udp_socket_client_can_send_data_to_server() { fn udp_socket_server_can_send_data_to_client() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let send_buffer = [12u8, 24u8, 36u8]; @@ -179,14 +182,13 @@ fn udp_socket_server_can_send_data_to_client() { #[test] fn udp_socket_client_try_receive_does_not_block() { - let _sut_server = UdpServerBuilder::new() + let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let mut recv_buffer = [0u8; 8]; @@ -197,7 +199,6 @@ fn udp_socket_client_try_receive_does_not_block() { fn udp_socket_server_try_receive_from_does_not_block() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); @@ -210,14 +211,13 @@ fn udp_socket_server_try_receive_from_does_not_block() { #[test] fn udp_socket_client_timed_receive_does_block_for_at_least_timeout() { - let _sut_server = UdpServerBuilder::new() + let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let mut recv_buffer = [0u8; 8]; @@ -230,7 +230,6 @@ fn udp_socket_client_timed_receive_does_block_for_at_least_timeout() { fn udp_socket_server_timed_receive_from_does_block_for_at_least_timeout() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); @@ -249,12 +248,11 @@ fn udp_socket_server_timed_receive_from_does_block_for_at_least_timeout() { fn udp_socket_client_blocking_receive_does_block() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let send_buffer = [12u8, 24u8, 36u8]; @@ -296,12 +294,11 @@ fn udp_socket_client_blocking_receive_does_block() { fn udp_socket_server_blocking_receive_from_does_block() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let barrier_handle = BarrierHandle::new(); @@ -334,12 +331,11 @@ fn udp_socket_server_blocking_receive_from_does_block() { fn udp_socket_client_timed_receive_does_blocks() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let send_buffer = [12u8, 24u8, 36u8]; @@ -381,12 +377,11 @@ fn udp_socket_client_timed_receive_does_blocks() { fn udp_socket_server_timed_receive_from_does_block() { let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) - .port(Port::new(55222)) .listen() .unwrap(); let sut_client = UdpClientBuilder::new(ipv4_address::LOCALHOST) - .connect_to(Port::new(55222)) + .connect_to(sut_server.port()) .unwrap(); let barrier_handle = BarrierHandle::new(); From e5152d9c02a45c3bb623587b76930fdedf50b83c Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Sat, 6 Jan 2024 17:32:34 +0100 Subject: [PATCH 4/5] [#72] Fix test, version in release doc; freebsd setup template in cirrus ci --- .cirrus.yml | 27 ++++++++++++--------- doc/release-notes/iceoryx2-unreleased.md | 2 +- iceoryx2-bb/posix/tests/udp_socket_tests.rs | 13 ++++------ 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6736fb075..250cf7bc8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -84,6 +84,20 @@ iox2_common_build_and_test_no_doc_tests_release_template: &IOX2_COMMON_BUILD_AND <<: *IOX2_COMMON_BUILD_RELEASE test_script: cargo test --release --tests --workspace --no-fail-fast +iox2_freebsd_setup_template: &IOX2_FREEBSD_SETUP + setup_script: + - uname -a + - pkg install -y git llvm + - pw useradd testuser1 + - pw useradd testuser2 + - pw groupadd testgroup1 + - pw groupadd testgroup2 + - kldload mqueuefs + - mkdir -p /mnt/mqueue/ + - mount -t mqueuefs null /mnt/mqueue/ + - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path + - rustup component add clippy rustfmt + # # Filter to run the CI only on the main branch or for pull request to the main branch # @@ -263,18 +277,7 @@ freebsd_x64_stable_debug_task: env: PATH: /root/.cargo/bin:$PATH HOME: /root # must be set manually to '/root' or 'rustup' will throw an error - setup_script: - - uname -a - - pkg install -y git llvm - - pw useradd testuser1 - - pw useradd testuser2 - - pw groupadd testgroup1 - - pw groupadd testgroup2 - - kldload mqueuefs - - mkdir -p /mnt/mqueue/ - - mount -t mqueuefs null /mnt/mqueue/ - - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path - - rustup component add clippy rustfmt + <<: *IOX2_FREEBSD_SETUP set_toolchain_script: rustup default stable <<: *IOX2_CARGO_FMT_AND_CLIPPY <<: *IOX2_COMMON_BUILD_AND_TEST_DEBUG diff --git a/doc/release-notes/iceoryx2-unreleased.md b/doc/release-notes/iceoryx2-unreleased.md index 1cf48e60f..9e51840ec 100644 --- a/doc/release-notes/iceoryx2-unreleased.md +++ b/doc/release-notes/iceoryx2-unreleased.md @@ -18,7 +18,7 @@ ### Refactoring * Rename char in platform to c_char [#54](https://github.com/eclipse-iceoryx/iceoryx2/issues/54) - * Set reasonable rust min version to 1.65 and verify it with additional CI targets [#72](https://github.com/eclipse-iceoryx/iceoryx2/issues/72) + * Set reasonable rust min version to 1.70 and verify it with additional CI targets [#72](https://github.com/eclipse-iceoryx/iceoryx2/issues/72) ### Workflow diff --git a/iceoryx2-bb/posix/tests/udp_socket_tests.rs b/iceoryx2-bb/posix/tests/udp_socket_tests.rs index e3e0b73a5..5e222a73c 100644 --- a/iceoryx2-bb/posix/tests/udp_socket_tests.rs +++ b/iceoryx2-bb/posix/tests/udp_socket_tests.rs @@ -102,14 +102,11 @@ fn udp_socket_when_socket_goes_out_of_scope_address_is_free_again() { #[test] fn udp_socket_server_has_correct_address() { - let port; - { - let sut_server_1 = UdpServerBuilder::new() - .address(ipv4_address::LOCALHOST) - .listen() - .unwrap(); - port = sut_server_1.port(); - } + let port = UdpServerBuilder::new() + .address(ipv4_address::LOCALHOST) + .listen() + .unwrap() + .port(); let sut_server = UdpServerBuilder::new() .address(ipv4_address::LOCALHOST) From 44757f4b39827483ff2ebc9fdbc5ee831a08eae4 Mon Sep 17 00:00:00 2001 From: Christian Eltzschig Date: Sun, 7 Jan 2024 22:38:05 +0100 Subject: [PATCH 5/5] [#72] Fix deadlock in condition variable doc example --- iceoryx2-bb/posix/src/condition_variable.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/iceoryx2-bb/posix/src/condition_variable.rs b/iceoryx2-bb/posix/src/condition_variable.rs index 47420edd8..6535737f5 100644 --- a/iceoryx2-bb/posix/src/condition_variable.rs +++ b/iceoryx2-bb/posix/src/condition_variable.rs @@ -554,12 +554,17 @@ pub trait BasicConditionVariableInterface: /// // apply clojure, set value to 4008 and then trigger waiters /// cv.modify_notify_all(|value| { *value = 4008 }).expect("failed to notify"); /// -/// // acquire guard to the underlying value without triggering the condition variable -/// let mut guard = cv.lock().expect("failed to acquire value"); -/// // read the underlying value -/// println!("current value is {}", *guard); -/// // set the underlying value to 5000 -/// *guard = 5000; +/// { +/// // acquire guard to the underlying value without triggering the condition variable +/// let mut guard = cv.lock().expect("failed to acquire value"); +/// // read the underlying value +/// println!("current value is {}", *guard); +/// // set the underlying value to 5000 +/// *guard = 5000; +/// } +/// +/// // trigger condition variable manually +/// cv.trigger_all(); /// }); /// /// ```