@@ -83,30 +83,10 @@ namespace
8383 ActionPlan compute_full_plan (const VcpkgPaths& paths,
8484 const PortFileProvider& provider,
8585 const CMakeVars::CMakeVarProvider& var_provider,
86- const std::vector<FullPackageSpec>& specs ,
86+ const std::vector<FullPackageSpec>& applicable_specs ,
8787 PackagesDirAssigner& packages_dir_assigner,
8888 const CreateInstallPlanOptions& serialize_options)
8989 {
90- std::vector<PackageSpec> packages_with_qualified_deps;
91- for (auto && spec : specs)
92- {
93- auto && scfl = provider.get_control_file (spec.package_spec .name ()).value_or_exit (VCPKG_LINE_INFO);
94- if (scfl.source_control_file ->has_qualified_dependencies () ||
95- !scfl.source_control_file ->core_paragraph ->supports_expression .is_empty ())
96- {
97- packages_with_qualified_deps.push_back (spec.package_spec );
98- }
99- }
100-
101- var_provider.load_dep_info_vars (packages_with_qualified_deps, serialize_options.host_triplet );
102-
103- const auto applicable_specs = Util::filter (specs, [&](auto & spec) -> bool {
104- PackagesDirAssigner this_packages_dir_not_used{" " };
105- return create_feature_install_plan (
106- provider, var_provider, {&spec, 1 }, {}, this_packages_dir_not_used, serialize_options)
107- .unsupported_features .empty ();
108- });
109-
11090 auto action_plan = create_feature_install_plan (
11191 provider, var_provider, applicable_specs, {}, packages_dir_assigner, serialize_options);
11292 var_provider.load_tag_vars (action_plan, serialize_options.host_triplet );
@@ -268,12 +248,15 @@ namespace
268248 struct CiSpecsResult
269249 {
270250 std::vector<FullPackageSpec> requested;
251+ std::vector<FullPackageSpec> applicable;
271252 std::vector<PackageSpec> excluded;
272253 };
273254
274255 CiSpecsResult calculate_ci_specs (const ExclusionsMap& exclusions_map,
275256 const Triplet& target_triplet,
276- PortFileProvider& provider)
257+ PortFileProvider& provider,
258+ const CMakeVars::CMakeVarProvider& var_provider,
259+ const CreateInstallPlanOptions& serialize_options)
277260 {
278261 // Generate a spec for the default features for every package, except for those explicitly skipped.
279262 // While `reduce_action_plan` removes skipped packages as expected failures, there
@@ -290,20 +273,38 @@ namespace
290273 }
291274 }
292275
276+ std::vector<PackageSpec> packages_with_qualified_deps;
293277 for (auto scfl : provider.load_all_control_files ())
294278 {
279+ auto package_spec = PackageSpec{scfl->to_name (), target_triplet};
280+ if (scfl->source_control_file ->has_qualified_dependencies () ||
281+ !scfl->source_control_file ->core_paragraph ->supports_expression .is_empty ())
282+ {
283+ packages_with_qualified_deps.push_back (package_spec);
284+ }
285+
295286 if (!target_triplet_exclusions || !target_triplet_exclusions->exclusions .contains (scfl->to_name ()))
296287 {
297288 result.requested .emplace_back (
298- PackageSpec{scfl-> to_name (), target_triplet} ,
289+ std::move (package_spec) ,
299290 InternalFeatureSet{FeatureNameCore.to_string (), FeatureNameDefault.to_string ()});
300291 }
301292 else
302293 {
303- result.excluded .emplace_back (PackageSpec{scfl-> to_name (), target_triplet} );
294+ result.excluded .emplace_back (std::move (package_spec) );
304295 }
305296 }
306297
298+ var_provider.load_dep_info_vars (packages_with_qualified_deps, serialize_options.host_triplet );
299+
300+ result.applicable = Util::filter (result.requested , [&](const FullPackageSpec& spec) -> bool {
301+ PackagesDirAssigner this_packages_dir_not_used{" " };
302+ return create_feature_install_plan (
303+ provider, var_provider, {&spec, 1 }, {}, this_packages_dir_not_used, serialize_options)
304+ .unsupported_features .empty ();
305+ });
306+
307+
307308 return result;
308309 }
309310
@@ -412,19 +413,19 @@ namespace vcpkg
412413 auto & var_provider = *var_provider_storage;
413414
414415 const ElapsedTimer timer;
415- auto ci_specs = calculate_ci_specs (exclusions_map, target_triplet, provider);
416416
417417 Optional<CiRandomizer> randomizer;
418418 if (Util::Sets::contains (options.switches , SwitchXRandomize))
419419 {
420420 randomizer.emplace ();
421421 }
422-
423- PackagesDirAssigner packages_dir_assigner{paths.packages ()};
424422 CreateInstallPlanOptions create_install_plan_options (
425423 randomizer.get (), host_triplet, UnsupportedPortAction::Warn, UseHeadVersion::No, Editable::No);
424+ auto ci_specs = calculate_ci_specs (exclusions_map, target_triplet, provider, var_provider, create_install_plan_options);
425+
426+ PackagesDirAssigner packages_dir_assigner{paths.packages ()};
426427 auto action_plan = compute_full_plan (
427- paths, provider, var_provider, ci_specs.requested , packages_dir_assigner, create_install_plan_options);
428+ paths, provider, var_provider, ci_specs.applicable , packages_dir_assigner, create_install_plan_options);
428429 BinaryCache binary_cache (fs);
429430 if (!binary_cache.install_providers (args, paths, out_sink))
430431 {
@@ -433,7 +434,7 @@ namespace vcpkg
433434 auto install_actions =
434435 Util::fmap (action_plan.install_actions , [](const InstallPlanAction& action) { return &action; });
435436 const auto precheck_results = binary_cache.precheck (install_actions);
436- const auto pre_build_status =
437+ auto pre_build_status =
437438 compute_pre_build_statuses (exclusions_map, precheck_results, known_failure_abis, action_plan);
438439 LocalizedString not_supported_regressions;
439440 {
0 commit comments