From 5324cd129b12ddcdbf2a4d8270139eb816ce6fc5 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 20 Dec 2024 19:24:22 +0100 Subject: [PATCH 1/6] [#3] Control Cirrus CI via global variable --- .cirrus.yml | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 4f7a2a157..e3c8e8399 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -12,6 +12,20 @@ --- +# +# Global environment variables +# + +env: + CI_ENABLED: true + # RUSTFLAGS: "-C debug-assertions" + +# +# Filter to run the CI only on the main branch or for pull request to the main branch +# + +only_if: $CI_ENABLED && ( $CIRRUS_BRANCH == 'main' || ($CIRRUS_PR != '' && $CIRRUS_BASE_BRANCH == 'main')) + # # Templates # @@ -130,19 +144,6 @@ iox2_freebsd_setup_template: &IOX2_FREEBSD_SETUP - 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 -# - -only_if: false && ( $CIRRUS_BRANCH == 'main' || ($CIRRUS_PR != '' && $CIRRUS_BASE_BRANCH == 'main')) - -# -# Global environment variables -# - -# env: - # RUSTFLAGS: "-C debug-assertions" - # # Preflight-Check with Ubuntu x86 stable debug # From 0134f4371fc8b45d2728a7308fe0d75c0164ac57 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 20 Dec 2024 19:35:51 +0100 Subject: [PATCH 2/6] [#3] Optimize C and C++ binding build on cirrus CI --- .cirrus.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index e3c8e8399..0b566dd63 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -107,7 +107,7 @@ iox2_common_build_and_test_no_doc_tests_release_template: &IOX2_COMMON_BUILD_AND iox2_ffi_common_debug_template: &IOX2_FFI_COMMON_DEBUG ffi_script: - ./internal/scripts/ci_build_and_install_iceoryx_hoofs.sh - - cmake -S . -B target/ffi/build -DCMAKE_BUILD_TYPE=Debug -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=target/ffi/install -DCMAKE_INSTALL_PREFIX="$( pwd )/target/iceoryx/install" + - cmake -S . -B target/ffi/build -DCMAKE_BUILD_TYPE=Debug -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=target/ffi/install -DCMAKE_INSTALL_PREFIX="$( pwd )/target/iceoryx/install" -DRUST_BUILD_ARTIFACT_PATH="$( pwd )/target/debug" - cmake --build target/ffi/build - cmake --install target/ffi/build - target/ffi/build/tests/iceoryx2-c-tests @@ -120,7 +120,7 @@ iox2_ffi_common_debug_template: &IOX2_FFI_COMMON_DEBUG iox2_ffi_common_release_template: &IOX2_FFI_COMMON_RELEASE ffi_script: - ./internal/scripts/ci_build_and_install_iceoryx_hoofs.sh - - cmake -S . -B target/ffi/build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=target/ffi/install -DCMAKE_INSTALL_PREFIX="$( pwd )/target/iceoryx/install" + - cmake -S . -B target/ffi/build -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=ON -DBUILD_TESTING=ON -DCMAKE_INSTALL_PREFIX=target/ffi/install -DCMAKE_INSTALL_PREFIX="$( pwd )/target/iceoryx/install" -DRUST_BUILD_ARTIFACT_PATH="$( pwd )/target/release" - cmake --build target/ffi/build - cmake --install target/ffi/build - target/ffi/build/tests/iceoryx2-c-tests From 9097a542495d1769407c5aa3b47f663d70e9f84c Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 20 Dec 2024 19:58:09 +0100 Subject: [PATCH 3/6] [#3] Update clang toolchain in docker container --- internal/docker/ubuntu-22.04 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/docker/ubuntu-22.04 b/internal/docker/ubuntu-22.04 index d47403418..0090f4e8e 100644 --- a/internal/docker/ubuntu-22.04 +++ b/internal/docker/ubuntu-22.04 @@ -19,11 +19,11 @@ RUN echo "#### Installing dependencies" \ wget \ && wget -P /tmp https://apt.llvm.org/llvm-snapshot.gpg.key \ && apt-key add /tmp/llvm-snapshot.gpg.key \ - && add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" \ + && add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main" \ && apt install -y \ - clang-18 \ - clang-format-18 \ - clang-tidy-18 \ + clang-19 \ + clang-format-19 \ + clang-tidy-19 \ cmake \ curl \ gcc \ @@ -31,10 +31,10 @@ RUN echo "#### Installing dependencies" \ libacl1-dev \ && rm -rf /var/lib/apt/lists/* \ && apt clean \ - && ln -s /usr/bin/clang-18 /usr/bin/clang \ - && ln -s /usr/bin/clang++-18 /usr/bin/clang++ \ - && ln -s /usr/bin/clang-tidy-18 /usr/bin/clang-tidy \ - && ln -s /usr/bin/clang-format-18 /usr/bin/clang-format \ + && ln -s /usr/bin/clang-19 /usr/bin/clang \ + && ln -s /usr/bin/clang++-19 /usr/bin/clang++ \ + && ln -s /usr/bin/clang-tidy-19 /usr/bin/clang-tidy \ + && ln -s /usr/bin/clang-format-19 /usr/bin/clang-format \ && echo "#### Install minimal Rust toolchain" \ && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path \ && echo "#### Adding beta and nightly toolchain" \ From 64ade9e74156f67500cd7c9ad8059a0b9298d33e Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 20 Dec 2024 20:34:43 +0100 Subject: [PATCH 4/6] [#3] Detect github draft PRs --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 0b566dd63..4ce7a20d1 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -24,7 +24,7 @@ env: # Filter to run the CI only on the main branch or for pull request to the main branch # -only_if: $CI_ENABLED && ( $CIRRUS_BRANCH == 'main' || ($CIRRUS_PR != '' && $CIRRUS_BASE_BRANCH == 'main')) +only_if: $CI_ENABLED && !$CIRRUS_PR_DRAFT && ( $CIRRUS_BRANCH == 'main' || ($CIRRUS_PR != '' && $CIRRUS_BASE_BRANCH == 'main')) # # Templates From a958974256fe72c51b899b7469fabe43d27684a3 Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 20 Dec 2024 22:22:26 +0100 Subject: [PATCH 5/6] [#3] Update dependency --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2638b9027..53483ef9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -504,9 +504,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -828,7 +828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", ] [[package]] From 244ab2161f6b27151872a64d245b84aee0d68e3b Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Fri, 20 Dec 2024 22:30:22 +0100 Subject: [PATCH 6/6] [#3] Update cbindgen to get rid of unmaintained 'atty' dependency --- Cargo.lock | 163 ++++++++--------------------------------------------- Cargo.toml | 2 +- 2 files changed, 24 insertions(+), 141 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53483ef9d..415ac4c86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,23 +87,6 @@ version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - [[package]] name = "backtrace" version = "0.3.74" @@ -129,7 +112,7 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" name = "benchmark-event" version = "0.4.1" dependencies = [ - "clap 4.5.19", + "clap", "iceoryx2", "iceoryx2-bb-log", "iceoryx2-bb-posix", @@ -139,7 +122,7 @@ dependencies = [ name = "benchmark-publish-subscribe" version = "0.4.1" dependencies = [ - "clap 4.5.19", + "clap", "iceoryx2", "iceoryx2-bb-container", "iceoryx2-bb-log", @@ -150,7 +133,7 @@ dependencies = [ name = "benchmark-queue" version = "0.4.1" dependencies = [ - "clap 4.5.19", + "clap", "iceoryx2-bb-lock-free", "iceoryx2-bb-posix", ] @@ -171,7 +154,7 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.6.0", + "bitflags", "cexpr", "clang-sys", "itertools", @@ -188,12 +171,6 @@ dependencies = [ "which", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -243,21 +220,21 @@ dependencies = [ [[package]] name = "cbindgen" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" +checksum = "3fce8dd7fcfcbf3a0a87d8f515194b49d6135acab73e18bd380d1d93bb1a15eb" dependencies = [ - "clap 3.2.25", + "clap", "heck 0.4.1", - "indexmap 1.9.3", + "indexmap", "log", "proc-macro2", "quote", "serde", "serde_json", - "syn 1.0.109", + "syn 2.0.79", "tempfile", - "toml 0.5.11", + "toml", ] [[package]] @@ -305,21 +282,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "strsim 0.10.0", - "termcolor", - "textwrap", -] - [[package]] name = "clap" version = "4.5.19" @@ -338,8 +300,8 @@ checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.2", - "strsim 0.11.1", + "clap_lex", + "strsim", ] [[package]] @@ -354,15 +316,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "clap_lex" version = "0.7.2" @@ -449,7 +402,7 @@ dependencies = [ name = "example" version = "0.4.1" dependencies = [ - "clap 4.5.19", + "clap", "iceoryx2", "iceoryx2-bb-container", "iceoryx2-bb-log", @@ -496,12 +449,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.15.2" @@ -520,15 +467,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "home" version = "0.5.9" @@ -550,7 +488,7 @@ dependencies = [ "os_info", "serde", "serde_derive", - "toml 0.8.19", + "toml", "uuid", ] @@ -575,7 +513,7 @@ dependencies = [ "serde", "sha1_smol", "tiny-fn", - "toml 0.8.19", + "toml", ] [[package]] @@ -653,7 +591,7 @@ dependencies = [ name = "iceoryx2-bb-posix" version = "0.4.1" dependencies = [ - "bitflags 2.6.0", + "bitflags", "enum-iterator", "generic-tests", "iceoryx2-bb-container", @@ -735,7 +673,7 @@ dependencies = [ "serde", "sha1_smol", "tiny-fn", - "toml 0.8.19", + "toml", ] [[package]] @@ -745,7 +683,7 @@ dependencies = [ "anyhow", "better-panic", "cargo_metadata", - "clap 4.5.19", + "clap", "colored", "human-panic", "iceoryx2", @@ -811,16 +749,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.6.0" @@ -828,7 +756,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown", ] [[package]] @@ -949,12 +877,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "ouroboros" version = "0.18.4" @@ -1063,7 +985,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64", - "bitflags 2.6.0", + "bitflags", "serde", "serde_derive", ] @@ -1086,7 +1008,7 @@ version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -1164,7 +1086,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.6.0", + "indexmap", "itoa", "ryu", "serde", @@ -1189,12 +1111,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -1236,15 +1152,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "termsize" version = "0.1.9" @@ -1255,12 +1162,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "textwrap" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" - [[package]] name = "thiserror" version = "1.0.64" @@ -1287,15 +1188,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fde9a76dac5751480f711f327371c809d7f8a9f036436e6237d67859adbf3bd" -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.8.19" @@ -1323,7 +1215,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -1428,15 +1320,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index a48040323..0a9840350 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ anyhow = { version = "1.0.86" } bindgen = { version = "0.69.4" } bitflags = { version = "2.5.0" } cargo_metadata = { version = "0.18.1" } -cbindgen = { version = "0.26.0" } +cbindgen = { version = "0.27.0" } cc = { version = "1.0.98" } cdr = { version = "0.2.4" } clap = { version = "4.5.4", features = ["derive"] }