summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/local/file_storage.hpp4
-rw-r--r--src/buildtool/file_system/file_system_manager.hpp10
2 files changed, 9 insertions, 5 deletions
diff --git a/src/buildtool/execution_api/local/file_storage.hpp b/src/buildtool/execution_api/local/file_storage.hpp
index 0af749ad..201b1759 100644
--- a/src/buildtool/execution_api/local/file_storage.hpp
+++ b/src/buildtool/execution_api/local/file_storage.hpp
@@ -69,7 +69,9 @@ class FileStorage {
// directly or check its existence if it was created by now.
return FileSystemManager::CreateFileHardlinkAs<kType,
kSetEpochTime>(
- path, file_path) or
+ path,
+ file_path,
+ /*log_failure_at=*/LogLevel::Debug) or
FileSystemManager::IsFile(file_path);
};
auto create_and_stage = [&]() {
diff --git a/src/buildtool/file_system/file_system_manager.hpp b/src/buildtool/file_system/file_system_manager.hpp
index c5538c49..f7a499a3 100644
--- a/src/buildtool/file_system/file_system_manager.hpp
+++ b/src/buildtool/file_system/file_system_manager.hpp
@@ -105,12 +105,13 @@ class FileSystemManager {
[[nodiscard]] static auto CreateFileHardlink(
std::filesystem::path const& file_path,
- std::filesystem::path const& link_path) noexcept -> bool {
+ std::filesystem::path const& link_path,
+ LogLevel log_failure_at = LogLevel::Error) noexcept -> bool {
try {
std::filesystem::create_hard_link(file_path, link_path);
return std::filesystem::is_regular_file(link_path);
} catch (std::exception const& e) {
- Logger::Log(LogLevel::Error,
+ Logger::Log(log_failure_at,
"hard linking {} to {}\n{}",
file_path.string(),
link_path.string(),
@@ -123,13 +124,14 @@ class FileSystemManager {
requires(IsFileObject(kType))
[[nodiscard]] static auto CreateFileHardlinkAs(
std::filesystem::path const& file_path,
- std::filesystem::path const& link_path) noexcept -> bool {
+ std::filesystem::path const& link_path,
+ LogLevel log_failure_at = LogLevel::Error) noexcept -> bool {
// Set permissions first (permissions are a property of the file) so
// that the created link has the correct permissions as soon as the link
// creation is finished.
return SetFilePermissions(file_path, IsExecutableObject(kType)) and
(not kSetEpochTime or SetEpochTime(file_path)) and
- CreateFileHardlink(file_path, link_path);
+ CreateFileHardlink(file_path, link_path, log_failure_at);
}
template <bool kSetEpochTime = false>