scripts/ci: bump CentOS Python to 3.8
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 19 Jan 2023 13:35:26 +0000 (14:35 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 6 Feb 2023 12:21:28 +0000 (13:21 +0100)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/ci/org.centos/stream/8/build-environment.yml
scripts/ci/org.centos/stream/8/x86_64/configure
scripts/ci/setup/build-environment.yml

index b1768d18afac1fe514c289ab3386514139b7dbb2..0d094d70c3b362a2ceeed1d2b86f575e51bd53af 100644 (file)
@@ -65,7 +65,7 @@
           - nmap-ncat
           - numactl-devel
           - pixman-devel
-          - python36
+          - python38
           - python3-sphinx
           - rdma-core-devel
           - redhat-rpm-config
index 75882faa9ca5384ce5a3bcd8ea2ecc15dc9281ee..65eacf3c56bbb274b63099baddfe8942577077c3 100755 (executable)
@@ -16,6 +16,7 @@
 # that patches adding downstream specific devices are not available.
 #
 ../configure \
+--python=/usr/bin/python3.8 \
 --prefix="/usr" \
 --libdir="/usr/lib64" \
 --datadir="/usr/share" \
index 2274f736f7dee9cfe88dbcb0231e19b5dcd10cb5..78b1021cd420d8609445f7251ec05f7b9e258c06 100644 (file)
           - nmap-ncat
           - numactl-devel
           - pixman-devel
-          - python36
+          - python38
           - python3-sphinx
           - rdma-core-devel
           - redhat-rpm-config
         - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
         - ansible_facts['distribution_version'] == '8'
         - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64'
+
+    - name: Check whether the Python runtime version is managed by alternatives
+      stat:
+        path: /etc/alternatives/python3
+      register: python3
+
+    - name: Set default Python runtime to 3.8 on EL8
+      command: alternatives --set python3 /usr/bin/python3.8
+      when:
+        - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
+        - ansible_facts['distribution_version'] == '8'
+        - python3.stat.islnk and python3.stat.lnk_target != '/usr/bin/python3.8'