aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2020-03-19 11:50:15 -0700
committerGitHub <noreply@github.com>2020-03-19 11:50:15 -0700
commit2c2e67f35fb5af7168dc800ab82e59fdcba0e9c2 (patch)
treed2dab01b82df48f76d4bbc55b4207608379a6e43 /toolsrc/include
parentcbaafe76d63fd55718ef417c9e833cf389ee73ed (diff)
parent4bf1cf35ba18b2549b0db87f4f8465fdabed2f47 (diff)
downloadvcpkg-2c2e67f35fb5af7168dc800ab82e59fdcba0e9c2.tar.gz
vcpkg-2c2e67f35fb5af7168dc800ab82e59fdcba0e9c2.zip
Merge pull request #10032 from ras0219-msft/dev/roschuma/compute-all-abis
[vcpkg] Compute ABIs upfront instead of just-in-time
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/binarycaching.h39
-rw-r--r--toolsrc/include/vcpkg/build.h15
-rw-r--r--toolsrc/include/vcpkg/dependencies.h6
3 files changed, 56 insertions, 4 deletions
diff --git a/toolsrc/include/vcpkg/binarycaching.h b/toolsrc/include/vcpkg/binarycaching.h
new file mode 100644
index 000000000..199b01acc
--- /dev/null
+++ b/toolsrc/include/vcpkg/binarycaching.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include <vcpkg/base/files.h>
+#include <vcpkg/packagespec.h>
+#include <vcpkg/vcpkgpaths.h>
+
+namespace vcpkg::Dependencies
+{
+ struct InstallPlanAction;
+}
+namespace vcpkg::Build
+{
+ struct AbiTagAndFile;
+ struct BuildPackageOptions;
+}
+
+namespace vcpkg
+{
+ enum class RestoreResult
+ {
+ missing,
+ success,
+ build_failed,
+ };
+
+ struct IBinaryProvider
+ {
+ virtual ~IBinaryProvider() = default;
+ virtual void prefetch() = 0;
+ virtual RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0;
+ virtual void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0;
+ virtual void push_failure(const VcpkgPaths& paths, const std::string& abi_tag, const PackageSpec& spec) = 0;
+ virtual RestoreResult precheck(const VcpkgPaths& paths,
+ const Dependencies::InstallPlanAction& action,
+ bool purge_tombstones) = 0;
+ };
+
+ std::unique_ptr<IBinaryProvider> create_archives_provider();
+}
diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h
index 67505d8f2..d36b64143 100644
--- a/toolsrc/include/vcpkg/build.h
+++ b/toolsrc/include/vcpkg/build.h
@@ -16,9 +16,15 @@
#include <set>
#include <vector>
+namespace vcpkg
+{
+ struct IBinaryProvider;
+}
+
namespace vcpkg::Dependencies
{
struct InstallPlanAction;
+ struct ActionPlan;
}
namespace vcpkg::Build
@@ -28,7 +34,6 @@ namespace vcpkg::Build
void perform_and_exit_ex(const FullPackageSpec& full_spec,
const SourceControlFileLocation& scfl,
const PortFileProvider::PathsPortFileProvider& provider,
- const ParsedArguments& options,
const VcpkgPaths& paths);
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
@@ -201,7 +206,7 @@ namespace vcpkg::Build
ExtendedBuildResult build_package(const VcpkgPaths& paths,
const Dependencies::InstallPlanAction& config,
- const CMakeVars::CMakeVarProvider& var_provider,
+ IBinaryProvider* binaries_provider,
const StatusParagraphs& status_db);
enum class BuildPolicy
@@ -288,8 +293,12 @@ namespace vcpkg::Build
fs::path tag_file;
};
+ void compute_all_abis(const VcpkgPaths& paths,
+ Dependencies::ActionPlan& action_plan,
+ const CMakeVars::CMakeVarProvider& var_provider,
+ const StatusParagraphs& status_db);
+
Optional<AbiTagAndFile> compute_abi_tag(const VcpkgPaths& paths,
const Dependencies::InstallPlanAction& config,
- const PreBuildInfo& pre_build_info,
Span<const AbiEntry> dependency_abis);
}
diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h
index 1f92ee63c..26ba9a67c 100644
--- a/toolsrc/include/vcpkg/dependencies.h
+++ b/toolsrc/include/vcpkg/dependencies.h
@@ -53,6 +53,7 @@ namespace vcpkg::Dependencies
std::unordered_map<std::string, std::vector<FeatureSpec>>&& dependencies);
std::string displayname() const;
+ const std::string& public_abi() const;
PackageSpec spec;
@@ -65,8 +66,11 @@ namespace vcpkg::Dependencies
std::unordered_map<std::string, std::vector<FeatureSpec>> feature_dependencies;
std::vector<PackageSpec> package_dependencies;
-
std::vector<std::string> feature_list;
+
+ Optional<std::unique_ptr<Build::PreBuildInfo>> pre_build_info;
+ Optional<std::string> package_abi;
+ Optional<fs::path> abi_tag_file;
};
enum class RemovePlanType