From a10f234854a9de793c8d0aa461b628bd05432407 Mon Sep 17 00:00:00 2001 From: Terts Diepraam Date: Sun, 24 Apr 2022 23:18:04 +0200 Subject: [PATCH] uudoc: require a feature to build This is used to not build uudoc by default. See https://github.com/uutils/coreutils/issues/3411 --- Cargo.toml | 4 +++- build.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17f686008..061a79c2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -254,6 +254,7 @@ feat_os_windows_legacy = [ ## # * bypass/override ~ translate 'test' feature name to avoid dependency collision with rust core 'test' crate (o/w surfaces as compiler errors during testing) test = [ "uu_test" ] +uudoc = [ "zip" ] [workspace] @@ -265,7 +266,7 @@ lazy_static = { version="1.3" } textwrap = { version="0.15", features=["terminal_size"] } uucore = { version=">=0.0.11", package="uucore", path="src/uucore" } selinux = { version="0.2", optional = true } -zip = { version = "0.6.0", default_features=false, features=["deflate"] } +zip = { version = "0.6.0", optional=true, default_features=false, features=["deflate"] } # * uutils uu_test = { optional=true, version="0.0.13", package="uu_test", path="src/uu/test" } # @@ -415,3 +416,4 @@ path = "src/bin/coreutils.rs" [[bin]] name = "uudoc" path = "src/bin/uudoc.rs" +required-features = ["uudoc"] diff --git a/build.rs b/build.rs index 50b8cfa3f..3df8d891d 100644 --- a/build.rs +++ b/build.rs @@ -28,8 +28,9 @@ pub fn main() { if val == "1" && key.starts_with(ENV_FEATURE_PREFIX) { let krate = key[ENV_FEATURE_PREFIX.len()..].to_lowercase(); match krate.as_ref() { - "default" | "macos" | "unix" | "windows" | "selinux" => continue, // common/standard feature names + "default" | "macos" | "unix" | "windows" | "selinux" | "zip" => continue, // common/standard feature names "nightly" | "test_unimplemented" => continue, // crate-local custom features + "uudoc" => continue, // is not a utility "test" => continue, // over-ridden with 'uu_test' to avoid collision with rust core crate 'test' s if s.starts_with(FEATURE_PREFIX) => continue, // crate feature sets _ => {} // util feature name