Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
strega-nil committed Jul 8, 2020
1 parent 8dcd711 commit 815a953
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions toolsrc/include/vcpkg/vcpkgcmdarguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ namespace vcpkg

void check_feature_flag_consistency() const;

void debug_print_feature_flags() const;
void track_feature_flag_metrics() const;

private:
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ int main(const int argc, const char* const* const argv)
"Warning: passed either --printmetrics or --no-printmetrics, but metrics are disabled.\n");
}

args.debug_print_feature_flags();
args.track_feature_flag_metrics();

if (Debug::g_debugging)
Expand Down
3 changes: 1 addition & 2 deletions toolsrc/src/vcpkg/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,7 @@ namespace vcpkg::Install
{
for (auto& dep : (*val)->core_paragraph->dependencies)
{
specs.push_back(Input::check_and_get_full_package_spec(
std::move(dep.name), default_triplet, COMMAND_STRUCTURE.example_text));
specs.push_back(FullPackageSpec{{std::move(dep.name), default_triplet}, std::move(dep.features),});
}
}
else
Expand Down
30 changes: 29 additions & 1 deletion toolsrc/src/vcpkg/vcpkgcmdarguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,13 +678,41 @@ namespace vcpkg
}
}

void VcpkgCmdArguments::debug_print_feature_flags() const
{
struct
{
StringView name;
Optional<bool> flag;
} flags[] = {
{BINARY_CACHING_FEATURE, binary_caching},
{MANIFEST_MODE_FEATURE, manifest_mode},
{COMPILER_TRACKING_FEATURE, compiler_tracking},
};

for (const auto& flag : flags)
{
if (auto r = flag.flag.get())
{
Debug::print("Feature flag '", flag.name, "' = ", *r ? "on" : "off", "\n");
}
else
{
Debug::print("Feature flag '", flag.name, "' unset\n");
}
}
}

void VcpkgCmdArguments::track_feature_flag_metrics() const
{
struct
{
StringView flag;
bool enabled;
} flags[] = {{BINARY_CACHING_FEATURE, binary_caching_enabled()}};
} flags[] = {
{BINARY_CACHING_FEATURE, binary_caching_enabled()},
{COMPILER_TRACKING_FEATURE, compiler_tracking_enabled()},
};

for (const auto& flag : flags)
{
Expand Down
4 changes: 2 additions & 2 deletions toolsrc/src/vcpkg/vcpkgpaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ namespace vcpkg
}
uppercase_win32_drive_letter(manifest_root_dir);

if (!manifest_root_dir.empty() && args.manifest_mode.value_or(true))
if (!manifest_root_dir.empty() && args.manifest_mode.value_or(false))
{
Debug::print("Using manifest-root: ", root.u8string(), '\n');
Debug::print("Using manifest-root: ", manifest_root_dir.u8string(), '\n');

installed = process_output_directory(
filesystem, manifest_root_dir, args.install_root_dir.get(), "vcpkg_installed", VCPKG_LINE_INFO);
Expand Down

0 comments on commit 815a953

Please sign in to comment.