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
We currently use the following code for automatically writing the conan graph to files when compiling
defwrite_graph_info(filename, result, formatter):
# The formatters write to stdout, so change it to redirect to a file temporarilywithopen(filename, "w", encoding="utf-8") asf:
withredirect_stdout(f):
withredirect_stderr(f):
try:
formatter(result)
exceptGraphError:
# The formatters can raise a GraphError after the graph is written# Let's ignore that, since we deal with the errors after thispasslogging.info(filename)
defwrite_graph_infos(proj, graph):
delete_html_graph_template(proj.conan)
result= {
"graph": graph,
"field_filter": None,
"package_filter": None,
"conan_api": proj.conan.api,
}
build_dir=proj.build_dirlogging.info("\n****** More details can be found in the following files: ******")
write_graph_info(build_dir/"packages.txt", result, format_graph_info)
write_graph_info(build_dir/"packages.html", result, format_graph_html)
write_graph_info(build_dir/"packages.dot", result, format_graph_dot)
logging.info("\n***************************************************************\n")
This relies on some internal functionality, which is not ideal, but worse with Conan 2.10.0 caused the above code to stop working.
The workaround for the colorama crash here #17259, changes the stdout and stderr, which causes our own redirects to fail. But rather than fixing that, I think a proper API function that allows to write to files would be better.
Have you read the CONTRIBUTING guide?
I've read the CONTRIBUTING guide
The text was updated successfully, but these errors were encountered:
What is your suggestion?
We currently use the following code for automatically writing the conan graph to files when compiling
This relies on some internal functionality, which is not ideal, but worse with Conan 2.10.0 caused the above code to stop working.
The workaround for the
colorama
crash here #17259, changes the stdout and stderr, which causes our own redirects to fail. But rather than fixing that, I think a proper API function that allows to write to files would be better.Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: