Skip to content

Commit 3457ecc

Browse files
committed
remove unnecessary packages from metadata::workspace_members
Currently bootstrap doesn't use any inner paths from rust-analyzer and bootstrap with `ShouldRun::create_or_deps`. Signed-off-by: onur-ozkan <[email protected]>
1 parent 51f6e68 commit 3457ecc

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/bootstrap/src/core/metadata.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ pub fn build(build: &mut Build) {
6666
}
6767

6868
/// Invokes `cargo metadata` to get package metadata of each workspace member.
69-
fn workspace_members(build: &Build) -> impl Iterator<Item = Package> {
69+
///
70+
/// This is used to resolve specific crate paths in `fn should_run` to compile
71+
/// particular crate (e.g., `x build sysroot` to build library/sysroot).
72+
fn workspace_members(build: &Build) -> Vec<Package> {
7073
let collect_metadata = |manifest_path| {
7174
let mut cargo = Command::new(&build.initial_cargo);
7275
cargo
@@ -85,9 +88,5 @@ fn workspace_members(build: &Build) -> impl Iterator<Item = Package> {
8588
};
8689

8790
// Collects `metadata.packages` from all workspaces.
88-
let packages = collect_metadata("Cargo.toml");
89-
let ra_packages = collect_metadata("src/tools/rust-analyzer/Cargo.toml");
90-
let bootstrap_packages = collect_metadata("src/bootstrap/Cargo.toml");
91-
92-
packages.into_iter().chain(ra_packages).chain(bootstrap_packages)
91+
collect_metadata("Cargo.toml")
9392
}

0 commit comments

Comments
 (0)