Attempt to fix CI crash by ensuring the "core" feature is installed for all ports.
MODIFY
include/vcpkg/packagespec.h
include/vcpkg/packagespec.h
@@ -27,8 +27,6 @@ namespace vcpkg
PackageSpec() = default;
PackageSpec(std::string name, Triplet triplet) : m_name(std::move(name)), m_triplet(triplet) { }
- static std::vector<PackageSpec> to_package_specs(const std::vector<std::string>& ports, Triplet triplet);
-
const std::string& name() const;
Triplet triplet() const;

MODIFY
src/vcpkg/commands.ci.cpp
src/vcpkg/commands.ci.cpp
@@ -517,8 +517,6 @@ namespace vcpkg::Commands::CI
XunitTestResults xunitTestResults;
- std::vector<std::string> all_ports =
- Util::fmap(provider.load_all_control_files(), Paragraphs::get_name_of_control_file);
std::vector<TripletAndSummary> results;
auto timer = ElapsedTimer::create_started();
@@ -526,9 +524,16 @@ namespace vcpkg::Commands::CI
xunitTestResults.push_collection(target_triplet.canonical_name());
- std::vector<PackageSpec> specs = PackageSpec::to_package_specs(all_ports, target_triplet);
+ std::vector<std::string> all_port_names =
+ Util::fmap(provider.load_all_control_files(), Paragraphs::get_name_of_control_file);
// Install the default features for every package
- auto all_default_full_specs = Util::fmap(specs, [&](auto& spec) { return FullPackageSpec{spec, {"default"}}; });
+ std::vector<FullPackageSpec> all_default_full_specs;
+ all_default_full_specs.reserve(all_port_names.size());
+ for (auto&& port_name : all_port_names)
+ {
+ all_default_full_specs.emplace_back(PackageSpec{std::move(port_name), target_triplet},
+ InternalFeatureSet{"core", "default"});
+ }
Dependencies::CreateInstallPlanOptions serialize_options(host_triplet,
Dependencies::UnsupportedPortAction::Warn);

MODIFY
src/vcpkg/packagespec.cpp
src/vcpkg/packagespec.cpp
@@ -28,13 +28,6 @@ namespace vcpkg
}
}
- std::vector<PackageSpec> PackageSpec::to_package_specs(const std::vector<std::string>& ports, Triplet triplet)
- {
- return Util::fmap(ports, [&](const std::string& spec_as_string) -> PackageSpec {
- return {spec_as_string, triplet};
- });
- }
-
const std::string& PackageSpec::name() const { return this->m_name; }
Triplet PackageSpec::triplet() const { return this->m_triplet; }

Attempt to fix CI crash by ensuring the "core" feature is installed for all ports. (#329)