Skip to content

Commit 647f19b

Browse files
authored
Merge pull request LykosAI#1106 from ionite34/backport/main/pr-1105
[dev to main] backport: Catch symlink removal errors during update so it doesn't completely fail the update (1105)
2 parents dae982d + f7a71e0 commit 647f19b

File tree

2 files changed

+31
-8
lines changed

2 files changed

+31
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
2222
- Fixed [#1301](https://github.com/LykosAI/StabilityMatrix/issues/1301) - Error when installing kohya_ss
2323
- Fixed [#1305](https://github.com/LykosAI/StabilityMatrix/issues/1305) - FluxGym installing incorrect packages for Blackwell GPUs
2424
- Fixed [#1316](https://github.com/LykosAI/StabilityMatrix/issues/1316) - Errors when installing Triton & SageAttention
25+
- Fixed "directory is not empty" error when updating packages with symlinks
2526

2627
## v2.14.2
2728
### Changed

StabilityMatrix.Core/Models/Packages/BaseGitPackage.cs

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,18 +446,40 @@ await PrerequisiteHelper
446446
{
447447
if (SharedFolders is not null)
448448
{
449-
Helper.SharedFolders.RemoveLinksForPackage(
450-
SharedFolders,
451-
new DirectoryPath(installedPackage.FullPath!)
452-
);
449+
try
450+
{
451+
Helper.SharedFolders.RemoveLinksForPackage(
452+
SharedFolders,
453+
new DirectoryPath(installedPackage.FullPath!)
454+
);
455+
}
456+
catch (Exception e)
457+
{
458+
Logger.Warn(
459+
e,
460+
"Failed to remove symlinks for package {Package}",
461+
installedPackage.PackageName
462+
);
463+
}
453464
}
454465

455466
if (SharedOutputFolders is not null && installedPackage.UseSharedOutputFolder)
456467
{
457-
Helper.SharedFolders.RemoveLinksForPackage(
458-
SharedOutputFolders,
459-
new DirectoryPath(installedPackage.FullPath!)
460-
);
468+
try
469+
{
470+
Helper.SharedFolders.RemoveLinksForPackage(
471+
SharedOutputFolders,
472+
new DirectoryPath(installedPackage.FullPath!)
473+
);
474+
}
475+
catch (Exception e)
476+
{
477+
Logger.Warn(
478+
e,
479+
"Failed to remove output symlinks for package {Package}",
480+
installedPackage.PackageName
481+
);
482+
}
461483
}
462484
}
463485

0 commit comments

Comments
 (0)