From 08e0f4a2ee70dc93107f7de193c372621da9180a Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 6 Jun 2026 09:41:07 -0600 Subject: [PATCH] Update aurora & remove old pipeline cache handling --- extern/aurora | 2 +- src/dusk/data.cpp | 100 ---------------------------------------------- 2 files changed, 1 insertion(+), 101 deletions(-) diff --git a/extern/aurora b/extern/aurora index c31d6dadcb..19479a53e4 160000 --- a/extern/aurora +++ b/extern/aurora @@ -1 +1 @@ -Subproject commit c31d6dadcbe8d6131b90ea30b756553d8ee5ae6e +Subproject commit 19479a53e4e82c58fb1b4fe07498383b89688713 diff --git a/src/dusk/data.cpp b/src/dusk/data.cpp index 2720651699..c1eb333399 100644 --- a/src/dusk/data.cpp +++ b/src/dusk/data.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include @@ -28,8 +27,6 @@ namespace { aurora::Module Log{"dusk::data"}; constexpr auto kLocationDescriptorName = "data_location.json"; -constexpr auto kPipelineCacheName = "pipeline_cache.db"; -constexpr auto kInitialPipelineCacheName = "initial_pipeline_cache.db"; constexpr std::array kUserDataDirectories = { "texture_replacements", @@ -888,102 +885,6 @@ void ensure_data_directory(const std::filesystem::path& dataPath) { } } -SDL_IOStream* open_initial_pipeline_cache_source(std::string& sourcePathString) { - const auto basePath = base_path_relative(kInitialPipelineCacheName); - sourcePathString = io::fs_path_to_string(basePath); - auto* source = SDL_IOFromFile(sourcePathString.c_str(), "rb"); - if (source != nullptr) { - return source; - } - - sourcePathString = std::string{kInitialPipelineCacheName}; - return SDL_IOFromFile(sourcePathString.c_str(), "rb"); -} - -void ensure_initial_pipeline_cache(const std::filesystem::path& configDir) { - if (configDir.empty()) { - return; - } - - std::error_code ec; - std::filesystem::create_directories(configDir, ec); - if (ec) { - Log.warn("Failed to create config directory '{}' for pipeline cache: {}", - io::fs_path_to_string(configDir), ec.message()); - return; - } - - const auto pipelineCachePath = configDir / kPipelineCacheName; - if (std::filesystem::exists(pipelineCachePath, ec)) { - return; - } - - std::string sourcePathString; - SDL_IOStream* source = open_initial_pipeline_cache_source(sourcePathString); - if (source == nullptr) { - Log.info("No bundled initial pipeline cache found"); - return; - } - - const auto pipelineCacheString = io::fs_path_to_string(pipelineCachePath); - SDL_IOStream* destination = SDL_IOFromFile(pipelineCacheString.c_str(), "wb"); - if (destination == nullptr) { - Log.warn("Failed to open '{}' for seeded pipeline cache: {}", pipelineCacheString, - SDL_GetError()); - SDL_CloseIO(source); - return; - } - - bool copied = true; - std::array buffer{}; - while (true) { - const size_t bytesRead = SDL_ReadIO(source, buffer.data(), buffer.size()); - if (bytesRead > 0) { - size_t bytesWritten = 0; - while (bytesWritten < bytesRead) { - const size_t written = SDL_WriteIO( - destination, buffer.data() + bytesWritten, bytesRead - bytesWritten); - if (written == 0) { - Log.warn("Failed to write seeded pipeline cache '{}': {}", pipelineCacheString, - SDL_GetError()); - copied = false; - break; - } - bytesWritten += written; - } - } - - if (!copied) { - break; - } - - if (bytesRead < buffer.size()) { - if (SDL_GetIOStatus(source) == SDL_IO_STATUS_EOF) { - break; - } - - Log.warn( - "Failed to read bundled pipeline cache '{}': {}", sourcePathString, SDL_GetError()); - copied = false; - break; - } - } - - if (!SDL_CloseIO(destination)) { - Log.warn( - "Failed to close seeded pipeline cache '{}': {}", pipelineCacheString, SDL_GetError()); - copied = false; - } - SDL_CloseIO(source); - - if (!copied) { - std::filesystem::remove(pipelineCachePath, ec); - return; - } - - Log.info("Seeded pipeline cache from '{}'", sourcePathString); -} - } // namespace bool open_data_path() { @@ -1096,7 +997,6 @@ Paths initialize_data() { migrate_data(prefPath, dataPath, descriptor ? &descriptor->descriptor : nullptr); ensure_data_directory(dataPath); ensure_data_directory(prefPath); - ensure_initial_pipeline_cache(prefPath); return Paths{ .userPath = dataPath,