From ce8b01a14bb6a61b4f0686674e4b51bd8ecfb83b Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 29 Apr 2020 10:16:40 -0700 Subject: [vcpkg] Add support for VCPKG_BINARY_SOURCES and --x-binarysource=<> (#10476) * [vcpkg] Add support for VCPKG_BINARY_SOURCES and --binarysource=<> * [vcpkg] Rename --binarysource to --x-binarysource to denote internal/experimental * [vcpkg] Address review comments & add tests for BinaryConfigParser * [vcpkg] Replace do {} while(1); with for(;;) Avoids conditional expresion is constant warnings * [vcpkg] Invert if/else * [vcpkg] Fix warning in export.prefab.cpp * [vcpkg] Resolve merge regressions --- toolsrc/include/vcpkg/base/system.h | 2 ++ toolsrc/include/vcpkg/binarycaching.h | 6 +++++- toolsrc/include/vcpkg/build.h | 3 ++- toolsrc/include/vcpkg/install.h | 1 + toolsrc/include/vcpkg/vcpkgcmdarguments.h | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/system.h b/toolsrc/include/vcpkg/base/system.h index 4172f0c50..f119dbdc4 100644 --- a/toolsrc/include/vcpkg/base/system.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -9,6 +9,8 @@ namespace vcpkg::System { Optional get_environment_variable(ZStringView varname) noexcept; + ExpectedS get_home_dir() noexcept; + Optional get_registry_string(void* base_hkey, StringView subkey, StringView valuename); enum class CPUArchitecture diff --git a/toolsrc/include/vcpkg/binarycaching.h b/toolsrc/include/vcpkg/binarycaching.h index 199b01acc..69e3287d6 100644 --- a/toolsrc/include/vcpkg/binarycaching.h +++ b/toolsrc/include/vcpkg/binarycaching.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include @@ -35,5 +36,8 @@ namespace vcpkg bool purge_tombstones) = 0; }; - std::unique_ptr create_archives_provider(); + ExpectedS> create_binary_provider_from_configs(const VcpkgPaths& paths, + View args); + ExpectedS> create_binary_provider_from_configs_pure(const std::string& env_string, + View args); } diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index d8e87f131..560e856b9 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -34,6 +34,7 @@ namespace vcpkg::Build void perform_and_exit_ex(const FullPackageSpec& full_spec, const SourceControlFileLocation& scfl, const PortFileProvider::PathsPortFileProvider& provider, + IBinaryProvider& binaryprovider, const VcpkgPaths& paths); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); @@ -209,7 +210,7 @@ namespace vcpkg::Build ExtendedBuildResult build_package(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& config, - IBinaryProvider* binaries_provider, + IBinaryProvider& binaries_provider, const StatusParagraphs& status_db); enum class BuildPolicy diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h index 1c42cc102..ad91bbb37 100644 --- a/toolsrc/include/vcpkg/install.h +++ b/toolsrc/include/vcpkg/install.h @@ -79,6 +79,7 @@ namespace vcpkg::Install const KeepGoing keep_going, const VcpkgPaths& paths, StatusParagraphs& status_db, + IBinaryProvider& binaryprovider, const CMakeVars::CMakeVarProvider& var_provider); extern const CommandStructure COMMAND_STRUCTURE; diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index e5b26c25a..92584fc6a 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -91,6 +91,7 @@ namespace vcpkg std::unique_ptr triplet; std::unique_ptr> overlay_ports; std::unique_ptr> overlay_triplets; + std::vector binarysources; Optional debug = nullopt; Optional sendmetrics = nullopt; Optional printmetrics = nullopt; -- cgit v1.2.3