labscript-suite-temp-2 / installer

The installer for the labscript suite. This repository is used used to build zip files containing an install script and all the labscript suite python packages.
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Installer can delete wrong labscript installation when trying to reinstall one of two installations #16

Open philipstarkey opened 7 years ago

philipstarkey commented 7 years ago

Original report (archived issue) by David Meyer (Bitbucket: dihm, GitHub: dihm).


Almost lost two days of work on this very strange edge case.

If someone has two separate labscript installations on the same machine and attempts to use the installer to refresh the existing second installation in the non-default path (second defined by the order in the python path), the installer calls uninstall on line 329 without explicitly passing the user-specified install path. Uninstall then searches the python path for the first labscript directory (lines 427-430) and proceeds to delete everything. Unfortunately the first labscript directory on the path is not necessarily the desired install path that needs to be refreshed.

If I'm reading it correctly, this can be fixed by passing install_folder to uninstall() on line 329.

philipstarkey commented 6 years ago

Original comment by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).


Apologies that you almost lost work.

I'll look into this in the interests of preventing data loss, but we don't really support multiple installations - python virtualenvs or conda envs should be used for that sort of thing.

So likely I'll modify the installer to prevent multiple installations in the same python environment, and have it cough a message recommending you use a virtualenv or similar.

Since we just assume the modules are in the python path, it is pretty tricky to manage multiple installations, they would be importing each other by accident unless we changed how modules find each other at runtime considerably.

philipstarkey commented 6 years ago

Original comment by David Meyer (Bitbucket: dihm, GitHub: dihm).


This is certainly an odd edge case. It's been a while so I don't remember the exact context, but I came across this when I was changing my conda installation from 32-bit to 64-bit and was having trouble getting the shortcuts to link properly.

Whatever fix works is fine by me.