Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting when creating environments #7

Open
ncoghlan opened this issue Oct 18, 2024 · 0 comments
Open

Improve error reporting when creating environments #7

ncoghlan opened this issue Oct 18, 2024 · 0 comments
Labels
Category: Enhancement New feature or request

Comments

@ncoghlan
Copy link
Collaborator

ncoghlan commented Oct 18, 2024

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:

  • Set up the subprocess execution such that two log files are created inside each build environment: a merged stdout + stderr file, and a dedicated stderr file (these could either go in a _venvstacks_build subfolder that gets excluded from publish and local-export operations, or else they could be stored outside the build env in a parallel hierarchy, similar to the way the archive metadata is already handled)
  • Before each subprocess invocation in a given build environment, open and seek to the end of the stderr file
  • If the subprocess invocation fails, only report the additions to the stderr file since the command was started rather than dumping the whole thing

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).

@ncoghlan ncoghlan added the Category: Enhancement New feature or request label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant