@@ -489,32 +489,39 @@ PackageStore::read_packages_from_file(path p, const String &config_name, bool di
489489
490490 std::set<Package> packages;
491491 auto configs = conf.split ();
492- // batch resolve of deps first in parallel; merge flags?
492+
493+ // batch resolve of deps first; merge flags?
494+
495+ // seq
496+ for (auto &c : configs)
497+ {
498+ auto &project = c.getDefaultProject ();
499+ auto root_directory = (fs::is_regular_file (p) ? p.parent_path () : p) / project.root_directory ;
500+
501+ // to prevent possible errors
502+ // pkg must have small scope
503+ Package pkg;
504+ pkg.ppath = ppath;
505+ if (!project.name .empty ())
506+ pkg.ppath .push_back (project.name );
507+ pkg.version = Version (LOCAL_VERSION_NAME);
508+ pkg.flags .set (pfLocalProject);
509+ pkg.flags .set (pfDirectDependency, direct_dependency);
510+ pkg.createNames ();
511+ project.applyFlags (pkg.flags );
512+ c.setPackage (pkg);
513+ local_packages[pkg.ppath ] = root_directory;
514+ }
515+
493516 Executor e (std::thread::hardware_concurrency () * 2 );
494517 e.throw_exceptions = true ;
495518 for (auto &c : configs)
496519 {
497- e.push ([&]()
520+ e.push ([&c, &p, &cpp_fn, &ppath ]()
498521 {
499522 auto &project = c.getDefaultProject ();
500523 auto root_directory = (fs::is_regular_file (p) ? p.parent_path () : p) / project.root_directory ;
501524
502- // to prevent possible errors
503- // pkg must have small scope
504- {
505- Package pkg;
506- pkg.ppath = ppath;
507- if (!project.name .empty ())
508- pkg.ppath .push_back (project.name );
509- pkg.version = Version (LOCAL_VERSION_NAME);
510- pkg.flags .set (pfLocalProject);
511- pkg.flags .set (pfDirectDependency, direct_dependency);
512- pkg.createNames ();
513- project.applyFlags (pkg.flags );
514- c.setPackage (pkg);
515- local_packages[pkg.ppath ] = root_directory;
516- }
517-
518525 // sources
519526 if (!cpp_fn.empty () && !project.files_loaded )
520527 {
@@ -523,6 +530,7 @@ PackageStore::read_packages_from_file(path p, const String &config_name, bool di
523530 project.sources .insert (cpp_fn.filename ().string ());
524531 }
525532 project.root_directory = root_directory;
533+ LOG_INFO (logger, " Finding sources for " + project.pkg .ppath .slice (2 ).toString ());
526534 project.findSources (root_directory);
527535 // maybe remove? let user see cppan.yml in local project
528536 project.files .erase (CPPAN_FILENAME);
@@ -550,16 +558,18 @@ PackageStore::read_packages_from_file(path p, const String &config_name, bool di
550558 d.second .createNames ();
551559 project.dependencies .insert ({ d.second .ppath .toString (), d.second });
552560 }
553-
554- // add package for result
555- packages.insert (project.pkg );
556561 });
557562 }
558563 e.wait ();
559564
560565 // seq
561566 for (auto &c : configs)
562567 {
568+ auto &project = c.getDefaultProject ();
569+
570+ // add package for result
571+ packages.insert (project.pkg );
572+
563573 // add config to storage
564574 rd.add_local_config (c);
565575 }
0 commit comments