Skip to content

Commit

Permalink
Merge pull request #75 from elfenpiff/iox2-72-reduce-rust-version-to-…
Browse files Browse the repository at this point in the history
…minimum-required

[#72] reduce rust version to minimum required
  • Loading branch information
elfenpiff authored Jan 8, 2024
2 parents be9b18f + 44757f4 commit f7fe00c
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 158 deletions.
65 changes: 53 additions & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -119,6 +133,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
Expand Down Expand Up @@ -154,6 +175,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
Expand Down Expand Up @@ -232,24 +260,24 @@ 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
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
Expand All @@ -260,6 +288,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
Expand Down
130 changes: 28 additions & 102 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.70"
version = "0.1.1"

[workspace.dependencies]
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 @@ -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.70 and verify it with additional CI targets [#72](https://github.com/eclipse-iceoryx/iceoryx2/issues/72)

### Workflow

Expand Down
17 changes: 11 additions & 6 deletions iceoryx2-bb/posix/src/condition_variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,17 @@ pub trait BasicConditionVariableInterface<T: Debug>:
/// // 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();
/// });
///
/// ```
Expand Down
Loading

0 comments on commit f7fe00c

Please sign in to comment.