diff --git a/Cargo.toml b/Cargo.toml index 0c3581c..1183a69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-c" -version = "0.10.9+cargo-0.85.0" +version = "0.10.10+cargo-0.86.0" authors = ["Luca Barbato "] description = "Helper program to build and install c-like libraries" license = "MIT" @@ -28,7 +28,7 @@ name = "cargo-ctest" path = "src/bin/ctest.rs" [dependencies] -cargo = "0.85.0" +cargo = "0.86.0" cargo-util = "0.2" semver = "1.0.3" log = "0.4" diff --git a/src/build.rs b/src/build.rs index 4887ae0..37638bf 100644 --- a/src/build.rs +++ b/src/build.rs @@ -1145,7 +1145,7 @@ pub fn cbuild( for m in ws.members_mut().filter(|p| is_relevant_package(p)) { let cpkg = CPackage::from_package(m, args, library_types, &rustc_target, &root_output)?; - pristine |= cpkg.finger_print.load_previous().is_err(); + pristine |= cpkg.finger_print.load_previous().is_err() || !cpkg.finger_print.is_valid(); members.push(cpkg); } @@ -1188,8 +1188,7 @@ pub fn cbuild( for cpkg in members.iter_mut() { // it is a new build, build the additional files and update update the cache - // if the hash value does not match. - if new_build || !cpkg.finger_print.is_valid() { + if new_build { let name = &cpkg.capi_config.library.name; let (pkg_config_static_libs, static_libs) = if library_types.only_cdylib() { (String::new(), String::new()) diff --git a/src/cli.rs b/src/cli.rs index 5118160..6c10852 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -121,6 +121,16 @@ fn base_cli() -> Command { "Build all benches", "Build all targets", ) + .arg( + multi_opt( + "library-type", + "LIBRARY-TYPE", + "Build only a type of library", + ) + .global(true) + .ignore_case(true) + .value_parser(["cdylib", "staticlib"]), + ) .arg_profile("Build artifacts with the specified profile") .arg_features() .arg_target_triple("Build for the target triple") @@ -151,16 +161,6 @@ pub fn subcommand_build(name: &'static str, about: &'static str) -> Command { base_cli() .name(name) .about(about) - .arg( - multi_opt( - "library-type", - "LIBRARY-TYPE", - "Build only a type of library", - ) - .global(true) - .ignore_case(true) - .value_parser(["cdylib", "staticlib"]), - ) .arg_release("Build artifacts in release mode, with optimizations") .arg_package_spec_no_all( "Package to build (see `cargo help pkgid`)", @@ -180,16 +180,6 @@ pub fn subcommand_install(name: &'static str, about: &'static str) -> Command { base_cli() .name(name) .about(about) - .arg( - multi_opt( - "library-type", - "LIBRARY-TYPE", - "Build only a type of library", - ) - .global(true) - .ignore_case(true) - .value_parser(["cdylib", "staticlib"]), - ) .arg(flag("debug", "Build in debug mode instead of release mode")) .arg_release( "Build artifacts in release mode, with optimizations. This is the default behavior.", @@ -210,9 +200,13 @@ the --debug flag will use the `dev` profile instead. pub fn subcommand_test(name: &'static str) -> Command { base_cli() - .trailing_var_arg(true) .name(name) .about("Test the crate C-API") + .arg( + Arg::new("TESTNAME") + .action(ArgAction::Set) + .help("If specified, only run tests containing this string in their names"), + ) .arg( Arg::new("args") .help("Arguments for the test binary")