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

[question] conan 2 output to file #16098

Closed
1 task done
araffin opened this issue Apr 17, 2024 · 3 comments
Closed
1 task done

[question] conan 2 output to file #16098

araffin opened this issue Apr 17, 2024 · 3 comments
Assignees

Comments

@araffin
Copy link
Contributor

araffin commented Apr 17, 2024

What is your question?

Hello,

Could you point me to the discussion/reasoning behind the fact that conan v2 doesn't offer the option to output format to files, but rather outputs things to stdout (and the rest to stderr)?

From a user point of view, I already encountered issues that #15704 tries to solve ( #15671) but the current solution (overriding python built-in) looks more like a hack to me that can break in other cases, for instance if the user directly output things to stdout.

In short, I'm curious about the reasons behind this design choice and if output to a file is a planned feature?

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded memsharded self-assigned this Apr 17, 2024
@memsharded
Copy link
Member

Could you point me to the discussion/reasoning behind the fact that conan v2 doesn't offer the option to output format to files, but rather outputs things to stdout (and the rest to stderr)?

To follow more standard command line tools approaches, to be able to redirect output instead of generating files. It is something that can be done in CI or other automation, to avoid the creation of temporary files in disk, just redirect to memory and parse and use the information directly from the output stream in memory, not needing to read from disk (that can pollute the checkout for example if you don't recall to remove it later).

In short, I'm curious about the reasons behind this design choice and if output to a file is a planned feature?

No, it is not planned at the moment, the standard cmd > file redirection has been working well so far. The print() issues were just small unexpected things, because users doing undocumented things instead of using the documented self.output.

@araffin
Copy link
Contributor Author

araffin commented Apr 17, 2024

thanks for the swift answer =).

@araffin araffin closed this as completed Apr 17, 2024
@memsharded
Copy link
Member

#17507 adds a new --output-file to enforce writing the result in that file irrespective of the stdout redirections or other possible issues. It will be in next Conan 2.12. Thanks for the feedback!

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

2 participants