You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Long story short, pkgcore right now kinda pushes output through two separate pipesets. The 'Python part' of the output goes through formatters, while the 'bash part' (and other subprocesses) output to stdout/stderr directly. This kinda sucks when using the API e.g. to regen caches since I can only capture some of the output via API, while for the other part I need to replace file descriptors.
My idea so far is to introduce an additional property to the formatters, let's call it technically .input_stream. It would be used as stdout/stderr target for subprocess calls (where the two aren't redirected for some other reason). For regular formatters, it will be just a copy of .stream, therefore the output would still land as stdout/stderr. However, it would make it possible to have different streams in the future, e.g. to delay output when doing multi-threaded cache regen.
I've got no argument w/ the analysis, nor proposal- my original intent was basically what you're suggesting, I just never finished it (and your description is a bit more cogent than my old design docs). cough ;)
I'm not sure about .input_stream for the naming- that may run into abstraction issues down the line if/when stdin is actually integrated (assuming we ever go that route rather than the custom crap for --ask).
Long story short, pkgcore right now kinda pushes output through two separate pipesets. The 'Python part' of the output goes through formatters, while the 'bash part' (and other subprocesses) output to stdout/stderr directly. This kinda sucks when using the API e.g. to regen caches since I can only capture some of the output via API, while for the other part I need to replace file descriptors.
My idea so far is to introduce an additional property to the formatters, let's call it technically
.input_stream
. It would be used as stdout/stderr target for subprocess calls (where the two aren't redirected for some other reason). For regular formatters, it will be just a copy of.stream
, therefore the output would still land as stdout/stderr. However, it would make it possible to have different streams in the future, e.g. to delay output when doing multi-threaded cache regen.@ferringb, what do you think?
The text was updated successfully, but these errors were encountered: