From 307b761df4197bf9cf1b69652808530e6219a868 Mon Sep 17 00:00:00 2001 From: Daniel Shaw Date: Tue, 25 Jul 2017 21:29:31 -0700 Subject: partial end to end feature packages hdf5 added vcpkg feature package support to other commands remove comments change qualifier bracket to parens added features to qualified dependencies --- toolsrc/include/BinaryParagraph.h | 6 ++++++ toolsrc/include/Paragraphs.h | 2 +- toolsrc/include/SourceParagraph.h | 15 +++++++++++++-- toolsrc/include/StatusParagraphs.h | 3 +++ toolsrc/include/vcpkg_Commands.h | 2 +- toolsrc/include/vcpkg_Dependencies.h | 5 ++++- 6 files changed, 28 insertions(+), 5 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/BinaryParagraph.h index 1e12dd8a6..61e03343a 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/BinaryParagraph.h @@ -31,5 +31,11 @@ namespace vcpkg std::vector depends; }; + struct BinaryControlFile + { + BinaryParagraph core_paragraph; + std::vector features; + }; + void serialize(const BinaryParagraph& pgh, std::string& out_str); } \ No newline at end of file diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 60f509266..aae46f7da 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -20,7 +20,7 @@ namespace vcpkg::Paragraphs Parse::ParseExpected try_load_port(const Files::Filesystem& fs, const fs::path& control_path); - Expected try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec); + Expected try_load_cached_control_package(const VcpkgPaths& paths, const PackageSpec& spec); struct LoadResults { diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 7ddf999cc..fee61c3e8 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -15,13 +15,24 @@ namespace vcpkg struct Triplet; - struct Dependency + struct Features { std::string name; + std::vector features; + }; + + Features parse_feature_list(const std::string& name); + + struct Dependency + { + Features depend; std::string qualifier; + + std::string name() const; + static Dependency parse_dependency(std::string name, std::string qualifier); }; - const std::string& to_string(const Dependency& dep); + const std::string to_string(const Dependency& dep); struct FeatureParagraph { diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 2af177219..bf2ef2f3e 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -17,6 +17,9 @@ namespace vcpkg const_iterator find(const PackageSpec& spec) const { return find(spec.name(), spec.triplet()); } const_iterator find(const std::string& name, const Triplet& triplet) const; iterator find(const std::string& name, const Triplet& triplet); + std::vector*> StatusParagraphs::find_all(const std::string& name, + const Triplet& triplet); + iterator find(const std::string& name, const Triplet& triplet, const std::string& feature); const_iterator find_installed(const PackageSpec& spec) const { diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 8348a64e4..d5f316d69 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -59,7 +59,7 @@ namespace vcpkg::Commands const fs::path& source_dir, const InstallDir& dirs); void install_package(const VcpkgPaths& paths, - const BinaryParagraph& binary_paragraph, + const BinaryControlFile& binary_paragraph, StatusParagraphs* status_db); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index e3af0fd28..3fee8ef33 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -90,6 +90,7 @@ namespace vcpkg::Dependencies InstallPlanAction(InstallPlanAction&&) = default; InstallPlanAction& operator=(const InstallPlanAction&) = delete; InstallPlanAction& operator=(InstallPlanAction&&) = default; + std::string displayname() const; PackageSpec spec; AnyParagraph any_paragraph; @@ -205,7 +206,9 @@ namespace vcpkg::Dependencies std::unordered_map& pkg_to_cluster, GraphPlan& graph_plan); void mark_minus(Cluster& cluster, std::unordered_map& pkg_to_cluster, GraphPlan& graph_plan); - + void mark_plus_default(Cluster& cluster, + std::unordered_map& pkg_to_cluster, + GraphPlan& graph_plan); std::vector create_feature_install_plan(const std::unordered_map& map, const std::vector& specs, const StatusParagraphs& status_db); -- cgit v1.2.3 From 4d34488649fe5d71b8a553706d960a3784c56bb1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 18 Aug 2017 20:32:35 -0700 Subject: [vcpkg] Consolidate specifier parsing --- toolsrc/include/PackageSpec.h | 9 +++++++++ toolsrc/include/vcpkg_Checks.h | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 15b5e5b9b..77a14e90e 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -6,6 +6,15 @@ namespace vcpkg { + struct ParsedSpecifier + { + std::string name; + std::vector features; + std::string triplet; + + static ExpectedT from_string(const std::string& input); + }; + struct PackageSpec { static std::string to_string(const std::string& name, const Triplet& triplet); diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 6d8ff5711..754b44f75 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -5,18 +5,23 @@ namespace vcpkg::Checks { + // Indicate that an internal error has occurred and exit the tool. This should be used when invariants have been + // broken. [[noreturn]] void unreachable(const LineInfo& line_info); [[noreturn]] void exit_with_code(const LineInfo& line_info, const int exit_code); + // Exit the tool without an error message. [[noreturn]] inline void exit_fail(const LineInfo& line_info) { exit_with_code(line_info, EXIT_FAILURE); } + // Exit the tool successfully. [[noreturn]] inline void exit_success(const LineInfo& line_info) { exit_with_code(line_info, EXIT_SUCCESS); } - // Part of the reason these exist is to not include extra headers in this one to avoid circular #includes. + // Display an error message to the user and exit the tool. [[noreturn]] void exit_with_message(const LineInfo& line_info, const CStringView errorMessage); template + // Display an error message to the user and exit the tool. [[noreturn]] void exit_with_message(const LineInfo& line_info, const char* errorMessageTemplate, const Arg1 errorMessageArg1, -- cgit v1.2.3 From f219ce0b8c3e84e5fc1df21ad2f2c8b13f0fe413 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 19 Aug 2017 19:27:34 -0700 Subject: [vcpkg] Reorganize some parsing functions. --- toolsrc/include/PackageSpec.h | 11 +++++++++-- toolsrc/include/SourceParagraph.h | 12 +----------- toolsrc/include/vcpkg_Parse.h | 2 ++ 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 77a14e90e..8e986b4d6 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -1,6 +1,6 @@ #pragma once + #include "PackageSpecParseResult.h" -#include "SourceParagraph.h" #include "Triplet.h" #include "vcpkg_expected.h" @@ -17,7 +17,6 @@ namespace vcpkg struct PackageSpec { - static std::string to_string(const std::string& name, const Triplet& triplet); static ExpectedT from_name_and_triplet(const std::string& name, const Triplet& triplet); @@ -43,6 +42,14 @@ namespace vcpkg const Triplet& default_triplet); }; + struct Features + { + std::string name; + std::vector features; + + static ExpectedT from_string(const std::string& input); + }; + bool operator==(const PackageSpec& left, const PackageSpec& right); bool operator!=(const PackageSpec& left, const PackageSpec& right); } diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index fee61c3e8..d938e2e3b 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -1,5 +1,6 @@ #pragma once +#include "PackageSpec.h" #include "Span.h" #include "vcpkg_Parse.h" #include "vcpkg_System.h" @@ -13,16 +14,6 @@ namespace vcpkg { extern bool g_feature_packages; - struct Triplet; - - struct Features - { - std::string name; - std::vector features; - }; - - Features parse_feature_list(const std::string& name); - struct Dependency { Features depend; @@ -73,7 +64,6 @@ namespace vcpkg // zlib[uwp] becomes Dependency{"zlib", "uwp"} std::vector expand_qualified_dependencies(const std::vector& depends); - std::vector parse_comma_list(const std::string& str); struct Supports { diff --git a/toolsrc/include/vcpkg_Parse.h b/toolsrc/include/vcpkg_Parse.h index a2eb152dc..e663448b9 100644 --- a/toolsrc/include/vcpkg_Parse.h +++ b/toolsrc/include/vcpkg_Parse.h @@ -33,4 +33,6 @@ namespace vcpkg::Parse RawParagraph&& fields; std::vector missing_fields; }; + + std::vector parse_comma_list(const std::string& str); } -- cgit v1.2.3 From bd222504abea410d77487e176649ae9b6989c4e0 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 20 Aug 2017 19:09:39 -0700 Subject: [vcpkg] Refactor parsing together and flatten featurespec usages --- toolsrc/include/PackageSpec.h | 20 ++++++++++++++++++++ toolsrc/include/vcpkg_Dependencies.h | 9 +-------- 2 files changed, 21 insertions(+), 8 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 8e986b4d6..8b485316f 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -33,11 +33,31 @@ namespace vcpkg Triplet m_triplet; }; + struct FeatureSpec + { + FeatureSpec(const PackageSpec& spec, const std::string& feature) : m_spec(spec), m_feature(feature) {} + + const std::string& name() const { return m_spec.name(); } + const std::string& feature() const { return m_feature; } + const Triplet& triplet() const { return m_spec.triplet(); } + + const PackageSpec& spec() const { return m_spec; } + + static std::vector from_strings_and_triplet(const std::vector& depends, + const Triplet& t); + + private: + PackageSpec m_spec; + std::string m_feature; + }; + struct FullPackageSpec { PackageSpec package_spec; std::vector features; + static std::vector to_feature_specs(const std::vector& specs); + static ExpectedT from_string(const std::string& spec_as_string, const Triplet& default_triplet); }; diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 3fee8ef33..37d3a59e5 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -30,19 +30,12 @@ namespace vcpkg::Dependencies namespace vcpkg::Dependencies { - struct FeatureSpec - { - PackageSpec spec; - std::string feature_name; - }; - struct FeatureNodeEdges { std::vector remove_edges; std::vector build_edges; bool plus = false; }; - std::vector to_feature_specs(const std::vector& depends, const Triplet& t); struct Cluster { @@ -210,6 +203,6 @@ namespace vcpkg::Dependencies std::unordered_map& pkg_to_cluster, GraphPlan& graph_plan); std::vector create_feature_install_plan(const std::unordered_map& map, - const std::vector& specs, + const std::vector& specs, const StatusParagraphs& status_db); } -- cgit v1.2.3 From 1ba7cef1f07e8fd8c0053694b306dcc3960f720e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 20 Aug 2017 19:36:43 -0700 Subject: [vcpkg] Remove incomplete default features implementation --- toolsrc/include/SourceParagraph.h | 11 ++++++----- toolsrc/include/vcpkg_Dependencies.h | 8 -------- 2 files changed, 6 insertions(+), 13 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index d938e2e3b..05f18f940 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -23,6 +23,12 @@ namespace vcpkg static Dependency parse_dependency(std::string name, std::string qualifier); }; + std::vector filter_dependencies(const std::vector& deps, const Triplet& t); + std::vector filter_dependencies_to_specs(const std::vector& deps, const Triplet& t); + + // zlib[uwp] becomes Dependency{"zlib", "uwp"} + std::vector expand_qualified_dependencies(const std::vector& depends); + const std::string to_string(const Dependency& dep); struct FeatureParagraph @@ -60,11 +66,6 @@ namespace vcpkg return print_error_message({&error_info_list, 1}); } - std::vector filter_dependencies(const std::vector& deps, const Triplet& t); - - // zlib[uwp] becomes Dependency{"zlib", "uwp"} - std::vector expand_qualified_dependencies(const std::vector& depends); - struct Supports { static ExpectedT> parse(const std::vector& strs); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 37d3a59e5..3a81cf27b 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -194,14 +194,6 @@ namespace vcpkg::Dependencies Graphs::Graph remove_graph; Graphs::Graph install_graph; }; - bool mark_plus(const std::string& feature, - Cluster& cluster, - std::unordered_map& pkg_to_cluster, - GraphPlan& graph_plan); - void mark_minus(Cluster& cluster, std::unordered_map& pkg_to_cluster, GraphPlan& graph_plan); - void mark_plus_default(Cluster& cluster, - std::unordered_map& pkg_to_cluster, - GraphPlan& graph_plan); std::vector create_feature_install_plan(const std::unordered_map& map, const std::vector& specs, const StatusParagraphs& status_db); -- cgit v1.2.3 From c7de717cbc2b6ab89dc8056984c0a4685e9cf56e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 20 Aug 2017 20:06:21 -0700 Subject: [vcpkg] Refactor features implementation. Improve error handling. --- toolsrc/include/vcpkg_Dependencies.h | 48 ------------------------------------ 1 file changed, 48 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 3a81cf27b..9ac52490e 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -30,37 +30,6 @@ namespace vcpkg::Dependencies namespace vcpkg::Dependencies { - struct FeatureNodeEdges - { - std::vector remove_edges; - std::vector build_edges; - bool plus = false; - }; - - struct Cluster - { - std::vector status_paragraphs; - Optional source_control_file; - PackageSpec spec; - std::unordered_map edges; - std::unordered_set to_install_features; - std::unordered_set original_features; - bool will_remove = false; - bool transient_uninstalled = true; - Cluster() = default; - - private: - Cluster(const Cluster&) = delete; - Cluster& operator=(const Cluster&) = delete; - }; - - struct ClusterPtr - { - Cluster* ptr; - }; - - bool operator==(const ClusterPtr& l, const ClusterPtr& r); - enum class InstallPlanType { UNKNOWN, @@ -176,24 +145,7 @@ namespace vcpkg::Dependencies std::vector create_export_plan(const VcpkgPaths& paths, const std::vector& specs, const StatusParagraphs& status_db); -} -template<> -struct std::hash -{ - size_t operator()(const vcpkg::Dependencies::ClusterPtr& value) const - { - return std::hash()(value.ptr->spec); - } -}; - -namespace vcpkg::Dependencies -{ - struct GraphPlan - { - Graphs::Graph remove_graph; - Graphs::Graph install_graph; - }; std::vector create_feature_install_plan(const std::unordered_map& map, const std::vector& specs, const StatusParagraphs& status_db); -- cgit v1.2.3 From 27be8b5c7489ea52156669f8e556ad3db1fd11d1 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 21 Aug 2017 17:16:14 -0700 Subject: [vcpkg] Fix feature packages for non-default triplets. Reduce duplication between normal installs and feature installs. --- toolsrc/include/VcpkgPaths.h | 1 + toolsrc/include/vcpkg_Dependencies.h | 17 ++++++++++------- toolsrc/include/vcpkg_Util.h | 6 +++--- 3 files changed, 14 insertions(+), 10 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/VcpkgPaths.h b/toolsrc/include/VcpkgPaths.h index 95cd4bc28..e4e7ba83d 100644 --- a/toolsrc/include/VcpkgPaths.h +++ b/toolsrc/include/VcpkgPaths.h @@ -21,6 +21,7 @@ namespace vcpkg fs::path package_dir(const PackageSpec& spec) const; fs::path port_dir(const PackageSpec& spec) const; + fs::path port_dir(const std::string& name) const; fs::path build_info_file_path(const PackageSpec& spec) const; fs::path listfile_path(const BinaryParagraph& pgh) const; diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9ac52490e..e6c3c55c9 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -86,6 +86,9 @@ namespace vcpkg::Dependencies struct AnyAction { + AnyAction(InstallPlanAction&& iplan) : install_plan(std::move(iplan)) {} + AnyAction(RemovePlanAction&& rplan) : remove_plan(std::move(rplan)) {} + Optional install_plan; Optional remove_plan; }; @@ -114,21 +117,21 @@ namespace vcpkg::Dependencies RequestType request_type; }; - __interface PortFileProvider { virtual const SourceControlFile& get_control_file(const PackageSpec& spec) const; }; + __interface PortFileProvider { virtual const SourceControlFile& get_control_file(const std::string& spec) const; }; struct MapPortFile : PortFileProvider { - const std::unordered_map& ports; - explicit MapPortFile(const std::unordered_map& map); - const SourceControlFile& get_control_file(const PackageSpec& spec) const override; + const std::unordered_map& ports; + explicit MapPortFile(const std::unordered_map& map); + const SourceControlFile& get_control_file(const std::string& spec) const override; }; struct PathsPortFile : PortFileProvider { const VcpkgPaths& ports; - mutable std::unordered_map cache; + mutable std::unordered_map cache; explicit PathsPortFile(const VcpkgPaths& paths); - const SourceControlFile& get_control_file(const PackageSpec& spec) const override; + const SourceControlFile& get_control_file(const std::string& spec) const override; private: PathsPortFile(const PathsPortFile&) = delete; @@ -146,7 +149,7 @@ namespace vcpkg::Dependencies const std::vector& specs, const StatusParagraphs& status_db); - std::vector create_feature_install_plan(const std::unordered_map& map, + std::vector create_feature_install_plan(const std::unordered_map& map, const std::vector& specs, const StatusParagraphs& status_db); } diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index 671997e7e..a62b48d54 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -7,12 +7,12 @@ namespace vcpkg::Util { template - using FmapOut = decltype(std::declval()(std::declval()[0])); + using FmapOut = decltype(std::declval()(*begin(std::declval()))); template> - std::vector fmap(const Cont& xs, Func&& f) + std::vector fmap(Cont&& xs, Func&& f) { - using O = decltype(f(xs[0])); + using O = decltype(f(*begin(xs))); std::vector ret; ret.reserve(xs.size()); -- cgit v1.2.3 From d708484077ef891c5a69e4d9211613dbcfacb91e Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 21 Aug 2017 20:06:47 -0700 Subject: [vcpkg] Feature packages now include user requested packages even if they are already installed. --- toolsrc/include/vcpkg_Dependencies.h | 12 +++++++----- toolsrc/include/vcpkg_Util.h | 10 ++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index e6c3c55c9..bfb452596 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -3,6 +3,7 @@ #include "StatusParagraphs.h" #include "VcpkgPaths.h" #include "vcpkg_Graphs.h" +#include "vcpkg_Util.h" #include "vcpkg_optional.h" #include @@ -38,20 +39,21 @@ namespace vcpkg::Dependencies ALREADY_INSTALLED }; - struct InstallPlanAction + struct InstallPlanAction : Util::MoveOnlyBase { static bool compare_by_name(const InstallPlanAction* left, const InstallPlanAction* right); InstallPlanAction(); + + InstallPlanAction::InstallPlanAction(const PackageSpec& spec, + const std::unordered_set& features, + const RequestType& request_type); InstallPlanAction(const PackageSpec& spec, const AnyParagraph& any_paragraph, const RequestType& request_type); InstallPlanAction(const PackageSpec& spec, const SourceControlFile& any_paragraph, const std::unordered_set& features, const RequestType& request_type); - InstallPlanAction(const InstallPlanAction&) = delete; - InstallPlanAction(InstallPlanAction&&) = default; - InstallPlanAction& operator=(const InstallPlanAction&) = delete; - InstallPlanAction& operator=(InstallPlanAction&&) = default; + std::string displayname() const; PackageSpec spec; diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index a62b48d54..da2f8eb69 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -62,4 +62,14 @@ namespace vcpkg::Util (*output)[key].push_back(&element); } } + + struct MoveOnlyBase + { + MoveOnlyBase() = default; + MoveOnlyBase(const MoveOnlyBase&) = delete; + MoveOnlyBase(MoveOnlyBase&&) = default; + + MoveOnlyBase& operator=(const MoveOnlyBase&) = delete; + MoveOnlyBase& operator=(MoveOnlyBase&&) = default; + }; } \ No newline at end of file -- cgit v1.2.3 From 6784704638f46d89d01458b1004e588f535958aa Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 21 Aug 2017 21:08:43 -0700 Subject: [vcpkg] Improve error messages when a feature is requested that doesn't exist. --- toolsrc/include/PackageSpec.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 8b485316f..c5ce767f9 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -43,6 +43,8 @@ namespace vcpkg const PackageSpec& spec() const { return m_spec; } + std::string to_string() const; + static std::vector from_strings_and_triplet(const std::vector& depends, const Triplet& t); -- cgit v1.2.3 From 92dd1b77ed043da376c86874aacc1233270fedae Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 22 Aug 2017 15:14:15 -0700 Subject: [vcpkg] Add Util::ResourceBase, use MoveOnlyBase --- toolsrc/include/vcpkg_Dependencies.h | 20 ++++---------------- toolsrc/include/vcpkg_Util.h | 10 ++++++++++ 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index bfb452596..93719efe9 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -70,16 +70,12 @@ namespace vcpkg::Dependencies REMOVE }; - struct RemovePlanAction + struct RemovePlanAction : Util::MoveOnlyBase { static bool compare_by_name(const RemovePlanAction* left, const RemovePlanAction* right); RemovePlanAction(); RemovePlanAction(const PackageSpec& spec, const RemovePlanType& plan_type, const RequestType& request_type); - RemovePlanAction(const RemovePlanAction&) = delete; - RemovePlanAction(RemovePlanAction&&) = default; - RemovePlanAction& operator=(const RemovePlanAction&) = delete; - RemovePlanAction& operator=(RemovePlanAction&&) = default; PackageSpec spec; RemovePlanType plan_type; @@ -102,16 +98,12 @@ namespace vcpkg::Dependencies ALREADY_BUILT }; - struct ExportPlanAction + struct ExportPlanAction : Util::MoveOnlyBase { static bool compare_by_name(const ExportPlanAction* left, const ExportPlanAction* right); ExportPlanAction(); ExportPlanAction(const PackageSpec& spec, const AnyParagraph& any_paragraph, const RequestType& request_type); - ExportPlanAction(const ExportPlanAction&) = delete; - ExportPlanAction(ExportPlanAction&&) = default; - ExportPlanAction& operator=(const ExportPlanAction&) = delete; - ExportPlanAction& operator=(ExportPlanAction&&) = default; PackageSpec spec; AnyParagraph any_paragraph; @@ -121,23 +113,19 @@ namespace vcpkg::Dependencies __interface PortFileProvider { virtual const SourceControlFile& get_control_file(const std::string& spec) const; }; - struct MapPortFile : PortFileProvider + struct MapPortFile : Util::ResourceBase, PortFileProvider { const std::unordered_map& ports; explicit MapPortFile(const std::unordered_map& map); const SourceControlFile& get_control_file(const std::string& spec) const override; }; - struct PathsPortFile : PortFileProvider + struct PathsPortFile : Util::ResourceBase, PortFileProvider { const VcpkgPaths& ports; mutable std::unordered_map cache; explicit PathsPortFile(const VcpkgPaths& paths); const SourceControlFile& get_control_file(const std::string& spec) const override; - - private: - PathsPortFile(const PathsPortFile&) = delete; - PathsPortFile& operator=(const PathsPortFile&) = delete; }; std::vector create_install_plan(const PortFileProvider& port_file_provider, diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index da2f8eb69..4f45cd2c7 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -72,4 +72,14 @@ namespace vcpkg::Util MoveOnlyBase& operator=(const MoveOnlyBase&) = delete; MoveOnlyBase& operator=(MoveOnlyBase&&) = default; }; + + struct ResourceBase + { + ResourceBase() = default; + ResourceBase(const ResourceBase&) = delete; + ResourceBase(ResourceBase&&) = delete; + + ResourceBase& operator=(const ResourceBase&) = delete; + ResourceBase& operator=(ResourceBase&&) = delete; + }; } \ No newline at end of file -- cgit v1.2.3 From 687ea82f89504520e2a4c60feeb5c0bf6260a4de Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 22 Aug 2017 15:59:27 -0700 Subject: [vcpkg] Improve formatting of search and list. Fix gl2ps version. --- toolsrc/include/vcpkglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index bd2400b77..63b358d74 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -36,5 +36,5 @@ namespace vcpkg const fs::path& cmake_script, const std::vector& pass_variables); - std::string shorten_description(const std::string& desc); + std::string shorten_text(const std::string& desc, size_t length); } // namespace vcpkg -- cgit v1.2.3 From 14a99b073059d4fcae149a9085254fcb2e78e443 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 23 Aug 2017 15:47:42 -0700 Subject: [vcpkg] Deduplicate code from feature packages --- toolsrc/include/vcpkg_Build.h | 1 + toolsrc/include/vcpkg_Commands.h | 12 +++++++++--- toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/include/vcpkg_Util.h | 19 ++++++++++++++++--- 4 files changed, 27 insertions(+), 7 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index c4f3e6746..32909f4e1 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -52,6 +52,7 @@ namespace vcpkg::Build SUCCEEDED, BUILD_FAILED, POST_BUILD_CHECKS_FAILED, + FILE_CONFLICTS, CASCADED_DUE_TO_MISSING_DEPENDENCIES }; diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index d5f316d69..756a12f01 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -55,12 +55,18 @@ namespace vcpkg::Commands const Build::BuildPackageOptions& install_plan_options, StatusParagraphs& status_db); + enum class InstallResult + { + FILE_CONFLICTS, + SUCCESS, + }; + void install_files_and_write_listfile(Files::Filesystem& fs, const fs::path& source_dir, const InstallDir& dirs); - void install_package(const VcpkgPaths& paths, - const BinaryControlFile& binary_paragraph, - StatusParagraphs* status_db); + InstallResult install_package(const VcpkgPaths& paths, + const BinaryControlFile& binary_paragraph, + StatusParagraphs* status_db); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 93719efe9..c1f6ad9a5 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -23,7 +23,7 @@ namespace vcpkg::Dependencies std::vector dependencies(const Triplet& triplet) const; Optional status_paragraph; - Optional binary_paragraph; + Optional binary_control_file; Optional source_paragraph; Optional source_control_file; }; diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index 4f45cd2c7..cfbd23020 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -12,9 +12,7 @@ namespace vcpkg::Util template> std::vector fmap(Cont&& xs, Func&& f) { - using O = decltype(f(*begin(xs))); - - std::vector ret; + std::vector ret; ret.reserve(xs.size()); for (auto&& x : xs) @@ -23,6 +21,21 @@ namespace vcpkg::Util return ret; } + template + using FmapFlattenOut = std::decay_t()(*begin(std::declval()))))>; + + template> + std::vector fmap_flatten(Cont&& xs, Func&& f) + { + std::vector ret; + + for (auto&& x : xs) + for (auto&& y : f(x)) + ret.push_back(std::move(y)); + + return ret; + } + template void unstable_keep_if(Container& cont, Pred pred) { -- cgit v1.2.3 From bed70f54bc2dd7181a54bbbb94d2fe3a1a0b35cc Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 23 Aug 2017 22:46:28 -0700 Subject: [vcpkg] Add stringify for BuildResult::FILE_CONFLICTS --- toolsrc/include/vcpkg_Build.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index 32909f4e1..e12ed3b1d 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -56,10 +56,11 @@ namespace vcpkg::Build CASCADED_DUE_TO_MISSING_DEPENDENCIES }; - static constexpr std::array BuildResult_values = { + static constexpr std::array BuildResult_values = { BuildResult::SUCCEEDED, BuildResult::BUILD_FAILED, BuildResult::POST_BUILD_CHECKS_FAILED, + BuildResult::FILE_CONFLICTS, BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES}; const std::string& to_string(const BuildResult build_result); -- cgit v1.2.3 From 7dd082cad7b1b8323fb5409399614e8e0f4cddf2 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Thu, 24 Aug 2017 13:26:42 +0300 Subject: [vcpkg] testing for architectures supported by toolset --- toolsrc/include/VcpkgPaths.h | 13 +++++++++++++ toolsrc/include/vcpkg_System.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/VcpkgPaths.h b/toolsrc/include/VcpkgPaths.h index e4e7ba83d..7964129e5 100644 --- a/toolsrc/include/VcpkgPaths.h +++ b/toolsrc/include/VcpkgPaths.h @@ -8,11 +8,24 @@ namespace vcpkg { + struct ToolsetArchOption + { + CWStringView name; + System::CPUArchitecture host_arch; + System::CPUArchitecture target_arch; + + bool operator==(const ToolsetArchOption& a) const + { + return (name == a.name && host_arch == a.host_arch && target_arch == a.target_arch); + } + }; + struct Toolset { fs::path dumpbin; fs::path vcvarsall; CWStringView version; + std::vector supported_architectures; }; struct VcpkgPaths diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 2ea0241f6..32da6e39c 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -77,6 +77,8 @@ namespace vcpkg::System CPUArchitecture get_host_processor(); + std::vector get_supported_host_architectures(); + const fs::path& get_ProgramFiles_32_bit(); const fs::path& get_ProgramFiles_platform_bitness(); -- cgit v1.2.3 From 14f42a66d3e3eca8c2d917fc391a1f8e8bfa7de8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 24 Aug 2017 12:06:22 -0700 Subject: [Strings::format] Add overload for unisigned long --- toolsrc/include/vcpkg_Strings.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 325a2cb4c..e94742c8f 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -19,10 +19,12 @@ namespace vcpkg::Strings::details inline long long to_printf_arg(const long long s) { return s; } - inline double to_printf_arg(const double s) { return s; } + inline unsigned long to_printf_arg(const unsigned long s) { return s; } inline size_t to_printf_arg(const size_t s) { return s; } + inline double to_printf_arg(const double s) { return s; } + std::string format_internal(const char* fmtstr, ...); inline const wchar_t* to_wprintf_arg(const std::wstring& s) { return s.c_str(); } -- cgit v1.2.3 From e237682cad4eaa582a10b5ad03a59ca6449e0795 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 23 Aug 2017 16:17:53 -0700 Subject: Introduce GlobalState struct --- toolsrc/include/SourceParagraph.h | 2 -- toolsrc/include/vcpkg_GlobalState.h | 13 +++++++++++++ toolsrc/include/vcpkglib.h | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 toolsrc/include/vcpkg_GlobalState.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 05f18f940..8563d83b0 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -12,8 +12,6 @@ namespace vcpkg { - extern bool g_feature_packages; - struct Dependency { Features depend; diff --git a/toolsrc/include/vcpkg_GlobalState.h b/toolsrc/include/vcpkg_GlobalState.h new file mode 100644 index 000000000..15b8867f7 --- /dev/null +++ b/toolsrc/include/vcpkg_GlobalState.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +namespace vcpkg +{ + struct GlobalState + { + static ElapsedTime timer; + static bool debugging; + static bool feature_packages; + }; +} \ No newline at end of file diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index 63b358d74..0bb75f9b5 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -6,8 +6,6 @@ namespace vcpkg { - extern bool g_debugging; - StatusParagraphs database_load_check(const VcpkgPaths& paths); void write_update(const VcpkgPaths& paths, const StatusParagraph& p); -- cgit v1.2.3 From 88d96a3699118cf21f6ec92284eb591db25d3a6a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 23 Aug 2017 16:47:54 -0700 Subject: Run cleanup before exiting instead of calling atexit --- toolsrc/include/vcpkg_Checks.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 754b44f75..01cb7209b 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -5,6 +5,8 @@ namespace vcpkg::Checks { + void register_console_ctrl_handler(); + // Indicate that an internal error has occurred and exit the tool. This should be used when invariants have been // broken. [[noreturn]] void unreachable(const LineInfo& line_info); -- cgit v1.2.3 From 98ee8a949ad4bfdfa9bf0411b552a23c923eaff7 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Aug 2017 16:03:57 -0700 Subject: [vcpkg] Trap Ctrl-C, enable thread safety for global data structures --- toolsrc/include/metrics.h | 30 +++++++++++++++++++----------- toolsrc/include/pch.h | 2 ++ toolsrc/include/vcpkg_GlobalState.h | 11 +++++++---- toolsrc/include/vcpkg_Util.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 15 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/metrics.h b/toolsrc/include/metrics.h index 1f5ae2f32..8eae426de 100644 --- a/toolsrc/include/metrics.h +++ b/toolsrc/include/metrics.h @@ -2,19 +2,27 @@ #include +#include "vcpkg_Util.h" + namespace vcpkg::Metrics { - void set_send_metrics(bool should_send_metrics); - void set_print_metrics(bool should_print_metrics); - void set_user_information(const std::string& user_id, const std::string& first_use_time); - void init_user_information(std::string& user_id, std::string& first_use_time); + struct Metrics : Util::ResourceBase + { + void set_send_metrics(bool should_send_metrics); + void set_print_metrics(bool should_print_metrics); + void set_user_information(const std::string& user_id, const std::string& first_use_time); + void init_user_information(std::string& user_id, std::string& first_use_time); - void track_metric(const std::string& name, double value); - void track_property(const std::string& name, const std::string& value); - void track_property(const std::string& name, const std::wstring& value); - bool get_compiled_metrics_enabled(); - std::wstring get_SQM_user(); + void track_metric(const std::string& name, double value); + void track_property(const std::string& name, const std::string& value); + void track_property(const std::string& name, const std::wstring& value); + + void upload(const std::string& payload); + void flush(); + }; - void upload(const std::string& payload); - void flush(); + extern Util::LockGuarded g_metrics; + + std::wstring get_SQM_user(); + bool get_compiled_metrics_enabled(); } diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 406d0741e..770bcf07a 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/toolsrc/include/vcpkg_GlobalState.h b/toolsrc/include/vcpkg_GlobalState.h index 15b8867f7..8f47fa00f 100644 --- a/toolsrc/include/vcpkg_GlobalState.h +++ b/toolsrc/include/vcpkg_GlobalState.h @@ -1,13 +1,16 @@ #pragma once -#include +#include + +#include "vcpkg_Chrono.h" +#include "vcpkg_Util.h" namespace vcpkg { struct GlobalState { - static ElapsedTime timer; - static bool debugging; - static bool feature_packages; + static Util::LockGuarded timer; + static std::atomic debugging; + static std::atomic feature_packages; }; } \ No newline at end of file diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg_Util.h index cfbd23020..c76ca01ac 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg_Util.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -95,4 +96,34 @@ namespace vcpkg::Util ResourceBase& operator=(const ResourceBase&) = delete; ResourceBase& operator=(ResourceBase&&) = delete; }; + + template + struct LockGuardPtr; + + template + struct LockGuarded + { + friend struct LockGuardPtr; + + LockGuardPtr lock() { return *this; } + + private: + std::mutex m_mutex; + T m_t; + }; + + template + struct LockGuardPtr + { + T& operator*() { return m_ptr; } + T* operator->() { return &m_ptr; } + + T* get() { return &m_ptr; } + + LockGuardPtr(LockGuarded& sync) : m_lock(sync.m_mutex), m_ptr(sync.m_t) {} + + private: + std::unique_lock m_lock; + T& m_ptr; + }; } \ No newline at end of file -- cgit v1.2.3 From 67b9475ef29496508640f73410a10ecf737389eb Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 25 Aug 2017 16:55:14 -0700 Subject: [vcpkg] Set codepage to 65001, duplicate of #1682, fixes #1660 #1631 #1644 --- toolsrc/include/vcpkg_GlobalState.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_GlobalState.h b/toolsrc/include/vcpkg_GlobalState.h index 8f47fa00f..6522a25bf 100644 --- a/toolsrc/include/vcpkg_GlobalState.h +++ b/toolsrc/include/vcpkg_GlobalState.h @@ -12,5 +12,8 @@ namespace vcpkg static Util::LockGuarded timer; static std::atomic debugging; static std::atomic feature_packages; + + static std::atomic g_init_console_cp; + static std::atomic g_init_console_output_cp; }; } \ No newline at end of file -- cgit v1.2.3 From 70949b0d814c469d76b8ddecc514ae0af6686347 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Aug 2017 00:19:51 -0700 Subject: [vcpkg] Use vcvars argument strings from detected toolset. Avoid c-string pointer comparison. --- toolsrc/include/VcpkgPaths.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/VcpkgPaths.h b/toolsrc/include/VcpkgPaths.h index 7964129e5..d55c95fe1 100644 --- a/toolsrc/include/VcpkgPaths.h +++ b/toolsrc/include/VcpkgPaths.h @@ -13,11 +13,6 @@ namespace vcpkg CWStringView name; System::CPUArchitecture host_arch; System::CPUArchitecture target_arch; - - bool operator==(const ToolsetArchOption& a) const - { - return (name == a.name && host_arch == a.host_arch && target_arch == a.target_arch); - } }; struct Toolset -- cgit v1.2.3 From 21402365061b454f525bbc2dfb1a2ae889eaa286 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 14:42:44 -0700 Subject: Fix /permissive- issue --- toolsrc/include/vcpkg_Dependencies.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index c1f6ad9a5..235abb839 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -45,9 +45,9 @@ namespace vcpkg::Dependencies InstallPlanAction(); - InstallPlanAction::InstallPlanAction(const PackageSpec& spec, - const std::unordered_set& features, - const RequestType& request_type); + InstallPlanAction(const PackageSpec& spec, + const std::unordered_set& features, + const RequestType& request_type); InstallPlanAction(const PackageSpec& spec, const AnyParagraph& any_paragraph, const RequestType& request_type); InstallPlanAction(const PackageSpec& spec, const SourceControlFile& any_paragraph, -- cgit v1.2.3 From 75cc10b0f3351241588d307c625138aa358499fe Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 17:10:50 -0700 Subject: Add missing const --- toolsrc/include/vcpkg_Build.h | 2 +- toolsrc/include/vcpkg_Strings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index e12ed3b1d..fc6f28e24 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -161,7 +161,7 @@ namespace vcpkg::Build inline bool is_enabled(BuildPolicy policy) const { - auto it = m_policies.find(policy); + const auto it = m_policies.find(policy); if (it != m_policies.cend()) return it->second; return false; } diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index e94742c8f..7cea63676 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -71,7 +71,7 @@ namespace vcpkg::Strings } std::basic_string output; - size_t size = v.size(); + const size_t size = v.size(); output.append(transformer(v[0])); -- cgit v1.2.3 From dc46f68f6a2e7a4079c6ad1e1545705d379b9a51 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 18:36:25 -0700 Subject: [Strings::join()] Modify to work for any container --- toolsrc/include/vcpkg_Strings.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 7cea63676..a7c6148d7 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -65,20 +65,20 @@ namespace vcpkg::Strings template std::basic_string join(const CharType* delimiter, const Container& v, Transformer transformer) { - if (v.size() == 0) + const auto begin = v.begin(); + const auto end = v.end(); + + if (begin == end) { return std::basic_string(); } std::basic_string output; - const size_t size = v.size(); - - output.append(transformer(v[0])); - - for (size_t i = 1; i < size; ++i) + output.append(transformer(*begin)); + for (auto it = std::next(begin); it != end; ++it) { output.append(delimiter); - output.append(transformer(v[i])); + output.append(transformer(*it)); } return output; @@ -86,7 +86,7 @@ namespace vcpkg::Strings template std::basic_string join(const CharType* delimiter, const Container& v) { - using Element = decltype(v[0]); + using Element = decltype(*v.begin()); return join(delimiter, v, [](const Element& x) -> const Element& { return x; }); } -- cgit v1.2.3 From 259d6f83b46da9b7127eb8c7907cdcb74ce5bdf4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 18:45:30 -0700 Subject: Introduce Strings::EMPTY --- toolsrc/include/vcpkg_Strings.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index a7c6148d7..5dd420232 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -36,6 +36,9 @@ namespace vcpkg::Strings::details namespace vcpkg::Strings { + static constexpr const CStringView EMPTY = ""; + static constexpr const CWStringView WEMPTY = L""; + template std::string format(const char* fmtstr, const Args&... args) { -- cgit v1.2.3 From 7d46adb47ca332a072ffb382e4a533aa68a17062 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 18:46:28 -0700 Subject: Use Strings::EMPTY --- toolsrc/include/vcpkg_System.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 32da6e39c..86bb24aad 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -23,7 +23,7 @@ namespace vcpkg::System ExitCodeAndOutput cmd_execute_and_capture_output(const CWStringView cmd_line); - std::wstring create_powershell_script_cmd(const fs::path& script_path, const CWStringView args = L""); + std::wstring create_powershell_script_cmd(const fs::path& script_path, const CWStringView args = Strings::WEMPTY); enum class Color { -- cgit v1.2.3 From f3d803addfb3d84d828786d2e6b0b8a34f2fc494 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 18:54:48 -0700 Subject: Introduce Strings::is_empty() --- toolsrc/include/vcpkg_Strings.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 5dd420232..5af7c6f7c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -39,6 +39,9 @@ namespace vcpkg::Strings static constexpr const CStringView EMPTY = ""; static constexpr const CWStringView WEMPTY = L""; + bool is_empty(const CStringView s); + bool is_empty(const CWStringView s); + template std::string format(const char* fmtstr, const Args&... args) { -- cgit v1.2.3 From 5b91a84230e85e8f560fb78de1fd4bf6b68e8756 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 19:27:32 -0700 Subject: Change Strings::EMPTY to char * --- toolsrc/include/vcpkg_Strings.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 5af7c6f7c..2607caf4c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -36,8 +36,8 @@ namespace vcpkg::Strings::details namespace vcpkg::Strings { - static constexpr const CStringView EMPTY = ""; - static constexpr const CWStringView WEMPTY = L""; + static constexpr const char* EMPTY = ""; + static constexpr const wchar_t* WEMPTY = L""; bool is_empty(const CStringView s); bool is_empty(const CWStringView s); -- cgit v1.2.3 From 992f192c5e937f22877117e64ff7a38a6447c4bc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 28 Aug 2017 19:29:12 -0700 Subject: Add System::println() with no args --- toolsrc/include/vcpkg_System.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 86bb24aad..9dd9ea8bd 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -32,6 +32,7 @@ namespace vcpkg::System warning = 14, }; + void println(); void print(const CStringView message); void println(const CStringView message); void print(const Color c, const CStringView message); -- cgit v1.2.3 From 5337adf1078f27c993f01662b7dadb8da2801356 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Aug 2017 16:20:21 -0700 Subject: Remove Strings::is_empty(). Use std::string.empty() --- toolsrc/include/vcpkg_Strings.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 2607caf4c..61f6fab61 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -39,9 +39,6 @@ namespace vcpkg::Strings static constexpr const char* EMPTY = ""; static constexpr const wchar_t* WEMPTY = L""; - bool is_empty(const CStringView s); - bool is_empty(const CWStringView s); - template std::string format(const char* fmtstr, const Args&... args) { -- cgit v1.2.3 From d35a5c98e48a32ef66fe2aaabe154edee2323d0e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Aug 2017 12:34:12 -0700 Subject: Fix /permissive- issue --- toolsrc/include/StatusParagraphs.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index bf2ef2f3e..1a9ee6a03 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -17,8 +17,7 @@ namespace vcpkg const_iterator find(const PackageSpec& spec) const { return find(spec.name(), spec.triplet()); } const_iterator find(const std::string& name, const Triplet& triplet) const; iterator find(const std::string& name, const Triplet& triplet); - std::vector*> StatusParagraphs::find_all(const std::string& name, - const Triplet& triplet); + std::vector*> find_all(const std::string& name, const Triplet& triplet); iterator find(const std::string& name, const Triplet& triplet, const std::string& feature); const_iterator find_installed(const PackageSpec& spec) const -- cgit v1.2.3 From 62cde6598ddbf30f6872895aaf9715fc87f7b7aa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Aug 2017 22:42:43 -0700 Subject: Move function to Files::find_from_PATH() --- toolsrc/include/vcpkg_Files.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index ad29ffa14..855e8ea45 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -38,4 +38,6 @@ namespace vcpkg::Files bool has_invalid_chars_for_filesystem(const std::string& s); void print_paths(const std::vector& paths); + + std::vector find_from_PATH(const std::wstring& name); } -- cgit v1.2.3 From d86d9727f6802a5f642e550db13e97a9a2ea8a29 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 31 Aug 2017 18:02:12 -0700 Subject: Function naming convention --- toolsrc/include/vcpkg_System.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 9dd9ea8bd..dc57e02df 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -80,7 +80,7 @@ namespace vcpkg::System std::vector get_supported_host_architectures(); - const fs::path& get_ProgramFiles_32_bit(); + const fs::path& get_program_files_32_bit(); const fs::path& get_ProgramFiles_platform_bitness(); } -- cgit v1.2.3 From 72394491b20753c3ee3987c5f15aedfc0742a0d8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 31 Aug 2017 18:02:51 -0700 Subject: Naming convention --- toolsrc/include/vcpkg_System.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index dc57e02df..65f80ae6d 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -82,7 +82,7 @@ namespace vcpkg::System const fs::path& get_program_files_32_bit(); - const fs::path& get_ProgramFiles_platform_bitness(); + const fs::path& get_program_files_platform_bitness(); } namespace vcpkg::Debug -- cgit v1.2.3 From badecd4207902b5faebb07a2c2f807f345994040 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 31 Aug 2017 18:03:54 -0700 Subject: CoffFileReader naming convention --- toolsrc/include/coff_file_reader.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index 09f6447c2..7287211a1 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -3,7 +3,7 @@ #include "filesystem_fs.h" #include -namespace vcpkg::COFFFileReader +namespace vcpkg::CoffFileReader { struct DllInfo { -- cgit v1.2.3 From c15c80e802f432f1b8d3775c7abff5e91531b641 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 1 Sep 2017 17:01:02 -0700 Subject: [vcpkg_Parse] Add missing const --- toolsrc/include/vcpkg_Parse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Parse.h b/toolsrc/include/vcpkg_Parse.h index e663448b9..2dda033b3 100644 --- a/toolsrc/include/vcpkg_Parse.h +++ b/toolsrc/include/vcpkg_Parse.h @@ -26,7 +26,7 @@ namespace vcpkg::Parse ParagraphParser(RawParagraph&& fields) : fields(std::move(fields)) {} void required_field(const std::string& fieldname, std::string& out); - std::string optional_field(const std::string& fieldname); + std::string optional_field(const std::string& fieldname) const; std::unique_ptr error_info(const std::string& name) const; private: -- cgit v1.2.3 From 2d758beea9d8068f189f79d79b4087e40d42154b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 1 Sep 2017 17:05:22 -0700 Subject: [vcpkg_Checks] Naming convention fixes --- toolsrc/include/vcpkg_Checks.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 01cb7209b..ce486ac19 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -20,33 +20,35 @@ namespace vcpkg::Checks [[noreturn]] inline void exit_success(const LineInfo& line_info) { exit_with_code(line_info, EXIT_SUCCESS); } // Display an error message to the user and exit the tool. - [[noreturn]] void exit_with_message(const LineInfo& line_info, const CStringView errorMessage); + [[noreturn]] void exit_with_message(const LineInfo& line_info, const CStringView error_message); template // Display an error message to the user and exit the tool. [[noreturn]] void exit_with_message(const LineInfo& line_info, - const char* errorMessageTemplate, - const Arg1 errorMessageArg1, - const Args&... errorMessageArgs) + const char* error_message_template, + const Arg1 error_message_arg1, + const Args&... error_message_args) { - exit_with_message(line_info, Strings::format(errorMessageTemplate, errorMessageArg1, errorMessageArgs...)); + exit_with_message(line_info, + Strings::format(error_message_template, error_message_arg1, error_message_args...)); } void check_exit(const LineInfo& line_info, bool expression); - void check_exit(const LineInfo& line_info, bool expression, const CStringView errorMessage); + void check_exit(const LineInfo& line_info, bool expression, const CStringView error_message); template void check_exit(const LineInfo& line_info, Conditional&& expression, - const char* errorMessageTemplate, - const Arg1 errorMessageArg1, - const Args&... errorMessageArgs) + const char* error_message_template, + const Arg1 error_message_arg1, + const Args&... error_message_args) { if (!expression) { // Only create the string if the expression is false - exit_with_message(line_info, Strings::format(errorMessageTemplate, errorMessageArg1, errorMessageArgs...)); + exit_with_message(line_info, + Strings::format(error_message_template, error_message_arg1, error_message_args...)); } } } -- cgit v1.2.3 From 66eeab0015866417f4386a3822127ce7d40c49f9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 1 Sep 2017 17:08:21 -0700 Subject: [Triplet] Naming convention and missing const --- toolsrc/include/triplet.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/triplet.h b/toolsrc/include/triplet.h index be3bcf5b3..46a52f8e6 100644 --- a/toolsrc/include/triplet.h +++ b/toolsrc/include/triplet.h @@ -9,7 +9,7 @@ namespace vcpkg struct Triplet { public: - constexpr Triplet() : m_instance(&default_instance) {} + constexpr Triplet() : m_instance(&DEFAULT_INSTANCE) {} static Triplet from_canonical_name(const std::string& triplet_as_string); @@ -26,7 +26,7 @@ namespace vcpkg bool operator==(const Triplet& other) const; private: - static const TripletInstance default_instance; + static const TripletInstance DEFAULT_INSTANCE; constexpr Triplet(const TripletInstance* ptr) : m_instance(ptr) {} -- cgit v1.2.3 From e25a125d8540f13410008dff7281b5d679ac9fcb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 1 Sep 2017 17:13:45 -0700 Subject: Don't return by const copy --- toolsrc/include/SourceParagraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 8563d83b0..3ee2138f1 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -27,7 +27,7 @@ namespace vcpkg // zlib[uwp] becomes Dependency{"zlib", "uwp"} std::vector expand_qualified_dependencies(const std::vector& depends); - const std::string to_string(const Dependency& dep); + std::string to_string(const Dependency& dep); struct FeatureParagraph { -- cgit v1.2.3 From 95fa51a12a6e01c08a6b39ac45ecf711c45841fa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 1 Sep 2017 17:14:26 -0700 Subject: Remove unused #include --- toolsrc/include/SourceParagraph.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 3ee2138f1..1357b3769 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,7 +7,6 @@ #include "vcpkg_expected.h" #include -#include #include namespace vcpkg -- cgit v1.2.3 From d2de7d3e7d1a0bea3dba9a0a7f6cfff68ae513a0 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 7 Sep 2017 16:16:30 -0700 Subject: [vcpkg_Build.h] Naming scheme, unneeded #include, unneeded inline --- toolsrc/include/vcpkg_Build.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index fc6f28e24..78e89d4de 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -9,7 +9,6 @@ #include #include -#include #include namespace vcpkg::Build @@ -56,7 +55,7 @@ namespace vcpkg::Build CASCADED_DUE_TO_MISSING_DEPENDENCIES }; - static constexpr std::array BuildResult_values = { + static constexpr std::array BUILD_RESULT_VALUES = { BuildResult::SUCCEEDED, BuildResult::BUILD_FAILED, BuildResult::POST_BUILD_CHECKS_FAILED, @@ -143,7 +142,7 @@ namespace vcpkg::Build COUNT, }; - constexpr std::array g_all_policies = { + constexpr std::array G_ALL_POLICIES = { BuildPolicy::EMPTY_PACKAGE, BuildPolicy::DLLS_WITHOUT_LIBS, BuildPolicy::ONLY_RELEASE_CRT, @@ -159,7 +158,7 @@ namespace vcpkg::Build BuildPolicies() = default; BuildPolicies(std::map&& map) : m_policies(std::move(map)) {} - inline bool is_enabled(BuildPolicy policy) const + bool is_enabled(BuildPolicy policy) const { const auto it = m_policies.find(policy); if (it != m_policies.cend()) return it->second; -- cgit v1.2.3 From 43dde3f4892be55558b012b845d864e7be95c7b9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 13 Sep 2017 16:10:25 -0700 Subject: Refactor package removal code to eliminate its duplication --- toolsrc/include/vcpkg_Commands.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 756a12f01..079388587 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -82,6 +82,19 @@ namespace vcpkg::Commands namespace Remove { + enum class Purge + { + NO = 0, + YES + }; + + inline Purge to_purge(const bool value) { return value ? Purge::YES : Purge::NO; } + + void perform_remove_plan_action(const VcpkgPaths& paths, + const Dependencies::RemovePlanAction& action, + const Purge purge, + StatusParagraphs& status_db); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db); } -- cgit v1.2.3 From d521d366b278e9e963c18d34a7c5f41f42ea9ec7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 13 Sep 2017 17:23:04 -0700 Subject: Rework vcpkg install (and vcpkg ci) - Refactor install-plan-execution code to reduce duplication - Add `vcpkg install --keep-going` option - Add elapsed time to each invidial package and total time - Add a counter to the install (e.g. Starting package 3/12: ) --- toolsrc/include/vcpkg_Commands.h | 24 ++++++++++++++++++++++++ toolsrc/include/vcpkg_Dependencies.h | 2 ++ 2 files changed, 26 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 079388587..070a8ec49 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -33,6 +33,22 @@ namespace vcpkg::Commands namespace Install { + enum class KeepGoing + { + NO = 0, + YES + }; + + inline KeepGoing to_keep_going(const bool value) { return value ? KeepGoing::YES : KeepGoing::NO; } + + enum class PrintSummary + { + NO = 0, + YES + }; + + inline PrintSummary to_print_summary(const bool value) { return value ? PrintSummary::YES : PrintSummary::NO; } + struct InstallDir { static InstallDir from_destination_root(const fs::path& destination_root, @@ -67,6 +83,14 @@ namespace vcpkg::Commands InstallResult install_package(const VcpkgPaths& paths, const BinaryControlFile& binary_paragraph, StatusParagraphs* status_db); + + void perform_and_exit(const std::vector& action_plan, + const Build::BuildPackageOptions& install_plan_options, + const KeepGoing keep_going, + const PrintSummary print_summary, + const VcpkgPaths& paths, + StatusParagraphs& status_db); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 235abb839..d67122e48 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -89,6 +89,8 @@ namespace vcpkg::Dependencies Optional install_plan; Optional remove_plan; + + const PackageSpec& spec() const; }; enum class ExportPlanType -- cgit v1.2.3 From 2d6029e41c68fd44b22f8cef1b13fbaa44c8fad9 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 14 Sep 2017 04:04:15 -0700 Subject: Introduce Version::warn_if_vcpkg_version_mismatch() --- toolsrc/include/vcpkg_Commands.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 070a8ec49..590f0208c 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -210,6 +210,7 @@ namespace vcpkg::Commands namespace Version { const std::string& version(); + void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); void perform_and_exit(const VcpkgCmdArguments& args); } -- cgit v1.2.3