aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorVictor Romero <romerosanchezv@gmail.com>2019-08-28 11:59:30 -0700
committerGitHub <noreply@github.com>2019-08-28 11:59:30 -0700
commit4b404e8cfbdde4277733adaacc399fa4e1b57320 (patch)
treedd1dfeb91799a4bc09698711a7b72eb5787a5514 /toolsrc/src
parent9510b34f2df298dfe63296a182855e32da33181d (diff)
downloadvcpkg-4b404e8cfbdde4277733adaacc399fa4e1b57320.tar.gz
vcpkg-4b404e8cfbdde4277733adaacc399fa4e1b57320.zip
Revert "[vcpkg install] Enable Download Mode (#7797)" (#7949)
This reverts commit 65d4bc146bf7c1c21989b680497b1f6f9a09c967.
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/build.cpp39
-rw-r--r--toolsrc/src/vcpkg/commands.ci.cpp2
-rw-r--r--toolsrc/src/vcpkg/commands.upgrade.cpp1
-rw-r--r--toolsrc/src/vcpkg/export.cpp1
-rw-r--r--toolsrc/src/vcpkg/install.cpp18
5 files changed, 11 insertions, 50 deletions
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index e5c00b929..9245ddfbc 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -53,7 +53,6 @@ namespace vcpkg::Build::Command
const Build::BuildPackageOptions build_package_options{
Build::UseHeadVersion::NO,
Build::AllowDownloads::YES,
- Build::OnlyDownloads::NO,
Build::CleanBuildtrees::NO,
Build::CleanPackages::NO,
Build::CleanDownloads::NO,
@@ -408,11 +407,6 @@ namespace vcpkg::Build
{"VCPKG_CONCURRENCY", std::to_string(get_concurrency())},
};
- if (Util::Enum::to_bool(config.build_package_options.only_downloads))
- {
- variables.push_back({"VCPKG_DOWNLOAD_MODE", "true"});
- }
-
if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value())
{
variables.push_back({"GIT", git_exe_path});
@@ -534,7 +528,6 @@ namespace vcpkg::Build
const BuildPackageConfig& config)
{
auto& fs = paths.get_filesystem();
-
#if defined(_WIN32)
const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core");
if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe"))
@@ -566,14 +559,6 @@ namespace vcpkg::Build
#else
const int return_code = System::cmd_execute_clean(command, env);
#endif
- // With the exception of empty packages, builds in "Download Mode" always result in failure.
- if (config.build_package_options.only_downloads == Build::OnlyDownloads::YES)
- {
- // TODO: Capture executed command output and evaluate whether the failure was intended.
- // If an unintended error occurs then return a BuildResult::DOWNLOAD_FAILURE status.
- return BuildResult::DOWNLOADED;
- }
-
const auto buildtimeus = timer.microseconds();
const auto spec_string = spec.to_string();
@@ -808,23 +793,20 @@ namespace vcpkg::Build
const std::string& name = config.scf.core_paragraph->name;
std::vector<FeatureSpec> required_fspecs = compute_required_feature_specs(config, status_db);
+ std::vector<FeatureSpec> required_fspecs_copy = required_fspecs;
// extract out the actual package ids
auto dep_pspecs = Util::fmap(required_fspecs, [](FeatureSpec const& fspec) { return fspec.spec(); });
Util::sort_unique_erase(dep_pspecs);
// Find all features that aren't installed. This mutates required_fspecs.
- // Skip this validation when running in Download Mode.
- if (config.build_package_options.only_downloads != Build::OnlyDownloads::YES)
- {
- Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) {
- return status_db.is_installed(fspec) || fspec.name() == name;
- });
+ Util::erase_remove_if(required_fspecs, [&](FeatureSpec const& fspec) {
+ return status_db.is_installed(fspec) || fspec.name() == name;
+ });
- if (!required_fspecs.empty())
- {
- return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)};
- }
+ if (!required_fspecs.empty())
+ {
+ return {BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES, std::move(required_fspecs)};
}
const PackageSpec spec =
@@ -835,10 +817,7 @@ namespace vcpkg::Build
// dep_pspecs was not destroyed
for (auto&& pspec : dep_pspecs)
{
- if (pspec == spec || Util::Enum::to_bool(config.build_package_options.only_downloads))
- {
- continue;
- }
+ if (pspec == spec) continue;
const auto status_it = status_db.find_installed(pspec);
Checks::check_exit(VCPKG_LINE_INFO, status_it != status_db.end());
dependency_abis.emplace_back(
@@ -970,7 +949,6 @@ namespace vcpkg::Build
static const std::string POST_BUILD_CHECKS_FAILED_STRING = "POST_BUILD_CHECKS_FAILED";
static const std::string CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING = "CASCADED_DUE_TO_MISSING_DEPENDENCIES";
static const std::string EXCLUDED_STRING = "EXCLUDED";
- static const std::string DOWNLOADED_STRING = "DOWNLOADED";
switch (build_result)
{
@@ -981,7 +959,6 @@ namespace vcpkg::Build
case BuildResult::FILE_CONFLICTS: return FILE_CONFLICTS_STRING;
case BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES: return CASCADED_DUE_TO_MISSING_DEPENDENCIES_STRING;
case BuildResult::EXCLUDED: return EXCLUDED_STRING;
- case BuildResult::DOWNLOADED: return DOWNLOADED_STRING;
default: Checks::unreachable(VCPKG_LINE_INFO);
}
}
diff --git a/toolsrc/src/vcpkg/commands.ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp
index 6e0a71adf..f0f162f5c 100644
--- a/toolsrc/src/vcpkg/commands.ci.cpp
+++ b/toolsrc/src/vcpkg/commands.ci.cpp
@@ -212,7 +212,6 @@ namespace vcpkg::Commands::CI
const Build::BuildPackageOptions build_options = {
Build::UseHeadVersion::NO,
Build::AllowDownloads::YES,
- Build::OnlyDownloads::NO,
Build::CleanBuildtrees::YES,
Build::CleanPackages::YES,
Build::CleanDownloads::NO,
@@ -357,7 +356,6 @@ namespace vcpkg::Commands::CI
const Build::BuildPackageOptions install_plan_options = {
Build::UseHeadVersion::NO,
Build::AllowDownloads::YES,
- Build::OnlyDownloads::NO,
Build::CleanBuildtrees::YES,
Build::CleanPackages::YES,
Build::CleanDownloads::NO,
diff --git a/toolsrc/src/vcpkg/commands.upgrade.cpp b/toolsrc/src/vcpkg/commands.upgrade.cpp
index b1dbf6194..1e64b2eb6 100644
--- a/toolsrc/src/vcpkg/commands.upgrade.cpp
+++ b/toolsrc/src/vcpkg/commands.upgrade.cpp
@@ -154,7 +154,6 @@ namespace vcpkg::Commands::Upgrade
const Build::BuildPackageOptions install_plan_options = {
Build::UseHeadVersion::NO,
Build::AllowDownloads::YES,
- Build::OnlyDownloads::NO,
Build::CleanBuildtrees::NO,
Build::CleanPackages::NO,
Build::CleanDownloads::NO,
diff --git a/toolsrc/src/vcpkg/export.cpp b/toolsrc/src/vcpkg/export.cpp
index 349d9aefd..5ceb47adf 100644
--- a/toolsrc/src/vcpkg/export.cpp
+++ b/toolsrc/src/vcpkg/export.cpp
@@ -73,7 +73,6 @@ namespace vcpkg::Export
static constexpr Build::BuildPackageOptions BUILD_OPTIONS = {
Build::UseHeadVersion::NO,
Build::AllowDownloads::YES,
- Build::OnlyDownloads::NO,
Build::CleanBuildtrees::NO,
Build::CleanPackages::NO,
Build::CleanDownloads::NO,
diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp
index 009965887..1812f1624 100644
--- a/toolsrc/src/vcpkg/install.cpp
+++ b/toolsrc/src/vcpkg/install.cpp
@@ -342,13 +342,6 @@ namespace vcpkg::Install
return Build::build_package(paths, build_config, status_db);
}();
- if (BuildResult::DOWNLOADED == result.code)
- {
- System::print2(
- System::Color::success, "Downloaded sources for package ", display_name_with_features, "\n");
- return result;
- }
-
if (result.code != Build::BuildResult::SUCCEEDED)
{
System::print2(System::Color::error, Build::create_error_message(result.code, action.spec), "\n");
@@ -474,18 +467,16 @@ namespace vcpkg::Install
static constexpr StringLiteral OPTION_DRY_RUN = "--dry-run";
static constexpr StringLiteral OPTION_USE_HEAD_VERSION = "--head";
static constexpr StringLiteral OPTION_NO_DOWNLOADS = "--no-downloads";
- static constexpr StringLiteral OPTION_ONLY_DOWNLOADS = "--only-downloads";
static constexpr StringLiteral OPTION_RECURSE = "--recurse";
static constexpr StringLiteral OPTION_KEEP_GOING = "--keep-going";
static constexpr StringLiteral OPTION_XUNIT = "--x-xunit";
static constexpr StringLiteral OPTION_USE_ARIA2 = "--x-use-aria2";
static constexpr StringLiteral OPTION_CLEAN_AFTER_BUILD = "--clean-after-build";
- static constexpr std::array<CommandSwitch, 8> INSTALL_SWITCHES = {{
+ static constexpr std::array<CommandSwitch, 7> INSTALL_SWITCHES = {{
{OPTION_DRY_RUN, "Do not actually build or install"},
{OPTION_USE_HEAD_VERSION, "Install the libraries on the command line using the latest upstream sources"},
{OPTION_NO_DOWNLOADS, "Do not download new sources"},
- {OPTION_ONLY_DOWNLOADS, "Download sources but don't build packages"},
{OPTION_RECURSE, "Allow removal of packages as part of installation"},
{OPTION_KEEP_GOING, "Continue installing packages on failure"},
{OPTION_USE_ARIA2, "Use aria2 to perform download tasks"},
@@ -640,12 +631,10 @@ namespace vcpkg::Install
const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN);
const bool use_head_version = Util::Sets::contains(options.switches, (OPTION_USE_HEAD_VERSION));
const bool no_downloads = Util::Sets::contains(options.switches, (OPTION_NO_DOWNLOADS));
- const bool only_downloads = Util::Sets::contains(options.switches, (OPTION_ONLY_DOWNLOADS));
const bool is_recursive = Util::Sets::contains(options.switches, (OPTION_RECURSE));
const bool use_aria2 = Util::Sets::contains(options.switches, (OPTION_USE_ARIA2));
const bool clean_after_build = Util::Sets::contains(options.switches, (OPTION_CLEAN_AFTER_BUILD));
- const KeepGoing keep_going =
- to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING) || only_downloads);
+ const KeepGoing keep_going = to_keep_going(Util::Sets::contains(options.switches, OPTION_KEEP_GOING));
auto& fs = paths.get_filesystem();
@@ -658,12 +647,11 @@ namespace vcpkg::Install
const Build::BuildPackageOptions install_plan_options = {
Util::Enum::to_enum<Build::UseHeadVersion>(use_head_version),
Util::Enum::to_enum<Build::AllowDownloads>(!no_downloads),
- Util::Enum::to_enum<Build::OnlyDownloads>(only_downloads),
clean_after_build ? Build::CleanBuildtrees::YES : Build::CleanBuildtrees::NO,
clean_after_build ? Build::CleanPackages::YES : Build::CleanPackages::NO,
clean_after_build ? Build::CleanDownloads::YES : Build::CleanDownloads::NO,
download_tool,
- (GlobalState::g_binary_caching && !only_downloads) ? Build::BinaryCaching::YES : Build::BinaryCaching::NO,
+ GlobalState::g_binary_caching ? Build::BinaryCaching::YES : Build::BinaryCaching::NO,
Build::FailOnTombstone::NO,
};