Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
749 stars 60 forks source link

testing examples fail with clap v3.2.25 #348

Closed jonassmedegaard closed 1 year ago

jonassmedegaard commented 1 year ago

How To Reproduce

env RUST_BACKTRACE=1 /usr/bin/cargo -Zavoid-dev-deps test --verbose --verbose -j2 --target x86_64-unknown-linux-gnu --release fails like this:

   Compiling clap v3.2.25
     Running `CARGO=/usr/bin/cargo CARGO_CRATE_NAME=clap CARGO_MANIFEST_DIR=/build/rust-palette-0.7.3+dfsg/debian/cargo_registry/clap-3.2.25 CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='A simple to use, efficient, and full-featured Command Line Argument Parser' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=clap CARGO_PKG_REPOSITORY='https://github.com/clap-rs/clap' CARGO_PKG_RUST_VERSION=1.56.1 CARGO_PKG_VERSION=3.2.25 CARGO_PKG_VERSION_MAJOR=3 CARGO_PKG_VERSION_MINOR=2 CARGO_PKG_VERSION_PATCH=25 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/build/rust-palette-0.7.3+dfsg/target/release/deps:/usr/lib:/usr/lib/libeatmydata' /usr/bin/sccache rustc --crate-name clap --edition=2021 /build/rust-palette-0.7.3+dfsg/debian/cargo_registry/clap-3.2.25/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=1424ba24467d4c26 -C extra-filename=-1424ba24467d4c26 --out-dir /build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps -L dependency=/build/rust-palette-0.7.3+dfsg/target/release/deps --extern bitflags=/build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps/libbitflags-7742a1585ab8b5b6.rmeta --extern clap_lex=/build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps/libclap_lex-3539757ea6fe94c1.rmeta --extern indexmap=/build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps/libindexmap-40d9880b5a3cafcc.rmeta --extern once_cell=/build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps/libonce_cell-0731ead19a87d7c0.rmeta --extern textwrap=/build/rust-palette-0.7.3+dfsg/target/x86_64-unknown-linux-gnu/release/deps/libtextwrap-dfb6e8f403a72894.rmeta --cap-lints warn -C debuginfo=2 --cap-lints warn -C linker=x86_64-linux-gnu-gcc -C link-arg=-Wl,-z,relro --remap-path-prefix palette_0.7.3=/usr/share/cargo/registry//palette-0.7.3 --remap-path-prefix palette_derive_0.7.3=/usr/share/cargo/registry//palette_derive-0.7.3 --remap-path-prefix debian/cargo_registry=/usr/share/cargo/registry/ -C link-arg=-fuse-ld=mold`
error: `std` feature is currently required to build `clap`
  --> /build/rust-palette-0.7.3+dfsg/debian/cargo_registry/clap-3.2.25/src/lib.rs:96:1
   |
96 | compile_error!("`std` feature is currently required to build `clap`");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: could not compile `clap` due to previous error
jonassmedegaard commented 1 year ago

Build succeeds with this patch applied:

--- a/palette/Cargo.toml
+++ b/palette/Cargo.toml
@@ -85,6 +85,7 @@
 [dev-dependencies.clap]
 version = "3.2.23"
 default-features = false
+features = ["std"]

 [dev-dependencies.criterion]
 version = "0.4.0"
Ogeon commented 1 year ago

Thanks for noticing this! It should be fine to add that feature, since it's only used by the examples. 👍