-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
'python2 --version' sends output to stderr, redirect to stdout to cat… #20979
Closed
Closed
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a5e769f
'python2 --version' sends output to stderr, redirect to stdout to cat…
wdobbe d7ad6ca
Merge branch 'master' into qt5_fix_python2_versioncheck
wdobbe 9948787
Run python2 version check via subprocess to capture stderr output.
wdobbe bc522da
Fix merge conflict with other qt5 commit.
wdobbe 08d993d
Merge branch 'master' into qt5_fix_python2_versioncheck
wdobbe 9ec6fd4
Merge branch 'master' into qt5_fix_python2_versioncheck
wdobbe 99ef838
Merge branch 'master' into qt5_fix_python2_versioncheck
wdobbe ce2c7ba
Merge branch 'master' into qt5_fix_python2_versioncheck
wdobbe 7604e81
Merge branch 'master' into qt5_fix_python2_versioncheck
wdobbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work on Windows - You might need to use
subprocess
to execute the command directly and get stderr from thereI'll look into allowing Conan's run method to also output stderr just like what is done with stdout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ruben,
Thanks for reviewing.
Before submitting I tested the "
python --version 2>&1
" command in a Windows command prompt and it worked.A colleague of mine is currently building qt 5.15.11 on Windows and with the above patched he has no errors yet. Before the patch the build would quit almost immediately because of the broken Python2 version check.
So I am quite confident this solution will work also on Windows.
Of course it would still be nice if stderr could be re-directed as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wdobbe Please, let's avoid workarounds and follow Ruben's approach, the
subprocess
is specially designed for this case, it's cross-platform compatibly, has fine-grained control over pipes, is more secure (avoids injections), and much better for error handling in case of an exception.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as requested and tested with Conan 2.13.0 on Linux x86_64 with:
conan create . --version=5.15.11 -o qt/*:qtwebengine=True -o sqlite3/*:shared=True -o qt/*:shared=True -o qt/*:gui=True -o qt/*:qtdeclarative=True -o qt/*:qtlocation=True -o qt/*:qtwebchannel=True --build=missing