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

Supporting pushing subprocess output through formatters #19

Open
mgorny opened this issue Aug 23, 2015 · 1 comment
Open

Supporting pushing subprocess output through formatters #19

mgorny opened this issue Aug 23, 2015 · 1 comment

Comments

@mgorny
Copy link
Contributor

mgorny commented Aug 23, 2015

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?

@ferringb
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants