swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

inUse Set To A Missing Toolchain Should Be Recoverable

Open samdeane opened this issue 11 months ago • 1 comments

I got myself into a mess, such that the config.json had inUse set to a toolchain which didn't exist in ~/.local/share/swiftly/toolchains/.

This left me in a state where swiftly refused to switch to a toolchain that did exist and was correctly installed in ~/.local/share/swiftly/toolchains.

Hand-editing the config.json to remove the inUse entry was enough to get things working again.

Swiftly really ought to be able to detect this situation for itself, and recover (possibly after confirming with the user).

During this recovery it should also update installedToolchains by removing any entries that don't exist in the filesystem.

Note: I'm not expecting magic here, or for it to detect a damaged or partial toolchain folder. If it's totally missing however, it would be good if one wasn't left in a state where nothing worked!

Alternatively, or in addition, there could be some kind of install --force or repair option which re-installed a toolchain even though swiftly thought it was already installed.

samdeane avatar Jan 24 '25 10:01 samdeane

Thank you for reporting this. Swiftly should do better to reconcile differences between its config.json and the state in the filesystem.

cmcgee1024 avatar Jan 29 '25 20:01 cmcgee1024

This should be fixed with the latest swiftly release. Please reopen if this is still happening for you.

cmcgee1024 avatar Sep 04 '25 16:09 cmcgee1024