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 <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-06-27 13:06:10 +03:00
parent 51f6e68559
commit 3457ecc776

View File

@ -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
@ -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")
}