From 758d551a3eb7dc8881e9c650ad0e6ad3dc9fb98a Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 11:10:17 +0000 Subject: [PATCH 01/10] dev container: remove duplicate entry cargo audit was being installed twice Signed-off-by: Pedro Ferreira --- .devcontainer/scripts/common/rust/install-rust.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/scripts/common/rust/install-rust.sh b/.devcontainer/scripts/common/rust/install-rust.sh index fbab8779..253388cd 100755 --- a/.devcontainer/scripts/common/rust/install-rust.sh +++ b/.devcontainer/scripts/common/rust/install-rust.sh @@ -25,5 +25,4 @@ cargo binstall cargo-outdated --locked cargo binstall cargo-machete --locked cargo binstall cargo-deny --locked -cargo binstall cargo-audit --locked cargo binstall cargo-nextest --locked From b957cff94992a15c03d129b04f060fb5cab52a72 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 16:15:19 +0000 Subject: [PATCH 02/10] dev container: set the root path for rust analyzer Signed-off-by: Pedro Ferreira --- .devcontainer/almalinux/devcontainer.json | 5 ++++- .devcontainer/amazonlinux/devcontainer.json | 5 ++++- .devcontainer/debiantrixie/devcontainer.json | 5 ++++- .devcontainer/ubuntu20/devcontainer.json | 5 ++++- .devcontainer/ubuntu22/devcontainer.json | 5 ++++- .devcontainer/ubuntu24/devcontainer.json | 5 ++++- .devcontainer/ubuntu25/devcontainer.json | 5 ++++- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.devcontainer/almalinux/devcontainer.json b/.devcontainer/almalinux/devcontainer.json index 252bbf68..72c16e5c 100644 --- a/.devcontainer/almalinux/devcontainer.json +++ b/.devcontainer/almalinux/devcontainer.json @@ -38,7 +38,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, diff --git a/.devcontainer/amazonlinux/devcontainer.json b/.devcontainer/amazonlinux/devcontainer.json index 2610a3e6..9a12fd37 100644 --- a/.devcontainer/amazonlinux/devcontainer.json +++ b/.devcontainer/amazonlinux/devcontainer.json @@ -42,7 +42,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, diff --git a/.devcontainer/debiantrixie/devcontainer.json b/.devcontainer/debiantrixie/devcontainer.json index 684157d1..c3085b13 100644 --- a/.devcontainer/debiantrixie/devcontainer.json +++ b/.devcontainer/debiantrixie/devcontainer.json @@ -38,7 +38,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, diff --git a/.devcontainer/ubuntu20/devcontainer.json b/.devcontainer/ubuntu20/devcontainer.json index e7783184..cb10c067 100644 --- a/.devcontainer/ubuntu20/devcontainer.json +++ b/.devcontainer/ubuntu20/devcontainer.json @@ -40,7 +40,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, diff --git a/.devcontainer/ubuntu22/devcontainer.json b/.devcontainer/ubuntu22/devcontainer.json index 02c77d4d..fdc217ec 100644 --- a/.devcontainer/ubuntu22/devcontainer.json +++ b/.devcontainer/ubuntu22/devcontainer.json @@ -40,7 +40,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, diff --git a/.devcontainer/ubuntu24/devcontainer.json b/.devcontainer/ubuntu24/devcontainer.json index 52f08331..57789ef2 100644 --- a/.devcontainer/ubuntu24/devcontainer.json +++ b/.devcontainer/ubuntu24/devcontainer.json @@ -40,7 +40,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, diff --git a/.devcontainer/ubuntu25/devcontainer.json b/.devcontainer/ubuntu25/devcontainer.json index 87ea80b5..d69f9d4b 100644 --- a/.devcontainer/ubuntu25/devcontainer.json +++ b/.devcontainer/ubuntu25/devcontainer.json @@ -40,7 +40,10 @@ "editor.formatOnSave": true, "[cpp]": { "editor.defaultFormatter": "xaver.clang-format" - } + }, + "rust-analyzer.linkedProjects": [ + "${workspaceFolder}/rust/Cargo.toml" + ] } } }, From 81adbdc4ac1a5c4add770d6b77ed28ee0e432872 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 15:00:49 +0000 Subject: [PATCH 03/10] rust: fix clippy lints Signed-off-by: Pedro Ferreira --- rust/mxl/examples/flow-reader.rs | 18 ++++++++---------- rust/mxl/examples/flow-writer.rs | 20 ++++++++++---------- rust/mxl/tests/basic_tests.rs | 6 +++--- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/rust/mxl/examples/flow-reader.rs b/rust/mxl/examples/flow-reader.rs index 60987c87..7f0e89eb 100644 --- a/rust/mxl/examples/flow-reader.rs +++ b/rust/mxl/examples/flow-reader.rs @@ -95,17 +95,15 @@ fn read_samples( ); } batch_size as usize - } else { - if continous_flow_info.commitBatchSize == 0 { - let batch_size = (sample_rate.numerator / (100 * sample_rate.denominator)) as usize; - warn!( - "Writer batch size not available, using fallback value of {}.", - batch_size - ); + } else if continous_flow_info.commitBatchSize == 0 { + let batch_size = (sample_rate.numerator / (100 * sample_rate.denominator)) as usize; + warn!( + "Writer batch size not available, using fallback value of {}.", batch_size - } else { - continous_flow_info.commitBatchSize as usize - } + ); + batch_size + } else { + continous_flow_info.commitBatchSize as usize }; let mut read_head = reader.get_info()?.continuous_flow_info()?.headIndex; let mut read_head_valid_at = mxl_instance.get_time(); diff --git a/rust/mxl/examples/flow-writer.rs b/rust/mxl/examples/flow-writer.rs index 7f369c80..44031212 100644 --- a/rust/mxl/examples/flow-writer.rs +++ b/rust/mxl/examples/flow-writer.rs @@ -88,8 +88,8 @@ pub fn write_grains( let mut grain_writer_access = writer.open_grain(grain_index)?; let payload = grain_writer_access.payload_mut(); let payload_len = payload.len(); - for i in 0..payload_len { - payload[i] = ((i as u64 + grain_index) % 256) as u8; + for (i, byte) in payload.iter_mut().enumerate() { + *byte = ((i as u64 + grain_index) % 256) as u8; } grain_writer_access.commit(payload_len as u32)?; @@ -130,10 +130,10 @@ pub fn write_samples( let mut remaining_samples = sample_count; loop { - if let Some(count) = remaining_samples { - if count == 0 { - break; - } + if let Some(count) = remaining_samples + && count == 0 + { + break; } let samples_to_write = u64::min(batch_size, remaining_samples.unwrap_or(u64::MAX)); if let Some(count) = remaining_samples { @@ -144,12 +144,12 @@ pub fn write_samples( let mut writing_sample_index = samples_index - batch_size + 1; for channel in 0..samples_write_access.channels() { let (data_1, data_2) = samples_write_access.channel_data_mut(channel)?; - for i in 0..data_1.len() { - data_1[i] = (writing_sample_index % 256) as u8; + for sample in data_1.iter_mut() { + *sample = (writing_sample_index % 256) as u8; writing_sample_index += 1; } - for i in 0..data_2.len() { - data_2[i] = (writing_sample_index % 256) as u8; + for sample in data_2.iter_mut() { + *sample = (writing_sample_index % 256) as u8; writing_sample_index += 1; } } diff --git a/rust/mxl/tests/basic_tests.rs b/rust/mxl/tests/basic_tests.rs index 003952a3..c153ce8b 100644 --- a/rust/mxl/tests/basic_tests.rs +++ b/rust/mxl/tests/basic_tests.rs @@ -42,7 +42,8 @@ fn setup_test(test: &str) -> mxl::MxlInstance { fn read_flow_def>(path: P) -> String { let flow_config_file = mxl::config::get_mxl_repo_root().join(path); - let flow_def = std::fs::read_to_string(flow_config_file.as_path()) + + std::fs::read_to_string(flow_config_file.as_path()) .map_err(|error| { mxl::Error::Other(format!( "Error while reading flow definition from \"{}\": {}", @@ -50,8 +51,7 @@ fn read_flow_def>(path: P) -> String { error )) }) - .unwrap(); - flow_def + .unwrap() } fn prepare_flow_info>( From 4cb659451de9e01bf2fad822b98265b5907fb12c Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 15:01:15 +0000 Subject: [PATCH 04/10] rust: add license to nextest config Signed-off-by: Pedro Ferreira --- rust/.config/nextest.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/.config/nextest.toml b/rust/.config/nextest.toml index 6a109e17..d7db88de 100644 --- a/rust/.config/nextest.toml +++ b/rust/.config/nextest.toml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2025 2025 Contributors to the Media eXchange Layer project. +# SPDX-License-Identifier: Apache-2.0 + [profile.ci] fail-fast = false From ea7e80259f00d96c2618b72a205dd587333a7da6 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 16:57:19 +0000 Subject: [PATCH 05/10] rust: upgrade tracing-subscriber cargo audit complained about RUSTSEC-2025-0055 Signed-off-by: Pedro Ferreira --- rust/Cargo.lock | 137 +++++++++++++++++++++++++++++++++--------------- rust/Cargo.toml | 2 +- 2 files changed, 95 insertions(+), 44 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index eda5e2d4..9ea4d3b8 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -221,7 +221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets", + "windows-targets 0.53.2", ] [[package]] @@ -232,11 +232,11 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] @@ -284,12 +284,11 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.46.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" dependencies = [ - "overload", - "winapi", + "windows-sys", ] [[package]] @@ -298,12 +297,6 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - [[package]] name = "pin-project-lite" version = "0.2.16" @@ -346,17 +339,8 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] @@ -367,15 +351,9 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -501,14 +479,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "sharded-slab", "smallvec", "thread_local", @@ -625,64 +603,137 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + [[package]] name = "windows-targets" version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_aarch64_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + [[package]] name = "windows_i686_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_i686_msvc" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnu" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_gnullvm" version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "windows_x86_64_msvc" version = "0.53.0" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index d986b3aa..3a030638 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -20,7 +20,7 @@ dlopen2 = "0.8" futures = "0.3" thiserror = "2.0.12" tracing = { version = "0.1", features = ["log"] } -tracing-subscriber = { version = "0.3", features = ["env-filter", "std"] } +tracing-subscriber = { version = "0.3.20", features = ["env-filter", "std"] } uuid = { version = "1.17" } [workspace.dependencies.clap] From 19eefd75e0f72ec6b04b2915836ba2c89ec66b6b Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 16:58:28 +0000 Subject: [PATCH 06/10] rust: add version to Cargo.toml Signed-off-by: Pedro Ferreira --- rust/mxl-sys/Cargo.toml | 1 + rust/mxl/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/rust/mxl-sys/Cargo.toml b/rust/mxl-sys/Cargo.toml index 58e1dbf1..1da42252 100644 --- a/rust/mxl-sys/Cargo.toml +++ b/rust/mxl-sys/Cargo.toml @@ -6,6 +6,7 @@ name = "mxl-sys" edition.workspace = true publish.workspace = true version.workspace = true +license.workspace = true [dependencies] diff --git a/rust/mxl/Cargo.toml b/rust/mxl/Cargo.toml index 325c59ec..ca640489 100644 --- a/rust/mxl/Cargo.toml +++ b/rust/mxl/Cargo.toml @@ -6,6 +6,7 @@ name = "mxl" edition.workspace = true publish.workspace = true version.workspace = true +license.workspace = true [dependencies] mxl-sys = { path = "../mxl-sys" } From 78d047f3b0bc22e3cbf9798304f5ff116e7fd2fc Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 17:06:24 +0000 Subject: [PATCH 07/10] rust: add a config file for cargo deny Asked on Slack for guidance regarding which licenses should be accepted. Signed-off-by: Pedro Ferreira --- rust/deny.toml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 rust/deny.toml diff --git a/rust/deny.toml b/rust/deny.toml new file mode 100644 index 00000000..d8a4044e --- /dev/null +++ b/rust/deny.toml @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project. +# SPDX-License-Identifier: Apache-2.0 + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Unicode-3.0", + "BSD-3-Clause", + "ISC" +] From ee04b9e3b2d3e1f9ba1c599891a4a986270ce5ed Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 14:33:02 +0100 Subject: [PATCH 08/10] ci: create the rust target directory Signed-off-by: Pedro Ferreira --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a0332d8..79879a97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,6 +87,9 @@ jobs: mkdir -p ${{ github.workspace }}/install chmod 777 ${{ github.workspace }}/install chmod g+s ${{ github.workspace }}/install + mkdir -p ${{ github.workspace }}/rust/target + chmod 777 ${{ github.workspace }}/rust/target + chmod g+s ${{ github.workspace }}/rust/target - name: Build Docker image if: steps.check-image.outputs.exists == 'false' From 2d08debeacf18d921e91d3355edff2b037ef8fcb Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 16:17:07 +0000 Subject: [PATCH 09/10] ci: add rust tasks Signed-off-by: Pedro Ferreira --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79879a97..123008a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -165,6 +165,53 @@ jobs: ctest --output-junit test-results.xml " + - name: Cache Cargo registry + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo-lint- + + - name: Check the Rust bindings + env: + RUSTFLAGS: "-Dwarnings" + run: | + docker run --mount src=${{ github.workspace }},target=/workspace/mxl,type=bind \ + -i mxl_build_container_with_source \ + bash -c " + cd /workspace/mxl/rust && \ + cargo fmt -- --check && \ + cargo clippy --all-targets --all-features --locked -- -D warnings && \ + cargo audit && \ + cargo outdated && \ + cargo machete && \ + cargo deny check all + " + + - name: Build Rust bindings + run: | + docker run --mount src=${{ github.workspace }},target=/workspace/mxl,type=bind \ + -i mxl_build_container_with_source \ + bash -c " + cd /workspace/mxl/rust && \ + cargo build --all-targets --locked && \ + cargo build --release --all-targets --locked + " + + - name: Test the Rust bindings + run: | + docker run --mount src=${{ github.workspace }},target=/workspace/mxl,type=bind \ + -i mxl_build_container_with_source \ + bash -c " + cd /workspace/mxl/rust && \ + cargo nextest run --release --locked + " + - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: always() From 56975241daf08d3e8c11a2110b811c4404de7144 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Wed, 1 Oct 2025 17:05:13 +0000 Subject: [PATCH 10/10] ci: delete the original rust workflow Signed-off-by: Pedro Ferreira --- .github/workflows/rust.yml | 146 ------------------------------------- 1 file changed, 146 deletions(-) delete mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index a2fa3889..00000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,146 +0,0 @@ -# SPDX-FileCopyrightText: 2025 Contributors to the Media eXchange Layer project. -# SPDX-License-Identifier: Apache-2.0 - -name: Test the rust bindings - -on: - pull_request: - workflow_dispatch: - workflow_call: # We would like this to be called by the main job - -jobs: - dependencies: - name: Check Rust dependencies - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./rust - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-deps-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-cargo-deps- - - name: Use Rust stable 1.88 - uses: dtolnay/rust-toolchain@1.88.0 - - name: Install cargo audit - uses: baptiste0928/cargo-install@v3 - with: - crate: cargo-audit - - name: Install cargo outdated - uses: baptiste0928/cargo-install@v3 - with: - crate: cargo-outdated - - name: Install cargo udeps - uses: baptiste0928/cargo-install@v3 - with: - crate: cargo-udeps - - name: Install cargo deny - uses: baptiste0928/cargo-install@v3 - with: - crate: cargo-deny - - name: Audit dependencies - run: cargo audit -D warnings - - name: Outdated dependencies - run: cargo outdated -d 1 -w --exit-code 1 - - name: Install nightly-2025-06-26 # Same date as 1.88 release - uses: dtolnay/rust-toolchain@nightly - with: - toolchain: nightly-2025-06-26 - - name: Unused depedency check - run: cargo udeps --all-targets - - lint: - name: Perform Rust linting and documentation - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./rust - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-lint-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-cargo-lint- - - name: Use Rust stable 1.88 - uses: dtolnay/rust-toolchain@1.88.0 - with: - components: rustfmt, clippy - - name: build - run: cargo build --locked - - name: Format - run: cargo fmt -- --check - - name: Docs - run: cargo doc --all-features - env: - RUSTDOCFLAGS: "-D warnings" - - name: Clippy - run: cargo clippy --all-targets -F mxl-not-built -- -D warnings - - tests: - name: Run the tests - runs-on: ubuntu-latest - defaults: - run: - working-directory: ./rust - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-tests-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-cargo-tests- - - name: Use Rust stable 1.88 - uses: dtolnay/rust-toolchain@1.88.0 - with: - components: rustfmt, clippy - - name: build - run: cargo build --locked -F mxl-not-built - - name: Test - run: cargo test --locked -F mxl-not-built - - name: Coverage - run: > - cargo llvm-cov --ignore-filename-regex "build.rs|ffi.rs|(.*)_test.rs" - --lcov --output-path lcov.info - - name: Report Coverage - uses: romeovs/lcov-reporter-action@v0.4.0 - if: ${{ github.event_name == 'pull_request' }} - with: - lcov-file: ./lcov.info - github-token: ${{ secrets.GITHUB_TOKEN }} - delete-old-comments: true