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

Commands returning data like --build_order sometimes get dirty output #1757

Closed
lasote opened this issue Sep 14, 2017 · 6 comments
Closed

Commands returning data like --build_order sometimes get dirty output #1757

lasote opened this issue Sep 14, 2017 · 6 comments
Milestone

Comments

@lasote
Copy link
Contributor

lasote commented Sep 14, 2017

For example using version ranges:

$ conan info --build_order sdplog

Version range '>=4.0' required by 'None' resolved to 'fmt/4.0.0@xylosper/stable'

That message dirts the output and can be processed by an script.
Same problem with the warn we wanted to introduce when conan sets the runtime of visual automatically, we decided to log it.

Maybe these commands should specify a file or something?: There is already a json option to file

@danimtb
Copy link
Member

danimtb commented Feb 27, 2019

I think this was partially workarounded by #4359 as we now have the possibility of outputing a json file with the build order and avoid the stdout pollution. WDYT?

@lasote
Copy link
Contributor Author

lasote commented Feb 27, 2019

This is related to #4055 .
The issue is to allow print json to the stdout while the output is still filled with some other messages.
This is not very important I would say, I would prefer to remove the json to output in Conan 2.0 and assume that a regular command output is not suitable to be parsed. We can discuss in a whiteboard the following sessions if we want that behavior for Conan 2.0 or if we want the full-correct solution.

@danimtb danimtb added whiteboard Put in common and removed Feedback please! labels Feb 27, 2019
@danimtb danimtb added this to the 2.0 milestone Mar 12, 2019
@danimtb danimtb added priority: medium component: ux No changes to core business logic stage: queue and removed stage: triaging labels Mar 12, 2019
@danimtb danimtb removed their assignment Mar 28, 2019
@danimtb danimtb removed the whiteboard Put in common label Mar 28, 2019
@solvingj
Copy link
Contributor

Glad I read this latest comment regarding future plans. Was about to write a script which depends on the json output to stdout. Is there a github issue open for any discussion about piping stdout to stdin between conan commands? There was an informal discussion in slack about it, and that would be an alternative to this kind of json parsing.

@lasote
Copy link
Contributor Author

lasote commented May 20, 2019

To refresh your use case, Jerry, the main one was the conan reference from a create => to the conan upload command, right?
I just thought, that a simple "conan_ref" generator (or something similar) that creates a file with the reference? Might that be nicely used with conan upload @conan_ref.txt ... ?

@solvingj
Copy link
Contributor

Yes, that was the case that has come up the most.

@memsharded
Copy link
Member

The whole terminal output has been changed, decoupled stdout for values, stderr for any other message and formatters to generate json or other formats. Already available in 2.0-alpha

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

No branches or pull requests

4 participants