Skip to content

Commit

Permalink
remove unnecessary packages from metadata::workspace_members
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
onur-ozkan committed Jun 27, 2024
1 parent 51f6e68 commit 3457ecc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/bootstrap/src/core/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ pub fn build(build: &mut Build) {
}

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

// Collects `metadata.packages` from all workspaces.
let packages = collect_metadata("Cargo.toml");
let ra_packages = collect_metadata("src/tools/rust-analyzer/Cargo.toml");
let bootstrap_packages = collect_metadata("src/bootstrap/Cargo.toml");

packages.into_iter().chain(ra_packages).chain(bootstrap_packages)
collect_metadata("Cargo.toml")
}

0 comments on commit 3457ecc

Please sign in to comment.