Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Add keyword Supports to Feature in CONTROL file and manifest #12160

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
52ebeca
Add supports_expression and parse it in Feature
Jun 30, 2020
6f92161
[apr] Add supports to feature private-headers
Jun 30, 2020
8a45e8e
bump version
Jun 30, 2020
69d5e5d
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jul 9, 2020
e59bee0
Change the way to analysis the keyword "Supports"
Jul 9, 2020
24ca11c
Test all features of the selected port
Jul 10, 2020
ea991cb
Apply clang format.
Jul 10, 2020
f0dab1e
Use clang-format
Jul 10, 2020
cea22c6
Re-trigger CI test
Jul 10, 2020
347ee2a
Add Suuports to feature x11
Jul 10, 2020
496481d
remove test code
Jul 10, 2020
214f2d0
Re-trigger CI test
Jul 10, 2020
408c3f4
Revert changes and re-trigger hunspell test
Jul 10, 2020
645996e
Move code to create_feature_install_plan
Jul 13, 2020
0c6172f
change the insert function
Jul 13, 2020
1e0c89b
clang-format
Jul 13, 2020
e10c86f
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jul 13, 2020
7d158e0
Remove unuse function
Jul 13, 2020
b5fca5d
Re-trigger CI test
Jul 13, 2020
b5a2760
Correct supports
Jul 13, 2020
d3b4b19
add support for supports in features in vcpkg.json
strega-nil Jul 15, 2020
faa0f38
format hunspell/vcpkg.json
strega-nil Jul 15, 2020
6efd7db
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Jul 20, 2020
dccfc53
Merge branch 'dev/jack/add_supports_to_feature' of https://github.com…
Jul 20, 2020
73c346e
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
Sep 8, 2020
3840de8
Revert project file changes
Sep 8, 2020
3254816
Add Supports to valid field when parsing manifest
Sep 9, 2020
019b845
Add parsing keyword Support code
Sep 9, 2020
75c1c5e
format manifest
Sep 9, 2020
1fdcb4a
clang-format
Sep 9, 2020
330fced
Merge branch 'master' into dev/jack/add_supports_to_feature
JackBoosY Sep 16, 2020
be7c66a
Add supports expression to array features
strega-nil Sep 16, 2020
9b3a84e
Merge branch 'master' into dev/jack/add_supports_to_feature
JackBoosY Oct 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/libtorrent/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: libtorrent
Version: 1.2.7
Version: 1.2.10
Port-Version: 1
Homepage: https://github.com/arvidn/libtorrent
Description: An efficient feature complete C++ BitTorrent implementation
Expand Down
3 changes: 1 addition & 2 deletions toolsrc/include/vcpkg/dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ namespace vcpkg::Dependencies
const CMakeVars::CMakeVarProvider& var_provider,
const std::vector<FullPackageSpec>& specs,
const StatusParagraphs& status_db,
const CreateInstallPlanOptions& options = {},
bool allFeatures = false);
const CreateInstallPlanOptions& options = {});

ActionPlan create_upgrade_plan(const PortFileProvider::PortFileProvider& provider,
const CMakeVars::CMakeVarProvider& var_provider,
Expand Down
5 changes: 5 additions & 0 deletions toolsrc/include/vcpkg/sourceparagraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ namespace vcpkg
std::vector<std::string> description;
std::vector<Dependency> dependencies;
PlatformExpression::Expr supports_expression;

Json::Object extra_info;

friend bool operator==(const FeatureParagraph& lhs, const FeatureParagraph& rhs);
friend bool operator!=(const FeatureParagraph& lhs, const FeatureParagraph& rhs) { return !(lhs == rhs); }
};

/// <summary>
Expand Down
5 changes: 1 addition & 4 deletions toolsrc/src/vcpkg/commands.ci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <vcpkg/vcpkgcmdarguments.h>
#include <vcpkg/vcpkglib.h>

#include <algorithm>

using namespace vcpkg;

namespace
Expand Down Expand Up @@ -385,7 +383,6 @@ namespace vcpkg::Commands::CI
}
else
{
// include_all_supported_features_for_triplet(var_provider, p);
ret->unknown.emplace_back(p->spec, p->feature_list);
b_will_build = true;
}
Expand Down Expand Up @@ -503,7 +500,7 @@ namespace vcpkg::Commands::CI
}

auto action_plan = Dependencies::create_feature_install_plan(
new_default_provider, var_provider, split_specs->unknown, status_db, serialize_options, true);
new_default_provider, var_provider, split_specs->unknown, status_db, serialize_options);

