0

I have ubuntu 18.04 and I had gcc version 7 on there.

I updated gcc to version 8 using alternatives and slaved my gcov version to gcc also to keep them compatible (which worked nicley), but gcovr itself is stuck at version 3.4 and it needs to be ~version 4.x

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 \
        --slave /usr/bin/g++ g++ /usr/bin/g++-7                            \
        --slave /usr/bin/gcov gcov /usr/bin/gcov-7
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 \
        --slave /usr/bin/g++ g++ /usr/bin/g++-8                            \
        --slave /usr/bin/gcov gcov /usr/bin/gcov-8

I had a bit of a dig around and I think gcovr i sjust a python script. I have python 2.7 installed and I also have python .36 installed.

I tried installing gcovr with pip:

sudo -H pip install gcovr
Requirement already satisfied: gcovr in /usr/lib/python2.7/dist-packages

This website shows the versions I need: here

Here is the relevant table:

Python  gcovr
2.6     3.4
3.4     4.1

So I know what I want and where I need to get to, but I don't know how to get there. I think my pip install command invokes python 2.7 pip (my python knowledge is basically zero) so I get the feeling I need to invoke pip for python 3.6 to get the gcovr version I want (could be way off here). Knowing that I have various versions of python, it looks like my default version is 2.7: python --version: 2.7

Any clues how I can get gcovr updated (and maybe even my python version to default to 3.x)?

Update 1

I got a tiny bit further. I installed python alternatives:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2

Now I can swtich between python 2.x and 3.x. When I set python to 3.x and try to install gcovr I get:

sudo -H pip install gcovr
Collecting gcovr
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /simple/gcovr/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /simple/gcovr/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /simple/gcovr/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /simple/gcovr/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),)': /simple/gcovr/
  Could not find a version that satisfies the requirement gcovr (from versions: )
No matching distribution found for gcovr

I suppose I could just download a newer version of the gcovr script...

4

2 に答える 2