Preserve backend installs during failed updates#2316
Closed
gaoflow wants to merge 1 commit into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the backend installation flow so a failed backend update no longer wipes a previously working backend install (notably on Windows), by staging installs in a separate sibling directory and only swapping them into place after verification succeeds.
Changes:
- Install backend archives into a unique sibling staging directory, then atomically replace the active install directory on success.
- Preserve and restore an existing install if activation fails, and avoid recursively deleting Windows reparse-point backups (junction/symlink targets).
- Update related server-side comments to reflect the new install/activation behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/cpp/server/backends/backend_utils.cpp |
Implements staged installs + activation/rollback logic and reparse-point-safe cleanup. |
src/cpp/server/server.cpp |
Updates the *_bin hot-swap comment to match the new install semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+367
to
+375
| if (fs::exists(install_dir)) { | ||
| backup_dir = make_unique_install_sibling(install_dir.string(), ".backup"); | ||
| fs::rename(install_dir, backup_dir, ec); | ||
| if (ec) { | ||
| throw std::runtime_error("Failed to move existing install directory '" + | ||
| install_dir.string() + "': " + ec.message()); | ||
| } | ||
| backed_up_existing = true; | ||
| } |
Phqen1x
added a commit
to Phqen1x/lemonade
that referenced
this pull request
Jun 19, 2026
…ad of system() Fixes lemonade-sdk#2316 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
This seems to be a duplicate of #2315 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2313.
Testing
git diff --checkpre-commit run --files src/cpp/server/backends/backend_utils.cpp src/cpp/server/server.cppclang++ -std=c++17 -fsyntax-only -I src/cpp/include -I /tmp/lemonade-syntax-include src/cpp/server/backends/backend_utils.cppNote: CMake/Ninja are not installed in my local environment, so I used temporary third-party headers under
/tmp/lemonade-syntax-includefor the syntax-only compile check.AI assistance was used under my direction.