conda / constructor

tool for creating installers from conda packages
https://conda.github.io/constructor/
Other
456 stars 167 forks source link

Revisit uninstallers #642

Open jaimergp opened 1 year ago

jaimergp commented 1 year ago

Checklist

What is the idea?

Research the best way to implement uninstallers. Currently, only Windows provides some, and they do not do all tasks in the conda-canonical way:

The uninstallation logic is not present on Linux or macOS either.

Why is this needed?

Better uninstallation processes.

What should happen?

The system should be left in a functional state, with no lingering files or configuration.

Additional Context

Uninstallation times have been previously reported as slow, so we might need to balance speed and correctness. See https://github.com/conda/constructor/issues/168. It's mostly UI related, so as long as the output is kept in check, we should be ok. Nevertheless, timings should be analyzed.

marcoesters commented 7 months ago

A viable path for Linux and MacOS uninstallers could be to add that feature to conda-standalone. menuinst has gotten pretty good about removing its shortcuts and the standalone binary can be used to run conda init --reverse.

Essentially, it could try and remove the base environment using default conda commands and clean up whatever needs to be cleaned up afterwards. The user would then just have to remove the standalone binary in the end.

marcoesters commented 1 month ago

I just found that the uninstaller won't remove shortcuts for packages created in a new environment on Windows since the uninstaller doesn't know about theses prefixes. The solution here is to remove them for each environment it can find, but recursive searches in NSIS aren't ideal.

Python/conda-standalone using pathlib's glob functionality would be a much better tool.

jaimergp commented 1 month ago

Aren't we doing conda remove --all for those?

marcoesters commented 1 month ago

We only do conda remove --all for environments that were shipped with installers: https://github.com/conda/constructor/blob/main/constructor/winexe.py#L195-L210

This does not account for user-created environments.