Skip to content

Commit

Permalink
Don't search for files until after building all the services
Browse files Browse the repository at this point in the history
  • Loading branch information
swatanabe committed Sep 6, 2024
1 parent d50dc60 commit 63defd1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rust/cargo-psibase/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ pub async fn build_package(
let mut services = Vec::new();
let mut plugins = Vec::new();
let mut data_files = Vec::new();
let mut postinstall: Vec<Action> = Vec::new();
let mut postinstall = Vec::new();
let mut data_sources = Vec::new();

let get_dep = get_dep_type(|service, dep| {
let r = metadata.resolved.get(&service.id.repr.as_str()).unwrap();
Expand Down Expand Up @@ -302,7 +303,7 @@ pub async fn build_package(
if dest.ends_with('/') {
dest.pop();
}
add_files(&package.name, src.as_std_path(), &dest, &mut data_files)?;
data_sources.push((&package.name, src, dest));
}
services.push((&package.name, info, &package.id.repr));
if let Some(actions) = &pmeta.postinstall {
Expand Down Expand Up @@ -363,6 +364,10 @@ pub async fn build_package(
data_files.push((service, path.to_string(), paths.pop().unwrap()))
}

for (service, src, dest) in data_sources {
add_files(service, src.as_std_path(), &dest, &mut data_files)?;
}

let out_dir = get_package_dir(args, metadata);
let out_path = out_dir.join(package_name.clone() + ".psi");
let mut file =
Expand Down

0 comments on commit 63defd1

Please sign in to comment.