Skip to content

Commit e664df0

Browse files
committed
PR meta-rust#63: Only resolve dependencies for the active package within a workspace
1 parent 0a549bf commit e664df0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/main.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use cargo::core::registry::PackageRegistry;
2222
use cargo::core::resolver::features::HasDevUnits;
2323
use cargo::core::resolver::CliFeatures;
2424
use cargo::core::source::GitReference;
25-
use cargo::core::{Package, PackageSet, Resolve, Workspace};
25+
use cargo::core::{Package, PackageIdSpec, PackageSet, Resolve, Workspace};
2626
use cargo::ops;
2727
use cargo::util::{important_paths, CargoResult};
2828
use cargo::{CliResult, Config};
@@ -83,6 +83,8 @@ impl<'cfg> PackageInfo<'cfg> {
8383
// resolve our dependencies
8484
let (packages, resolve) = ops::resolve_ws(&self.ws)?;
8585

86+
let pkgid = PackageIdSpec::from_package_id(self.package()?.package_id());
87+
8688
// resolve with all features set so we ensure we get all of the depends downloaded
8789
let resolve = ops::resolve_with_previous(
8890
&mut registry,
@@ -95,7 +97,7 @@ impl<'cfg> PackageInfo<'cfg> {
9597
/* don't avoid any */
9698
None,
9799
/* specs */
98-
&[],
100+
&[pkgid],
99101
/* warn? */
100102
true,
101103
)?;
@@ -241,7 +243,6 @@ fn real_main(options: Args, config: &mut Config) -> CliResult {
241243
} else {
242244
src_uri_extras.push(format!("SRCREV_FORMAT .= \":{}\"", pkg.name()));
243245
};
244-
245246

246247
let precise = if options.reproducible {
247248
src_id.precise()
@@ -372,7 +373,11 @@ fn real_main(options: Args, config: &mut Config) -> CliResult {
372373
}
373374
// we should be using ${SRCPV} here but due to a bitbake bug we cannot. see:
374375
// https://github.com/meta-rust/meta-rust/issues/136
375-
format!("{} = \".AUTOINC+{}\"", pv_append_key, &project_repo.rev[..10])
376+
format!(
377+
"{} = \".AUTOINC+{}\"",
378+
pv_append_key,
379+
&project_repo.rev[..10]
380+
)
376381
} else {
377382
// its a tag so nothing needed
378383
"".into()

0 commit comments

Comments
 (0)