Auto merge of #18289 - darichey:fix-relative-buildfiles, r=lnicola

Fix panic when json project has relative buildfile paths

The `build_file` path may be relative to the workspace root.
This commit is contained in:
bors 2024-10-12 07:30:26 +00:00
commit b551482c41

View file

@ -553,7 +553,7 @@ impl ProjectWorkspace {
ProjectWorkspaceKind::Json(project) => project ProjectWorkspaceKind::Json(project) => project
.crates() .crates()
.filter_map(|(_, krate)| krate.build.as_ref().map(|build| build.build_file.clone())) .filter_map(|(_, krate)| krate.build.as_ref().map(|build| build.build_file.clone()))
.map(AbsPathBuf::assert) .map(|build_file| self.workspace_root().join(build_file))
.collect(), .collect(),
_ => vec![], _ => vec![],
} }