lmstudio-ai / venvstacks

Virtual environment stacks for Python
http://venvstacks.lmstudio.ai/
MIT License
174 stars 6 forks source link

Improve error reporting when creating environments #7

Open ncoghlan opened 1 month ago

ncoghlan commented 1 month ago

While error reporting in general is currently poor (see #5), it's especially bad when environment creation fails.

6 got rid of one of the worst offenders in that regard (the implicit source build support), but even dependency download failures can be hard to spot in the middle of a full environment stack build.

The following would provide a general improvement in subprocess output handling:

A simpler first iteration on this idea would be to just log separate stdout and stderr files for each operation during the build (since subprocess.run supports that natively, while merging the two streams while also logging stderr separately needs to be managed by the host app).

It's also worth checking if there are any decent third party libraries for this (since it's hardly a venvstacks-specific problem).