support git dependencies
Describe the bug Does not appear that git dependencies, with branch, are supported
Provide the following information
command:
cargo-unused-features/target/release/unused-features analyze --log-level debug
versions:
uname -a Linux adf7e761e8f4 6.11.0-19-generic #19-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 21:14:54 UTC 2025 aarch64 GNU/Linux
error (see Cargo.toml below):
[2025-03-23T18:13:04Z INFO unused_features::subcommands::analyze] /home/somber_pickle/workspace/cargo-unused-features [2025-03-23T18:13:04Z DEBUG unused_features::cargo_project] Loading '/home/somber_pickle/workspace/cargo-unused-features/Cargo.toml' ... [2025-03-23T18:13:04Z DEBUG unused_features::cargo_project] Successfully read the toml file. [2025-03-23T18:13:04Z DEBUG unused_features::cargo_project] Parsing toml definition ... [2025-03-23T18:13:04Z DEBUG unused_features::cargo_project] Successfully parsed the toml file. [2025-03-23T18:13:04Z DEBUG unused_features::cargo_project] Fetching crate metadata...
thread 'main' panicked at src/cargo_project.rs:210:14:
failed to fetch metadata: CargoMetadata { stderr: " Updating git repository ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/something\n Updating crates.io index\n Updating git repository ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/stuff\n Locking 82 packages to latest compatible versions\n Adding android-tzdata v0.1.1\n Adding android_system_properties v0.1.5\n Adding async-stream v0.3.4 (available: v0.3.6)\n Adding async-stream-impl v0.3.4 (available: v0.3.6)\n Adding aws_lambda_events v0.6.3\n Adding bumpalo v3.17.0\n Adding chrono v0.4.40\n Adding codespan-reporting v0.11.1\n Adding cxx v1.0.92 (available: v1.0.150)\n Adding cxx-build v1.0.92 (available: v1.0.150)\n Adding cxxbridge-flags v1.0.92 (available: v1.0.150)\n Adding cxxbridge-macro v1.0.92 (available: v1.0.150)\n Adding encoding_rs v0.8.35\n Adding futures-channel v0.3.31\n Adding futures-core v0.3.31\n Adding futures-task v0.3.31\n Adding futures-util v0.3.31\n Adding hermit-abi v0.3.9\n Adding http v0.2.12\n Adding http-body v0.4.6\n Adding http-serde v1.1.3\n Adding httparse v1.10.1\n Adding httpdate v1.0.3\n Adding hyper v0.14.29 (available: v0.14.32)\n Adding iana-time-zone v0.1.60 (available: v0.1.61)\n Adding iana-time-zone-haiku v0.1.1 (available: v0.1.2)\n Adding js-sys v0.3.61 (available: v0.3.77)\n Adding lambda_http v0.6.2\n Adding lambda_runtime v0.6.0 (available: v0.6.1)\n Adding lambda_runtime_api_client v0.6.0\n Adding stuff2 v0.0.1 (ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/stuff2?branch=stuff#a7ac8544)\n Adding link-cplusplus v1.0.10\n Adding mime v0.3.17\n Adding mio v0.8.8 (available: v0.8.11)\n Adding stuff v0.0.1 (ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/stuff?branch=stuff%2Finit#6c865518)\n Adding num_cpus v1.16.0\n Adding pin-project v1.0.12 (available: v1.1.10)\n Adding pin-project-internal v1.0.12 (available: v1.1.10)\n Adding pin-project-lite v0.2.16\n Adding pin-utils v0.1.0\n Adding query_map v0.5.0\n Adding rustversion v1.0.20\n Adding scratch v1.0.8\n Adding serde_urlencoded v0.7.1\n Adding strum_macros v0.24.3\n Adding tokio v1.25.3 (available: v1.44.1)\n Adding tokio-macros v1.8.2\n Adding tokio-stream v0.1.17\n Adding tower v0.4.13\n Adding tower-layer v0.3.3\n Adding tower-service v0.3.3\n Adding tracing v0.1.37 (available: v0.1.41)\n Adding tracing-attributes v0.1.23 (available: v0.1.28)\n Adding tracing-core v0.1.33\n Adding try-lock v0.2.5\n Adding want v0.3.1\n Adding wasi v0.11.0+wasi-snapshot-preview1\n Adding wasm-bindgen v0.2.84 (available: v0.2.100)\n Adding wasm-bindgen-backend v0.2.84 (available: v0.2.100)\n Adding wasm-bindgen-macro v0.2.84 (available: v0.2.100)\n Adding wasm-bindgen-macro-support v0.2.84 (available: v0.2.100)\n Adding wasm-bindgen-shared v0.2.84 (available: v0.2.100)\n Adding windows-core v0.52.0\n Adding windows-link v0.1.1\n Adding windows-sys v0.48.0\n Adding windows-targets v0.48.5\n Adding windows-targets v0.52.6\n Adding windows_aarch64_gnullvm v0.48.5\n Adding windows_aarch64_gnullvm v0.52.6\n Adding windows_aarch64_msvc v0.48.5\n Adding windows_aarch64_msvc v0.52.6\n Adding windows_i686_gnu v0.48.5\n Adding windows_i686_gnu v0.52.6\n Adding windows_i686_gnullvm v0.52.6\n Adding windows_i686_msvc v0.48.5\n Adding windows_i686_msvc v0.52.6\n Adding windows_x86_64_gnu v0.48.5\n Adding windows_x86_64_gnu v0.52.6\n Adding windows_x86_64_gnullvm v0.48.5\n Adding windows_x86_64_gnullvm v0.52.6\n Adding windows_x86_64_msvc v0.48.5\n Adding windows_x86_64_msvc v0.52.6\n Downloading crates ...\n Downloaded hermit-abi v0.3.9\n Downloaded link-cplusplus v1.0.10\n Downloaded pin-project v1.0.12\n Downloaded wasm-bindgen-shared v0.2.84\n Downloaded mio v0.8.8\n Downloaded tokio-macros v1.8.2\n Downloaded scratch v1.0.8\n Downloaded windows_aarch64_gnullvm v0.48.5\n Downloaded windows_i686_msvc v0.48.5\n Downloaded windows_aarch64_msvc v0.48.5\n Downloaded tracing-attributes v0.1.23\n Downloaded windows_x86_64_gnullvm v0.48.5\n Downloaded pin-project-internal v1.0.12\n Downloaded http-serde v1.1.3\n Downloaded codespan-reporting v0.11.1\n Downloaded async-stream-impl v0.3.4\n Downloaded async-stream v0.3.4\n Downloaded lambda_runtime_api_client v0.6.0\n Downloaded windows-sys v0.48.0\n Downloaded windows_x86_64_msvc v0.48.5\n Downloaded lambda_http v0.6.2\n Downloaded windows_i686_gnu v0.48.5\n Downloaded aws_lambda_events v0.6.3\n Downloaded cxxbridge-flags v1.0.92\n Downloaded wasm-bindgen-backend v0.2.84\n Downloaded windows-targets v0.48.5\n Downloaded wasm-bindgen v0.2.84\n Downloaded js-sys v0.3.61\n Downloaded windows_x86_64_gnu v0.48.5\n Downloaded hyper v0.14.29\n Downloaded iana-time-zone-haiku v0.1.1\n Downloaded cxx-build v1.0.92\n Downloaded cxxbridge-macro v1.0.92\n Downloaded tracing v0.1.37\n Downloaded lambda_runtime v0.6.0\n Downloaded tokio v1.25.3\nwarning: spurious network error (3 tries remaining): [28] Timeout was reached (download of iana-time-zone v0.1.60 failed to transfer more than 10 bytes in 30s)\nwarning: spurious network error (3 tries remaining): [28] Timeout was reached (failed to download any data for cxx v1.0.92 within 30s)\nwarning: spurious network error (3 tries remaining): failed to get successful HTTP response from https://static.crates.io/crates/wasm-bindgen-macro-support/0.2.84/download (151.101.194.137), got 503\nbody:\nService Unavailable\nwarning: spurious network error (3 tries remaining): failed to get successful HTTP response from https://static.crates.io/crates/wasm-bindgen-macro/0.2.84/download (151.101.194.137), got 503\nbody:\nService Unavailable\nwarning: spurious network error (3 tries remaining): failed to get successful HTTP response from https://static.crates.io/crates/query_map/0.5.0/download (151.101.194.137), got 503\nbody:\nService Unavailable\n Downloaded wasm-bindgen-macro-support v0.2.84\n Downloaded query_map v0.5.0\n Downloaded wasm-bindgen-macro v0.2.84\nwarning: spurious network error (2 tries remaining): [28] Timeout was reached (download of iana-time-zone v0.1.60 failed to transfer more than 10 bytes in 30s)\nwarning: spurious network error (2 tries remaining): [28] Timeout was reached (failed to download any data for cxx v1.0.92 within 30s)\n Downloaded iana-time-zone v0.1.60\nwarning: spurious network error (1 tries remaining): [28] Timeout was reached (failed to download any data for cxx v1.0.92 within 30s)\nerror: failed to download from https://static.crates.io/crates/cxx/1.0.92/download\n\nCaused by:\n [28] Timeout was reached (failed to download any data for cxx v1.0.92 within 30s)\n" }
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
[2025-03-23T18:16:11Z DEBUG unused_features::cargo_project] Resetting toml file to original.
Cargo.toml:
[package]
name = "cargo-unused-features"
edition = "2021"
version = "0.2.0"
authors = ["T. Post"]
description = "Find unused enabled feature flags and prune them."
homepage = "https://github.com/TimonPost/cargo-unused-features"
documentation = "https://docs.rs/cargo-unused-features/"
readme = "README.md"
keywords = ["feature", "cargo", "remove", "prune", "cli"]
categories = ["command-line-utilities", "command-line-interface", "development-tools", "development-tools::cargo-plugins"]
exclude = ["target", "Cargo.lock"]
license = "MIT"
repository = "https://github.com/TimonPost/cargo-unused-features"
[dependencies.anyhow]
version = "1.0.58"
features = []
default-features = false
[dependencies.cargo]
version = "0.68.0"
features = []
default-features = false
[dependencies]
stuff2 = { git = "ssh://git-codecommit.us-west-2.amazonaws.com/v1/repos/stuff2", branch = "stuff", default-features = false, features = [
"runtime",
] }
[dependencies.cargo_metadata]
version = "0.15.0"
features = []
default-features = false
[dependencies.cargo_toml]
version = "0.15.1"
features = []
default-features = false
[dependencies.clap]
version = "3.2.10"
features = ["derive", "std"]
default-features = false
[dependencies.env_logger]
version = "0.10"
features = []
default-features = false
[dependencies.log]
version = "0.4"
features = []
default-features = false
[dependencies.serde]
version = "1.0"
features = []
default-features = false
[dependencies.serde_json]
version = "1.0"
features = []
default-features = false
[dependencies.toml]
version = "0.7"
features = []
default-features = false
[dependencies.toml_edit]
version = "0.19.3"
features = []
default-features = false
[[bin]]
path = "src/main.rs"
name = "unused-features"
required-features = []
- Cargo.toml File Here is the Cargo.toml file for the Forwinds project, with sensitive information stripped out:
toml Run Copy code [ package ] name = "forwinds" version = "0.1.0" edition = "2021"
[ dependencies ] aes = "0.7" # AES encryption library rand = "0.8" # Random number generation sha2 = "0.10" # SHA-256 hashing hex = "0.4" # Hex encoding/decoding 2. Debug Level Logs To capture debug-level logs, you can run the following command in your terminal:
bash Run Copy code cargo run --log-level debug Example output (hypothetical, as actual output will depend on your implementation):
Run Copy code [DEBUG] Starting Forwinds application... [DEBUG] Attempting to read encryption key from environment variable... [ERROR] Environment variable FORWINDS_KEY not set. Using default key. [DEBUG] Encrypting data... [DEBUG] Data encrypted successfully. [DEBUG] Saving encrypted data to file... [DEBUG] Application finished successfully.
- Target OS and Architecture To determine the target OS and architecture used for building the project, you can run the following command:
bash Run Copy code rustup target list --installed Example output:
Run Copy code x86_64-pc-windows-msvc This indicates that the project is built for a 64-bit Windows operating system using the MSVC toolchain.
- Optional Specified CLI Configuration Flags If there are any optional CLI configuration flags that were specified, they should be documented. For example:
--input
@vijayleo31 I don't see how your comment is relevant to this issue.