From 8440efac9f8fcf9ad96df91814d19ddd515fad13 Mon Sep 17 00:00:00 2001 From: Jisu-Woniu <31986081+Jisu-Woniu@users.noreply.github.com> Date: Thu, 15 Feb 2024 00:04:49 +0800 Subject: [PATCH] =?UTF-8?q?build(deps):=20=E2=9E=96=20comment=20out=20unus?= =?UTF-8?q?ed=20deps,=20reduce=20build=20time?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 74 ------------------------------------------- Cargo.toml | 14 ++++---- xtask/src/dist/mod.rs | 4 ++- 3 files changed, 11 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e3c551..acb9da4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -273,15 +273,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cgroups" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b438c4132fca064f14894b866613b8acac0d804104d45ec730a3ab1a4017770" -dependencies = [ - "log", -] - [[package]] name = "clap" version = "4.5.0" @@ -347,18 +338,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "duct" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c" -dependencies = [ - "libc", - "once_cell", - "os_pipe", - "shared_child", -] - [[package]] name = "either" version = "1.10.0" @@ -807,16 +786,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "os_pipe" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -1023,20 +992,15 @@ name = "rsjudge" version = "0.1.0" dependencies = [ "anyhow", - "cgroups", "clap", "clap_complete", "clap_mangen", - "duct", - "nix", "rsjudge-grpc", "rsjudge-rest", "rsjudge-runner", "serde", - "strfmt", "tokio", "toml", - "uzers", ] [[package]] @@ -1157,16 +1121,6 @@ dependencies = [ "serde", ] -[[package]] -name = "shared_child" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "slab" version = "0.4.9" @@ -1186,12 +1140,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "strfmt" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8348af2d9fc3258c8733b8d9d8db2e56f54b2363a4b5b81585c7875ed65e65" - [[package]] name = "strsim" version = "0.11.0" @@ -1483,28 +1431,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" version = "0.48.0" diff --git a/Cargo.toml b/Cargo.toml index 0b1bb76..6dc44a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,16 +69,18 @@ systemd-units = { enable = false } [dependencies] anyhow = "1.0.79" -cgroups = "0.1.0" clap = { version = "4.5.0", features = ["derive"] } -duct = "0.13.7" -nix = { version = "0.27.1", features = ["fs"] } rsjudge-runner = { version = "0.1.0", path = "crates/rsjudge-runner" } serde = { version = "1.0.196", features = ["derive"] } -strfmt = "0.2.4" -tokio = { version = "1.36.0", features = ["fs"] } toml = "0.8.10" -uzers = "0.11.3" + +# Unused for now: +# cgroups = "0.1.0" +# duct = "0.13.7" +# nix = { version = "0.27.1", features = ["fs"] } +# strfmt = "0.2.4" +# tokio = { version = "1.36.0", features = ["fs"] } +# uzers = "0.11.3" # Optional dependencies rsjudge-grpc = { version = "0.1.0", path = "crates/rsjudge-grpc", optional = true } diff --git a/xtask/src/dist/mod.rs b/xtask/src/dist/mod.rs index 1a6ae26..b63ee38 100644 --- a/xtask/src/dist/mod.rs +++ b/xtask/src/dist/mod.rs @@ -42,6 +42,8 @@ pub(crate) fn build_script_out_dir(sh: &Shell, profile: Profile) -> anyhow::Resu .split_once("#") .expect(&format!("Unexpected pkgid: {:?}", pkgid)); + let pkg_pattern = format!("({})", pkgid.0); + let flag = profile.flag(); cmd!(sh, "cargo build --locked {flag...} --message-format=json") @@ -53,7 +55,7 @@ pub(crate) fn build_script_out_dir(sh: &Shell, profile: Profile) -> anyhow::Resu CargoCheckMessage::BuildScriptExecuted { package_id, out_dir, - } if package_id.ends_with(&format!("({})", pkgid.0)) => Some(out_dir), + } if package_id.ends_with(&pkg_pattern) => Some(out_dir), _ => None, } })