Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change max_port_file_count to warn rather than failing to calculate an ABI hash. #1104

Merged
merged 3 commits into from
Jul 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,16 +1137,10 @@ namespace vcpkg
abi_tag_entries.emplace_back("triplet_abi", triplet_abi);
abi_entries_from_abi_info(fs, grdk_cache, abi_info, abi_tag_entries);

// If there is an unusually large number of files in the port then
// something suspicious is going on. Rather than hash all of them
// just mark the port as no-hash
constexpr int max_port_file_count = 100;

std::string portfile_cmake_contents;
std::vector<Path> files;
std::vector<std::string> hashes;
auto&& port_dir = action.source_control_file_and_location.value_or_exit(VCPKG_LINE_INFO).source_location;
size_t port_file_count = 0;
Path abs_port_file;
for (auto& port_file : fs.get_regular_files_recursive_lexically_proximate(port_dir, VCPKG_LINE_INFO))
{
Expand All @@ -1167,13 +1161,6 @@ namespace vcpkg
abi_tag_entries.emplace_back(port_file, hash);
files.push_back(port_file);
hashes.push_back(std::move(hash));

++port_file_count;
if (port_file_count > max_port_file_count)
{
abi_tag_entries.emplace_back("no_hash_max_portfile", "");
break;
}
}

abi_tag_entries.emplace_back("cmake", paths.get_tool_version(Tools::CMAKE, stdout_sink));
Expand Down