diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6151adb..4b98b0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,9 @@ jobs: if: matrix.rust != 'stable' run: cargo install --locked --path . -f + - name: run cargo-profdata --help + run: cargo profdata -- --help + - name: Run cargo-nm run: cargo nm --bin cargo-nm -- --undefined-only diff --git a/src/lib.rs b/src/lib.rs index acad687..494d9b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -280,16 +280,18 @@ To see all the flags the proxied tool accepts run `cargo-{} -- --help`.{}", pub fn run(tool: Tool, matches: ArgMatches) -> Result { let mut metadata_command = MetadataCommand::new(); - if let Some(features) = matches.get_many::("features") { - metadata_command.features(CargoOpt::SomeFeatures( - features.map(|s| s.to_owned()).collect(), - )); - } - if matches.get_flag("no-default-features") { - metadata_command.features(CargoOpt::NoDefaultFeatures); - } - if matches.get_flag("all-features") { - metadata_command.features(CargoOpt::AllFeatures); + if tool.needs_build() { + if let Some(features) = matches.get_many::("features") { + metadata_command.features(CargoOpt::SomeFeatures( + features.map(|s| s.to_owned()).collect(), + )); + } + if matches.get_flag("no-default-features") { + metadata_command.features(CargoOpt::NoDefaultFeatures); + } + if matches.get_flag("all-features") { + metadata_command.features(CargoOpt::AllFeatures); + } } if let Some(path) = matches.get_one::("manifest-path") { metadata_command.manifest_path(path);