1175{
1176 for (const auto &path : p) {
1177 std::filesystem::path absolute_path;
1178
1179 if (path.empty() || path == ".")
1180 absolute_path = root;
1181 else if (std::filesystem::path{path}.is_relative())
1182 absolute_path = root / path;
1183 else
1184 absolute_path = path;
1185
1186 bool match_successful{false};
1187 for (auto &resolved_glob_path :
1188 glob::glob(absolute_path.string(), true)) {
1189 try {
1190 auto resolved_absolute_path = absolute(resolved_glob_path);
1191 resolved_absolute_path =
1192 canonical(resolved_absolute_path.lexically_normal());
1193
1194 resolved_absolute_path.make_preferred();
1195
1196 LOG_DBG(
"Added path {} to paths_filter",
1197 resolved_absolute_path.string());
1198
1199 paths_.emplace_back(std::move(resolved_absolute_path));
1200
1201 match_successful = true;
1202 }
1203 catch (std::filesystem::filesystem_error &e) {
1204 LOG_WARN(
"Cannot add non-existent path {} to "
1205 "paths filter",
1206 absolute_path.string());
1207 continue;
1208 }
1209 }
1210
1211 if (!match_successful)
1212 LOG_WARN(
"Paths filter pattern '{}' did not match "
1213 "any files relative to '{}'",
1214 path,
root_.string());
1215 }
1216}