From b5065d02d4ff3001185b4c1d5b39666db8f2a514 Mon Sep 17 00:00:00 2001 From: faumaray Date: Sat, 25 Jul 2026 23:44:48 +0300 Subject: [PATCH] update Signed-off-by: faumaray --- src/CoreLoader.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/CoreLoader.cpp b/src/CoreLoader.cpp index 64327a0..77f891a 100644 --- a/src/CoreLoader.cpp +++ b/src/CoreLoader.cpp @@ -334,18 +334,13 @@ namespace Echoion::Host Api::ErrorCode::NotFound, std::format("New library not found: {}", targetPath.string())); } - if (targetPath != currentLibraryPath_) { - return Api::fail( - Api::ErrorCode::InvalidArgument, - "in-process Core reload must use the loaded path; release " - "bundles " - "with a new path are applied through daemon re-exec"); - } - if (!canCreateHotReloadCopy(targetPath)) { + const bool replacingPath = targetPath != currentLibraryPath_; + if (!replacingPath && !canCreateHotReloadCopy(targetPath)) { return Api::fail( Api::ErrorCode::PermissionDenied, - "in-process Core reload requires a writable library directory; " - "immutable releases are applied through daemon re-exec"); + "in-place Core reload requires a writable library directory; " + "use " + "an immutable versioned path for installed updates"); } hotReloading_ = true; @@ -376,7 +371,9 @@ namespace Echoion::Host } } - const auto reloadResult = pluginManager_.reload(pluginName_); + const auto reloadResult = + replacingPath ? pluginManager_.replace(pluginName_, targetPath) + : pluginManager_.reload(pluginName_); if (!reloadResult) { hotReloading_ = false; auto message = @@ -410,6 +407,7 @@ namespace Echoion::Host hotReloading_ = false; return refreshed; } + currentLibraryPath_ = targetPath; if (!state.empty()) { if (auto restored = core_->restoreState(state); !restored) { Void::Log::warn("CoreLoader",