From 2555fd4039c6d0f0148398d66b5e2acd99832a5b Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Tue, 25 Mar 2025 13:45:02 +0100 Subject: [PATCH 1/3] Cargo.toml: We moved to edition 2024, drop = from fts-sys --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a0fd3f19d..0c167c0a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -292,8 +292,7 @@ file_diff = "1.0.0" filetime = "0.2.23" fnv = "1.0.7" fs_extra = "1.3.0" -# Remove the "=" once we moved to Rust edition 2024 -fts-sys = "=0.2.16" +fts-sys = "0.2.16" fundu = "2.0.0" gcd = "2.3" glob = "0.3.1" From 59396e32bc3d20917a2cdebdb048024fde6e3d9e Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Tue, 25 Mar 2025 19:51:27 +0100 Subject: [PATCH 2/3] chcon/runcon: Only build on Linux chcon/runcon rely on the selinux crate, that is empty on non-Linux platforms. This doesn't matter for normal builds that use the default features for the platform (explicitly trying to build them will fail though). This is a problem when using `cargo test --workspace` though, as that tries to build all packages, including uu_chcon/uu_runcon. Just prevent compilation of these source files when target_os != linux. --- src/uu/chcon/src/chcon.rs | 1 + src/uu/chcon/src/errors.rs | 2 ++ src/uu/chcon/src/fts.rs | 2 ++ src/uu/chcon/src/main.rs | 1 + src/uu/runcon/src/errors.rs | 2 ++ src/uu/runcon/src/main.rs | 1 + src/uu/runcon/src/runcon.rs | 1 + 7 files changed, 10 insertions(+) diff --git a/src/uu/chcon/src/chcon.rs b/src/uu/chcon/src/chcon.rs index 366675019..1ef22f0fd 100644 --- a/src/uu/chcon/src/chcon.rs +++ b/src/uu/chcon/src/chcon.rs @@ -3,6 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. // spell-checker:ignore (vars) RFILE +#![cfg(target_os = "linux")] #![allow(clippy::upper_case_acronyms)] use clap::builder::ValueParser; diff --git a/src/uu/chcon/src/errors.rs b/src/uu/chcon/src/errors.rs index 10d5735a0..b8f720a39 100644 --- a/src/uu/chcon/src/errors.rs +++ b/src/uu/chcon/src/errors.rs @@ -2,6 +2,8 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#![cfg(target_os = "linux")] + use std::ffi::OsString; use std::fmt::Write; use std::io; diff --git a/src/uu/chcon/src/fts.rs b/src/uu/chcon/src/fts.rs index a81cb39b6..30650fbf5 100644 --- a/src/uu/chcon/src/fts.rs +++ b/src/uu/chcon/src/fts.rs @@ -2,6 +2,8 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#![cfg(target_os = "linux")] + use std::ffi::{CStr, CString, OsStr}; use std::marker::PhantomData; use std::os::raw::{c_int, c_long, c_short}; diff --git a/src/uu/chcon/src/main.rs b/src/uu/chcon/src/main.rs index d93d7d1da..d1354d840 100644 --- a/src/uu/chcon/src/main.rs +++ b/src/uu/chcon/src/main.rs @@ -1 +1,2 @@ +#![cfg(target_os = "linux")] uucore::bin!(uu_chcon); diff --git a/src/uu/runcon/src/errors.rs b/src/uu/runcon/src/errors.rs index cbb7dc9ae..4b4a9e1e6 100644 --- a/src/uu/runcon/src/errors.rs +++ b/src/uu/runcon/src/errors.rs @@ -2,6 +2,8 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. +#![cfg(target_os = "linux")] + use std::ffi::OsString; use std::fmt::{Display, Formatter, Write}; use std::io; diff --git a/src/uu/runcon/src/main.rs b/src/uu/runcon/src/main.rs index 1d3cef4cb..ab4c4b159 100644 --- a/src/uu/runcon/src/main.rs +++ b/src/uu/runcon/src/main.rs @@ -1 +1,2 @@ +#![cfg(target_os = "linux")] uucore::bin!(uu_runcon); diff --git a/src/uu/runcon/src/runcon.rs b/src/uu/runcon/src/runcon.rs index ed45576a9..82ce7da48 100644 --- a/src/uu/runcon/src/runcon.rs +++ b/src/uu/runcon/src/runcon.rs @@ -3,6 +3,7 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. // spell-checker:ignore (vars) RFILE +#![cfg(target_os = "linux")] use clap::builder::ValueParser; use uucore::error::{UClapError, UError, UResult}; From 78a006e1a1f36f8adba086a814c979ae98b39a3e Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Tue, 25 Mar 2025 13:47:03 +0100 Subject: [PATCH 3/3] ci: Enable workspace tests on MacOS --- .github/workflows/CICD.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index ab291fc7e..df6d602ed 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -520,8 +520,8 @@ jobs: - { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , features: "feat_os_unix,uudoc" , use-cross: no, workspace-tests: true } - { os: ubuntu-latest , target: x86_64-unknown-linux-musl , features: feat_os_unix_musl , use-cross: use-cross } - { os: ubuntu-latest , target: x86_64-unknown-redox , features: feat_os_unix_redox , use-cross: redoxer , skip-tests: true } - - { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos } # M1 CPU - - { os: macos-13 , target: x86_64-apple-darwin , features: feat_os_macos } + - { os: macos-latest , target: aarch64-apple-darwin , features: feat_os_macos, workspace-tests: true } # M1 CPU + - { os: macos-13 , target: x86_64-apple-darwin , features: feat_os_macos, workspace-tests: true } - { os: windows-latest , target: i686-pc-windows-msvc , features: feat_os_windows } - { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows } - { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }