From 55a5b54bf293f37f0ac0d89e6b8b17f75068ab4f Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 2 May 2022 11:08:07 -0700 Subject: [PATCH] base: clean up vestigal sys_util references The sys_util crate has been merged into base, but a few places still refer to the old name. Fix or remove them as appropriate. BUG=b:227226222 TEST=tools/presubmit --all Change-Id: Icf9b57aff672b7c1afec768c9694e059f0f9a43d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3621205 Tested-by: kokoro Commit-Queue: Daniel Verkamp Reviewed-by: Dennis Kempin --- ARCHITECTURE.md | 4 +--- Cargo.toml | 3 --- base/src/sys/unix/mod.rs | 5 ----- base/src/syslog.rs | 2 +- cros_async/src/sys/windows/executor.rs | 2 +- tools/impl/test_config.py | 3 --- 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index d8c7505e64..fef287edb3 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -194,8 +194,7 @@ Source code is organized into crates, each with their own unit tests. - `./src/` - The top-level binary front-end for using crosvm. - `aarch64` - Support code specific to 64 bit ARM architectures. -- `base` - Safe wrappers for small system facilities which provides cross-platform-compatible - interfaces. For Linux, this is basically a thin wrapper of `sys_util`. +- `base` - Safe wrappers for system facilities which provides cross-platform-compatible interfaces. - `bin` - Scripts for code health such as wrappers of `rustfmt` and `clippy`. - `ci` - Scripts for continuous integration. - `cros_async` - Runtime for async/await programming. This crate provides a `Future` executor based @@ -217,7 +216,6 @@ Source code is organized into crates, each with their own unit tests. - `seccomp` - Contains minijail seccomp policy files for each sandboxed device. Because some syscalls vary by architecture, the seccomp policies are split by architecture. - `sync` - Our version of `std::sync::Mutex` and `std::sync::Condvar`. -- `sys_util` - Mostly safe wrappers for small system facilities such as `eventfd` or `syslog`. - `third_party` - Third-party libraries which we are maintaining on the Chrome OS tree or the AOSP tree. - `vfio_sys` - Low-level (mostly) auto-generated structures, constants and ioctls for [VFIO]. diff --git a/Cargo.toml b/Cargo.toml index 2ff5276443..76b9ef2e62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,9 +97,6 @@ exclude = [ "common/io_uring", "common/p9", "common/sync", - "common/sys_util", - "common/sys_util_core", - "common/win_sys_util", "tube_transporter", "win_util", ] diff --git a/base/src/sys/unix/mod.rs b/base/src/sys/unix/mod.rs index 42c5a766ec..555ee94b05 100644 --- a/base/src/sys/unix/mod.rs +++ b/base/src/sys/unix/mod.rs @@ -4,11 +4,6 @@ //! Small system utility modules for usage by other modules. -// Fail sys_util compilation on windows. -// This will make any unintentional windows code submitted to the crate unusable. -#[cfg(windows)] -compile_error!("This is not windows friendly mod."); - #[cfg(target_os = "android")] mod android; #[cfg(target_os = "android")] diff --git a/base/src/syslog.rs b/base/src/syslog.rs index f7cfa1f837..c1fd1fd20b 100644 --- a/base/src/syslog.rs +++ b/base/src/syslog.rs @@ -637,7 +637,7 @@ mod tests { Some((file!(), line!())), &format_args!("before proc name"), ); - set_proc_name("sys_util-test"); + set_proc_name("syslog-test"); log( Priority::Error, Facility::User, diff --git a/cros_async/src/sys/windows/executor.rs b/cros_async/src/sys/windows/executor.rs index 586e3c0eb1..8534bbdbc6 100644 --- a/cros_async/src/sys/windows/executor.rs +++ b/cros_async/src/sys/windows/executor.rs @@ -85,7 +85,7 @@ pub(crate) fn async_handle_from<'a, F: IntoAsync + 'a + Send>( /// # fn do_it() -> Result<(), Box> { /// let ex = Executor::new()?; /// -/// let (rx, tx) = sys_util::pipe(true)?; +/// let (rx, tx) = base::pipe(true)?; /// let zero = File::open("/dev/zero")?; /// let zero_bytes = CHUNK_SIZE * 7; /// let zero_to_pipe = transfer_data( diff --git a/tools/impl/test_config.py b/tools/impl/test_config.py index c70f6f8e9d..166ed5d6d6 100755 --- a/tools/impl/test_config.py +++ b/tools/impl/test_config.py @@ -82,7 +82,6 @@ WIN64_DISABLED_CRATES = [ "rutabaga_gfx", "rutabaga_gralloc", "sync", - "sys_util", "system_api_stub", "tpm2-sys", "tpm2", @@ -137,8 +136,6 @@ CRATE_OPTIONS: dict[str, list[TestOption]] = { "libcrosvm_control": [TestOption.DO_NOT_BUILD_ARMHF], # b/210015864 "libvda": [TestOption.DO_NOT_BUILD], # b/202293971 "rutabaga_gfx": [TestOption.DO_NOT_BUILD_ARMHF], # b/210015864 - "sys_util": [TestOption.SINGLE_THREADED], - "sys_util_core": [TestOption.SINGLE_THREADED], "vhost": [TestOption.DO_NOT_RUN_ON_FOREIGN_KERNEL], "vm_control": [TestOption.DO_NOT_BUILD_ARMHF], # b/210015864 }