for (auto&& action : action_plan.install_actions)
{
Expand Down
23 changes: 2 additions & 21 deletions toolsrc/src/vcpkg/dependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,7 @@ namespace vcpkg::Dependencies
const CMakeVars::CMakeVarProvider& var_provider,
const std::vector<FullPackageSpec>& specs,
const StatusParagraphs& status_db,
const CreateInstallPlanOptions& options,
bool allFeatures)
const CreateInstallPlanOptions& options)
{
PackageGraph pgraph(port_provider, var_provider, status_db);

Expand All @@ -689,32 +688,14 @@ namespace vcpkg::Dependencies
Checks::check_exit(
VCPKG_LINE_INFO, scfl, "Error: Cannot find definition for package `%s`.", spec.package_spec.name());

std::vector<std::string> all_features =
const std::vector<std::string> all_features =
Util::fmap(scfl->source_control_file->feature_paragraphs,
[](auto&& feature_paragraph) { return feature_paragraph->name; });

auto fspecs =
spec.to_feature_specs(scfl->source_control_file->core_paragraph->default_features, all_features);
feature_specs.insert(
feature_specs.end(), std::make_move_iterator(fspecs.begin()), std::make_move_iterator(fspecs.end()));

if (allFeatures)
{
auto feature_list = feature_specs;
const auto& features_paragraphs = scfl->source_control_file->feature_paragraphs;
PlatformExpression::Context context =
var_provider.get_tag_vars(spec.package_spec).value_or_exit(VCPKG_LINE_INFO);

for (auto feature = features_paragraphs.begin(); feature != features_paragraphs.end(); feature++)
{
if (feature->get()->supports_expression.evaluate(context))
{
// if (find(feature_list.begin(), feature_list.end(), feature->get()->name) ==
// feature_list.end())
feature_specs.emplace_back(spec.package_spec, feature->get()->name);
}
}
}
}
Util::sort_unique_erase(feature_specs);

Expand Down
30 changes: 6 additions & 24 deletions toolsrc/src/vcpkg/sourceparagraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ namespace vcpkg
constexpr static StringLiteral NAME = "name";
constexpr static StringLiteral DESCRIPTION = "description";
constexpr static StringLiteral DEPENDENCIES = "dependencies";
constexpr static StringLiteral SUPPORTS = "support";

virtual Span<const StringView> valid_fields() const override
{
Expand Down Expand Up @@ -496,6 +497,7 @@ namespace vcpkg
DEPENDENCIES,
feature->dependencies,
Json::ArrayDeserializer<DependencyDeserializer>{"an array of dependencies", Json::AllowEmpty::Yes});
r.optional_object_field(obj, SUPPORTS, feature->supports_expression, PlatformExprDeserializer{});

return std::move(feature);
}
Expand Down Expand Up @@ -726,31 +728,11 @@ namespace vcpkg

r.optional_object_field(obj, SUPPORTS, spgh->supports_expression, PlatformExprDeserializer{});

return dep;
}
};

struct FeatureField : Json::VisitorCrtpBase<FeatureField>
{
using type = std::unique_ptr<FeatureParagraph>;
StringView type_name() { return "a feature"; }

constexpr static StringView NAME = "name";
constexpr static StringView DESCRIPTION = "description";
constexpr static StringView DEPENDENCIES = "dependencies";
constexpr static StringView SUPPORTS = "supports";

Optional<std::unique_ptr<FeatureParagraph>> visit_object(Json::Reader& r, StringView, const Json::Object& obj)
{
auto feature = std::make_unique<FeatureParagraph>();

r.required_object_field(type_name(), obj, NAME, feature->name, IdentifierField{});
r.required_object_field(type_name(), obj, DESCRIPTION, feature->description, ParagraphField{});
r.optional_object_field(obj,
DEPENDENCIES,
feature->dependencies,
ArrayField<DependencyField>{"an array of dependencies", AllowEmpty::Yes});
r.optional_object_field(obj, SUPPORTS, feature->supports_expression, PlatformExprField{});
DEFAULT_FEATURES,
spgh->default_features,
Json::ArrayDeserializer<Json::IdentifierDeserializer>{"an array of identifiers",
Json::AllowEmpty::Yes});

r.optional_object_field(
obj,
Expand Down
20 changes: 0 additions & 20 deletions toolsrc/windows-bootstrap/dirs.proj

This file was deleted.

23 changes: 0 additions & 23 deletions toolsrc/windows-bootstrap/vcpkg.props

This file was deleted.

149 changes: 0 additions & 149 deletions toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj

This file was deleted.

27 changes: 0 additions & 27 deletions toolsrc/windows-bootstrap/vcpkg/vcpkg.vcxproj.filters

This file was deleted.

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.