962{
963 for (const auto &path : p) {
964 std::filesystem::path absolute_path;
965
966 if (path.empty() || path == ".")
967 absolute_path = root;
968 else if (std::filesystem::path{path}.is_relative())
969 absolute_path = root / path;
970 else
971 absolute_path = path;
972
973 bool match_successful{false};
974 for (auto &resolved_glob_path :
975 glob::glob(absolute_path.string(), true)) {
976 try {
977 auto resolved_absolute_path = absolute(resolved_glob_path);
978 resolved_absolute_path =
979 canonical(resolved_absolute_path.lexically_normal());
980
981 resolved_absolute_path.make_preferred();
982
983 LOG_DBG(
"Added path {} to paths_filter",
984 resolved_absolute_path.string());
985
986 paths_.emplace_back(std::move(resolved_absolute_path));
987
988 match_successful = true;
989 }
990 catch (std::filesystem::filesystem_error &e) {
991 LOG_WARN(
"Cannot add non-existent path {} to "
992 "paths filter",
993 absolute_path.string());
994 continue;
995 }
996 }
997
998 if (!match_successful)
999 LOG_WARN(
"Paths filter pattern '{}' did not match "
1000 "any files relative to '{}'",
1001 path,
root_.string());
1002 }
1003}