aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-05-18 18:15:31 -0700
committerGitHub <noreply@github.com>2019-05-18 18:15:31 -0700
commit77af264118522788e24e463309220f97dcff0a79 (patch)
treeb753e1abf41214c6d4a4e4a214bffcd541c9b610 /toolsrc/src
parent469543f9429e6b8f0699cb17d6309f127ae8eb59 (diff)
downloadvcpkg-77af264118522788e24e463309220f97dcff0a79.tar.gz
vcpkg-77af264118522788e24e463309220f97dcff0a79.zip
[vcpkg] Fix regression in `--debug`. Remove old `features` featureflag. (#6507)
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg.cpp9
-rw-r--r--toolsrc/src/vcpkg/build.cpp12
-rw-r--r--toolsrc/src/vcpkg/globalstate.cpp2
-rw-r--r--toolsrc/src/vcpkg/install.cpp22
-rw-r--r--toolsrc/src/vcpkg/paragraphs.cpp16
5 files changed, 12 insertions, 49 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 2c0f562b6..9102205d8 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -294,11 +294,11 @@ int main(const int argc, const char* const* const argv)
Checks::register_global_shutdown_handler([]() {
const auto elapsed_us_inner = GlobalState::timer.lock()->microseconds();
- bool debugging = GlobalState::debugging;
+ bool debugging = Debug::g_debugging;
auto metrics = Metrics::g_metrics.lock();
metrics->track_metric("elapsed_us", elapsed_us_inner);
- GlobalState::debugging = false;
+ Debug::g_debugging = false;
metrics->flush();
#if defined(_WIN32)
@@ -337,14 +337,13 @@ int main(const int argc, const char* const* const argv)
const VcpkgCmdArguments args = VcpkgCmdArguments::create_from_command_line(argc, argv);
- if (const auto p = args.featurepackages.get()) GlobalState::feature_packages = *p;
if (const auto p = args.binarycaching.get()) GlobalState::g_binary_caching = *p;
if (const auto p = args.printmetrics.get()) Metrics::g_metrics.lock()->set_print_metrics(*p);
if (const auto p = args.sendmetrics.get()) Metrics::g_metrics.lock()->set_send_metrics(*p);
- if (const auto p = args.debug.get()) GlobalState::debugging = *p;
+ if (const auto p = args.debug.get()) Debug::g_debugging = *p;
- if (GlobalState::debugging)
+ if (Debug::g_debugging)
{
inner(args);
Checks::exit_fail(VCPKG_LINE_INFO);
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp
index 53b782edc..c5f145052 100644
--- a/toolsrc/src/vcpkg/build.cpp
+++ b/toolsrc/src/vcpkg/build.cpp
@@ -8,6 +8,7 @@
#include <vcpkg/base/stringliteral.h>
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/system.process.h>
+#include <vcpkg/base/system.debug.h>
#include <vcpkg/build.h>
#include <vcpkg/commands.h>
@@ -129,11 +130,6 @@ namespace vcpkg::Build::Command
const FullPackageSpec spec = Input::check_and_get_full_package_spec(
std::move(first_arg), default_triplet, COMMAND_STRUCTURE.example_text);
Input::check_triplet(spec.package_spec.triplet(), paths);
- if (!spec.features.empty() && !GlobalState::feature_packages)
- {
- Checks::exit_with_message(
- VCPKG_LINE_INFO, "Feature packages are experimentally available under the --featurepackages flag.");
- }
perform_and_exit_ex(spec, paths.port_dir(spec.package_spec), options, paths);
}
}
@@ -237,7 +233,7 @@ namespace vcpkg::Build
if (!pre_build_info.cmake_system_name.empty() && pre_build_info.cmake_system_name != "WindowsStore") return "";
const char* tonull = " >nul";
- if (GlobalState::debugging)
+ if (Debug::g_debugging)
{
tonull = "";
}
@@ -511,7 +507,7 @@ namespace vcpkg::Build
// which will give a stable ordering and better names in the key entry.
// this is not available in the filesystem TS so instead number the files for the key.
std::string key = Strings::format("file_%03d", counter++);
- if (GlobalState::debugging)
+ if (Debug::g_debugging)
{
System::print2("[DEBUG] mapping ", key, " from ", port_file.u8string(), "\n");
}
@@ -536,7 +532,7 @@ namespace vcpkg::Build
const std::string full_abi_info =
Strings::join("", abi_tag_entries, [](const AbiEntry& p) { return p.key + " " + p.value + "\n"; });
- if (GlobalState::debugging)
+ if (Debug::g_debugging)
{
System::print2("[DEBUG] <abientries>\n");
for (auto&& entry : abi_tag_entries)
diff --git a/toolsrc/src/vcpkg/globalstate.cpp b/toolsrc/src/vcpkg/globalstate.cpp
index 1a2c08474..aac5148fa 100644
--- a/toolsrc/src/vcpkg/globalstate.cpp
+++ b/toolsrc/src/vcpkg/globalstate.cpp
@@ -7,8 +7,6 @@ namespace vcpkg
Util::LockGuarded<Chrono::ElapsedTimer> GlobalState::timer;
Util::LockGuarded<std::string> GlobalState::g_surveydate;
- std::atomic<bool> GlobalState::debugging(false);
- std::atomic<bool> GlobalState::feature_packages(true);
std::atomic<bool> GlobalState::g_binary_caching(false);
std::atomic<int> GlobalState::g_init_console_cp(0);
diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp
index 14dfb6fa3..646e9bc2e 100644
--- a/toolsrc/src/vcpkg/install.cpp
+++ b/toolsrc/src/vcpkg/install.cpp
@@ -302,8 +302,7 @@ namespace vcpkg::Install
{
const InstallPlanType& plan_type = action.plan_type;
const std::string display_name = action.spec.to_string();
- const std::string display_name_with_features =
- GlobalState::feature_packages ? action.displayname() : display_name;
+ const std::string display_name_with_features = action.displayname();
const bool is_user_requested = action.request_type == RequestType::USER_REQUESTED;
const bool use_head_version = Util::Enum::to_bool(action.build_options.use_head_version);
@@ -615,11 +614,6 @@ namespace vcpkg::Install
for (auto&& spec : specs)
{
Input::check_triplet(spec.package_spec.triplet(), paths);
- if (!spec.features.empty() && !GlobalState::feature_packages)
- {
- Checks::exit_with_message(
- VCPKG_LINE_INFO, "Feature packages are experimentally available under the --featurepackages flag.");
- }
}
const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN);
@@ -655,20 +649,6 @@ namespace vcpkg::Install
std::vector<AnyAction> action_plan =
create_feature_install_plan(provider, FullPackageSpec::to_feature_specs(specs), status_db);
- if (!GlobalState::feature_packages)
- {
- for (auto&& action : action_plan)
- {
- if (action.remove_action.has_value())
- {
- Checks::exit_with_message(
- VCPKG_LINE_INFO,
- "The installation plan requires feature packages support. Please re-run the "
- "command with --featurepackages.");
- }
- }
- }
-
for (auto&& action : action_plan)
{
if (auto p_install = action.install_action.get())
diff --git a/toolsrc/src/vcpkg/paragraphs.cpp b/toolsrc/src/vcpkg/paragraphs.cpp
index 45f939afd..431fad5ca 100644
--- a/toolsrc/src/vcpkg/paragraphs.cpp
+++ b/toolsrc/src/vcpkg/paragraphs.cpp
@@ -3,7 +3,7 @@
#include <vcpkg/base/files.h>
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/util.h>
-#include <vcpkg/globalstate.h>
+#include <vcpkg/base/system.debug.h>
#include <vcpkg/paragraphparseresult.h>
#include <vcpkg/paragraphs.h>
@@ -211,17 +211,7 @@ namespace vcpkg::Paragraphs
Expected<std::vector<std::unordered_map<std::string, std::string>>> pghs = get_paragraphs(fs, path / "CONTROL");
if (auto vector_pghs = pghs.get())
{
- auto csf = SourceControlFile::parse_control_file(std::move(*vector_pghs));
- if (!GlobalState::feature_packages)
- {
- if (auto ptr = csf.get())
- {
- Checks::check_exit(VCPKG_LINE_INFO, ptr->get() != nullptr);
- ptr->get()->core_paragraph->default_features.clear();
- ptr->get()->feature_paragraphs.clear();
- }
- }
- return csf;
+ return SourceControlFile::parse_control_file(std::move(*vector_pghs));
}
auto error_info = std::make_unique<ParseControlErrorInfo>();
error_info->name = path.filename().generic_u8string();
@@ -279,7 +269,7 @@ namespace vcpkg::Paragraphs
auto results = try_load_all_ports(fs, ports_dir);
if (!results.errors.empty())
{
- if (GlobalState::debugging)
+ if (Debug::g_debugging)
{
print_error_message(results.errors);
}