-
Notifications
You must be signed in to change notification settings - Fork 981
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
[bug] System requirements pollutes STDOUT #17043
Comments
Hi @mtribiere thanks for your question This would be expected behaviour, as the check_output call is directly dealing with the stdout/stderr redirection, we have no way to globally control it from Conan. To fix this, you should change the recipe to follow https://docs.python.org/3/library/subprocess.html#subprocess.check_call recommendations:
This will silence the stdout/err redirections and fix your issue. Let me know if this helps! :) |
Furthermore the general recommendation is to use |
Thank you for your answer, is it a bit of a bumper that any packages could potentially poison the JSON output of a package that would consume it. Especially for us we don't always have the control over our user's package. But I understand that conan doesn't have much control over it. @memsharded you mentioned a |
Yes, this is inconvenient, but that applies to many other aspects, like a dependency recipe could remove the full Conan cache if they want or have a bug, so at the end of the day using dependencies means they are trusted to be correct and do the right thing in all aspects, including not polluting the stdout output.
A python-pip API is way more challenging than the others, because Conan itself is running in a Python environment, so installing things there can break Conan. And in general, it is just not possible to install Python packages in the same environment without conflicts. So it would be necessary to have Python virtualenvs created on the fly for them, something like #11601 proposes, but it is quite complicated, we didn't have time to resume working on it. The recommendation for pip packages would be to install them together with Conan |
You are right, this should be trusted environment, however we have been proven that it wasn't always the case. We might try to implement additional package check on Git level.
That feature is very attractive to us, thought I understand it's complex. I will follow along the development closely. Thank you for those precious information. I'm closing the ticket. |
Describe the bug
Conan version: 2.7.1
While creating a conan package, I noticed that
system_requirements()
of a downstream package can output in STDOUT of an upstream package, poisoning the json output ofconan create . -f json > output.json
.Example of downstream package:
Result in the upstream package
output.json
:I'm not sure if that's intended behavior, but it prevents me from parsing the JSON output on all upstream packages that use this package.
How to reproduce it
No response
The text was updated successfully, but these errors were encountered: