mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
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.
This commit is contained in:
parent
2555fd4039
commit
59396e32bc
7 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
#![cfg(target_os = "linux")]
|
||||
uucore::bin!(uu_chcon);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
#![cfg(target_os = "linux")]
|
||||
uucore::bin!(uu_runcon);
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue