rpm: Install python3-tox on >= fedora 29#25168
Conversation
Fix the error "No matching package to install: 'python-tox'" Fixes: http://tracker.ceph.com/issues/37301 Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
| BuildRequires: python%{_python_buildid}-requests | ||
| BuildRequires: python%{_python_buildid}-six | ||
| %if 0%{?fedora} >= 29 | ||
| BuildRequires: python3-tox |
There was a problem hiding this comment.
strange enough, _python_buildid should be 3 in this case. as %{without python2} should be false on fedora by default.
There was a problem hiding this comment.
It's the logic in munge_ceph_spec_in I believe
There was a problem hiding this comment.
$ lsb_release -d
Description: Fedora release 29 (Twenty Nine)
$ type python2
python2 is /usr/bin/python2
$ echo $?
0
There was a problem hiding this comment.
@smithfarm could you take a look please?
There was a problem hiding this comment.
$ bash -x ./install-deps.sh
+ '[' -z '' ']'
...
+ type python2
+ sed -i -e 's/%bcond_with python2/%bcond_without python2/g' /tmp/install-deps.1540/ceph.spec
+ '[' ']'
There was a problem hiding this comment.
Is this what we need?
diff --git a/install-deps.sh b/install-deps.sh
index da22e54bba..35b0c255ba 100755
--- a/install-deps.sh
+++ b/install-deps.sh
@@ -35,7 +35,7 @@ function install_seastar_deps {
function munge_ceph_spec_in {
local OUTFILE=$1
sed -e 's/@//g' -e 's/%bcond_with make_check/%bcond_without make_check/g' < ceph.spec.in > $OUTFILE
- if type python2 > /dev/null 2>&1 ; then
+ if ! type python2 > /dev/null 2>&1 ; then
sed -i -e 's/%bcond_with python2/%bcond_without python2/g' $OUTFILE
else
sed -i -e 's/%bcond_without python2/%bcond_with python2/g' $OUTFILEThere was a problem hiding this comment.
Nope, that doesn't work.
There was a problem hiding this comment.
i think we should default to python3 (i.e., 's/%bcond_without python2/%bcond_with python2/g') on fedora 29, where python3 is dominant.
There was a problem hiding this comment.
I could create a special case in munge_ceph_spec_in for f29?
There was a problem hiding this comment.
yeah. we can even skip this step if it's on f29.
|
In its unmunged form, the spec file will try to do a Python 3 build on Fedora. In other words, it will look for the python3-... form of all the python build deps (including tox). However, as you already have zeroed in on, if install-deps.sh is being used, there is a twist. Inside install-deps.sh, there's a function However, if the system doesn't have the right repos providing all the py2 versions of the build dependencies, then the build will still fail. Have you tried uninstalling Python 2 before running install-deps.sh? |
|
Also, when looking at %bcond it's good to be aware that the meaning is non-intuitive:
WTF, you say? But actually it makes sense. The macro For more info, see http://rpm.org/user_doc/conditional_builds.html |
|
Please see #25181 for a different approach. |
|
👍 |
Fix the error "No matching package to install: 'python-tox'"
Fixes: http://tracker.ceph.com/issues/37301
Signed-off-by: Brad Hubbard bhubbard@redhat.com