From 6670b87c18c544bbc9fa167f583b27dc52bce3d9 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 10 Mar 2018 14:19:07 -0800 Subject: [vcpkg] Add VCPKG_DEFAULT_VS_PATH environment variable --- toolsrc/include/vcpkg/vcpkgpaths.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index 84e8110ec..71f1bbba9 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -33,7 +33,7 @@ namespace vcpkg struct VcpkgPaths { - static Expected create(const fs::path& vcpkg_root_dir); + static Expected create(const fs::path& vcpkg_root_dir, const std::string& default_vs_path); fs::path package_dir(const PackageSpec& spec) const; fs::path port_dir(const PackageSpec& spec) const; @@ -90,5 +90,7 @@ namespace vcpkg Lazy ifw_repogen_exe; Lazy> toolsets; Lazy> toolsets_vs2013; + + fs::path default_vs_path; }; } -- cgit v1.2.3 From 81b9ab1291bd322b5de8ad0cec2f21ce4d828a28 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 04:26:00 -0700 Subject: [vcpkg] Refactor do_build_package and add archive tombstoning --- toolsrc/include/vcpkg/paragraphs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h index e2c7f2d99..fa0265b75 100644 --- a/toolsrc/include/vcpkg/paragraphs.h +++ b/toolsrc/include/vcpkg/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_control_package(const VcpkgPaths& paths, const PackageSpec& spec); + Expected try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec); struct LoadResults { -- cgit v1.2.3 From f72b46690a89a7e19563f93f0eaa5f8a21184254 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 06:25:59 -0700 Subject: [vcpkg] Silence warnings on recent clang --- toolsrc/include/pch.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 683bef171..9c9deeb3f 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -46,7 +46,11 @@ #include #include #include +#if defined(_WIN32) #include +#else +#include +#endif #include #include #include -- cgit v1.2.3 From 3c7997215bc2e44125912fb7aae672f1b63944a8 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Tue, 13 Mar 2018 11:06:22 -0700 Subject: [vcpkg] Improve default triplets for non-windows --- toolsrc/include/vcpkg/base/strings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 6ef840fb3..6294853af 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -46,7 +46,7 @@ namespace vcpkg::Strings bool case_insensitive_ascii_equals(const CStringView left, const CStringView right); - std::string ascii_to_lowercase(const std::string& input); + std::string ascii_to_lowercase(std::string input); bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern); -- cgit v1.2.3 From 90c4b8dbb7a69584a4a36c67e4982cf086b7c578 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 04:33:14 -0700 Subject: [vcpkg] Further refactoring inside `build_package()` --- toolsrc/include/vcpkg/commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 4027e12f4..b6b1c56ab 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -120,7 +120,7 @@ namespace vcpkg::Commands namespace Hash { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - std::string get_file_hash(fs::path const& cmake_exe_path, fs::path const& path, std::string const& hash_type); + std::string get_file_hash(const VcpkgPaths& paths, fs::path const& path, std::string const& hash_type); } template -- cgit v1.2.3 From d253123055e6bdfb181c6a8a14a63e2d6fc68cad Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Sun, 18 Mar 2018 20:24:19 +0800 Subject: Add options and documentation for env command (#3007) * [vcpkg] Add options and documentation for env command * [vcpkg-env] Cleanup. Add tools/*. --- toolsrc/include/vcpkg/base/system.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 31034f6b4..b2faf69bb 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -1,5 +1,7 @@ #pragma once +#include + #include #include #include @@ -38,7 +40,8 @@ namespace vcpkg::System std::string output; }; - int cmd_execute_clean(const CStringView cmd_line); + int cmd_execute_clean(const CStringView cmd_line, + const std::unordered_map& extra_env = {}); int cmd_execute(const CStringView cmd_line); -- cgit v1.2.3 From eab1d5c531695c2a644276832578e5550dd9abf6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 14 Mar 2018 10:30:27 -0700 Subject: [vcpkg-ci] Do not rebuild libraries that were previously successful or failed --- toolsrc/include/vcpkg/base/cache.h | 21 +++++++++++++++++++++ toolsrc/include/vcpkg/base/util.h | 6 +++--- toolsrc/include/vcpkg/build.h | 17 +++++++++++++++++ toolsrc/include/vcpkg/commands.h | 12 ++++++++++++ toolsrc/include/vcpkg/dependencies.h | 5 ++++- toolsrc/include/vcpkg/install.h | 1 + toolsrc/include/vcpkg/sourceparagraph.h | 2 ++ 7 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 toolsrc/include/vcpkg/base/cache.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/cache.h b/toolsrc/include/vcpkg/base/cache.h new file mode 100644 index 000000000..dfc7565b8 --- /dev/null +++ b/toolsrc/include/vcpkg/base/cache.h @@ -0,0 +1,21 @@ +#pragma once + +#include + +namespace vcpkg +{ + template + struct Cache + { + template + Value const& get_lazy(const Key& k, const F& f) const + { + auto it = m_cache.find(k); + if (it != m_cache.end()) return it->second; + return m_cache.emplace(k, f()).first->second; + } + + private: + mutable std::map m_cache; + }; +} diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index 5e07b240a..b12919951 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -24,10 +24,10 @@ namespace vcpkg::Util namespace Sets { - template - bool contains(const Container& container, const ElementT& item) + template + bool contains(const Container& container, const Key& item) { - return container.find(item) != container.cend(); + return container.find(item) != container.end(); } } diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index ea81c4dbe..8c4d7b575 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -204,4 +204,21 @@ namespace vcpkg::Build }; BuildInfo read_build_info(const Files::Filesystem& fs, const fs::path& filepath); + + struct AbiEntry + { + std::string key; + std::string value; + }; + + struct AbiTagAndFile + { + std::string tag; + fs::path tag_file; + }; + + Optional compute_abi_tag(const VcpkgPaths& paths, + const BuildPackageConfig& config, + const PreBuildInfo& pre_build_info, + Span dependency_abis); } diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index b6b1c56ab..7369b8206 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -7,6 +7,8 @@ #include #include +#include +#include namespace vcpkg::Commands { @@ -23,7 +25,17 @@ namespace vcpkg::Commands namespace CI { + struct UnknownCIPortsResults + { + std::vector unknown; + std::map known; + }; + extern const CommandStructure COMMAND_STRUCTURE; + UnknownCIPortsResults find_unknown_ports_for_ci(const VcpkgPaths& paths, + const std::set& exclusions, + const Dependencies::PortFileProvider& provider, + const std::vector& fspecs); 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 fadb8cc7e..33af6c4f5 100644 --- a/toolsrc/include/vcpkg/dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -45,7 +45,8 @@ namespace vcpkg::Dependencies InstallPlanAction(const PackageSpec& spec, const SourceControlFile& scf, const std::set& features, - const RequestType& request_type); + const RequestType& request_type, + std::vector&& dependencies); std::string displayname() const; @@ -58,6 +59,8 @@ namespace vcpkg::Dependencies RequestType request_type; Build::BuildPackageOptions build_options; std::set feature_list; + + std::vector computed_dependencies; }; enum class RemovePlanType diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h index 2e92764dc..b7acbf15f 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -37,6 +37,7 @@ namespace vcpkg::Install std::string total_elapsed_time; void print() const; + static std::string xunit_result(const PackageSpec& spec, Chrono::ElapsedTime time, Build::BuildResult code); std::string xunit_results() const; }; diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h index ea8e27a94..ae5812ea7 100644 --- a/toolsrc/include/vcpkg/sourceparagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -63,6 +63,8 @@ namespace vcpkg std::unique_ptr core_paragraph; std::vector> feature_paragraphs; + + Optional find_feature(const std::string& featurename) const; }; void print_error_message(Span> error_info_list); -- cgit v1.2.3 From ab7985a34b8a4de59dc9a6e6c4c40fbb564797b8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Mar 2018 16:53:48 -0700 Subject: [vcpkg-hash] Use BCrypt on Windows --- toolsrc/include/vcpkg/base/strings.h | 4 +++- toolsrc/include/vcpkg/base/util.h | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/strings.h b/toolsrc/include/vcpkg/base/strings.h index 6294853af..c32e81ac2 100644 --- a/toolsrc/include/vcpkg/base/strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -46,7 +46,9 @@ namespace vcpkg::Strings bool case_insensitive_ascii_equals(const CStringView left, const CStringView right); - std::string ascii_to_lowercase(std::string input); + std::string ascii_to_lowercase(std::string s); + + std::string ascii_to_uppercase(std::string s); bool case_insensitive_ascii_starts_with(const std::string& s, const std::string& pattern); diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h index b12919951..c73345719 100644 --- a/toolsrc/include/vcpkg/base/util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -6,8 +6,6 @@ #include #include -#include - namespace vcpkg::Util { template @@ -158,6 +156,8 @@ namespace vcpkg::Util MoveOnlyBase& operator=(const MoveOnlyBase&) = delete; MoveOnlyBase& operator=(MoveOnlyBase&&) = default; + + ~MoveOnlyBase() = default; }; struct ResourceBase @@ -168,6 +168,8 @@ namespace vcpkg::Util ResourceBase& operator=(const ResourceBase&) = delete; ResourceBase& operator=(ResourceBase&&) = delete; + + ~ResourceBase() = default; }; template @@ -214,4 +216,10 @@ namespace vcpkg::Util return e == E::YES; } } + + template + void unused(T&& param) + { + (void)param; + } } -- cgit v1.2.3 From d80dd5cbc777ce765c2d6b78d7c485fdf05f284b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 19 Mar 2018 15:45:35 -0700 Subject: [vcpkg] Handle failure to store archive --- toolsrc/include/vcpkg/base/files.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index 09393b9ee..ac1f192ae 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -36,6 +36,7 @@ namespace vcpkg::Files virtual void write_lines(const fs::path& file_path, const std::vector& lines) = 0; virtual void write_contents(const fs::path& file_path, const std::string& data, std::error_code& ec) = 0; virtual void rename(const fs::path& oldpath, const fs::path& newpath) = 0; + virtual void rename(const fs::path& oldpath, const fs::path& newpath, std::error_code& ec) = 0; virtual bool remove(const fs::path& path) = 0; virtual bool remove(const fs::path& path, std::error_code& ec) = 0; virtual std::uintmax_t remove_all(const fs::path& path, std::error_code& ec) = 0; -- cgit v1.2.3 From d45954a96b625ba1856ac97b429163a1919a3299 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 21 Mar 2018 18:21:30 -0700 Subject: System::get_program_files() now returns Optional --- toolsrc/include/vcpkg/base/system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index b2faf69bb..0d089276f 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -110,9 +110,9 @@ namespace vcpkg::System std::vector get_supported_host_architectures(); - const fs::path& get_program_files_32_bit(); + const Optional& get_program_files_32_bit(); - const fs::path& get_program_files_platform_bitness(); + const Optional& get_program_files_platform_bitness(); } namespace vcpkg::Debug -- cgit v1.2.3 From 1f62b32641045fe377ee80ff1854a785344687d2 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 22 Mar 2018 10:01:12 -0700 Subject: [vcpkg] Sort abi tags to ensure stability --- toolsrc/include/vcpkg/build.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 8c4d7b575..1c22d39d8 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -209,6 +209,11 @@ namespace vcpkg::Build { std::string key; std::string value; + + bool operator<(const AbiEntry& other) const + { + return key < other.key || (key == other.key && value < other.value); + } }; struct AbiTagAndFile -- cgit v1.2.3