scripts/ci: update build environment playbooks
cover scripts/ci: update build environment playbooks
This series cleans up and updates the Ansible playbooks in scripts/ci, with the aim of enabling Python 3.8 in the custom CentOS runner. This is the first step towards bumping the minimum required version of Python past 3.6, because the custom runner has to be updated manually by Cleber unlike the containers in tests/docker/dockerfiles.
The patches comprise other changes than just updating Python 3.8:
- small cleanups (patch 1)
- support CentOS Stream 8 (patch 2)
- make the playbook actually work (patch 3)
- do not force me to test two different sets of packages :) (patch 4)
Paolo Bonzini (5):
scripts/ci: remove unnecessary checks from CentOS playbook scripts/ci: support CentOS Stream 8 in build-environment.yaml scripts/ci: add capstone development packages
scripts/ci: unify package lists for CentOS in build-environment files scripts/ci: bump CentOS Python to 3.8
.../org.centos/stream/8/build-environment.yml | 38 ++++++++++-- .../ci/org.centos/stream/8/x86_64/configure | 1 + scripts/ci/setup/build-environment.yml | 59 +++++++++++++++++-- 3 files changed, 90 insertions(+), 8 deletions(-)
Signature · 1 line
2.38.1
PATCH 1/5 scripts/ci: remove unnecessary checks from CentOS playbook
The playbook is meant for a CentOS 8 install and is already checking /etc/redhat-release. Simplify it by checking only the result of the "extra check" rather than the Ansible facts dictionary.
--- scripts/ci/org.centos/stream/8/build-environment.yml | 4 ---- 1 file changed, 4 deletions(-)
scripts/ci/org.centos/stream/8/build-environment.yml +0 -4
@@ -17,8 +17,6 @@ option: enabled value: "1" when: - - ansible_facts['distribution'] == 'CentOS' - - ansible_facts['distribution_major_version'] == '8' - centos_stream_8 - name: Install basic packages to build QEMU on CentOS Stream 8
@@ -46,6 +44,4 @@ - systemd-devel state: present when: - - ansible_facts['distribution'] == 'CentOS' - - ansible_facts['distribution_major_version'] == '8' - centos_stream_8
Signature · 1 line
2.38.1
PATCH 2/5 scripts/ci: support CentOS Stream 8 in build-environment.yaml
In reply to Paolo BonziniUpdate the CI playbook so that it is able to prepare a system with a fresh CentOS Stream 8 install, rather than just support RHEL. The ninja-build package is only available if the CentOS Powertools are enabled, which indeed is what the org.centos/stream/8 playbook is already doing.
--- scripts/ci/setup/build-environment.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
scripts/ci/setup/build-environment.yml +12 -2
@@ -130,6 +130,16 @@ - ansible_facts['distribution_version'] == '20.04' - ansible_facts['architecture'] == 'aarch64' + - name: Enable PowerTools repo on CentOS 8 + ini_file: + path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo + section: powertools + option: enabled + value: "1" + when: + - ansible_facts['distribution_file_variety'] == 'CentOS' + - ansible_facts['distribution_major_version'] == '8' + - name: Install basic packages to build QEMU on EL8 dnf: # This list of packages start with tests/docker/dockerfiles/centos8.docker
@@ -165,7 +175,7 @@ - zlib-devel state: present when: - - ansible_facts['distribution_file_variety'] == 'RedHat' + - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS'] - ansible_facts['distribution_version'] == '8' - name: Install packages only available on x86 and aarch64
@@ -175,6 +185,6 @@ - spice-server state: present when: - - ansible_facts['distribution_file_variety'] == 'RedHat' + - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS'] - ansible_facts['distribution_version'] == '8' - ansible_facts['architecture'] == 'aarch64' or ansible_facts['architecture'] == 'x86_64'
Signature · 1 line
2.38.1
PATCH 3/5 scripts/ci: add capstone development packages
In reply to Paolo BonziniCapstone is not provided anymore by QEMU as a submodule since commit 83602083b4ad ("capstone: Remove the capstone submodule", 2022-05-18). For the org.centos/stream/8 playbook to actually provide a usable build environment, it needs to include the capstone-devel package.
Include it in the "basic" build packages as well so that the resulting QEMU has full disassembling functionality.
--- scripts/ci/org.centos/stream/8/build-environment.yml | 9 +++++++++ scripts/ci/setup/build-environment.yml | 11 +++++++++++ 2 files changed, 20 insertions(+)
scripts/ci/org.centos/stream/8/build-environment.yml +9 -0
@@ -10,6 +10,14 @@ check_mode: yes register: centos_stream_8 + - name: Enable EPEL repo on CentOS Stream 8 + dnf: + name: + - epel-release + state: present + when: + - centos_stream_8 + - name: Enable PowerTools repo on CentOS Stream 8 ini_file: path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
@@ -22,6 +30,7 @@ - name: Install basic packages to build QEMU on CentOS Stream 8 dnf: name: + - capstone-devel - device-mapper-multipath-devel - glusterfs-api-devel - gnutls-devel
scripts/ci/setup/build-environment.yml +11 -0
@@ -46,6 +46,7 @@ - libbrlapi-dev - libbz2-dev - libcacard-dev + - libcapstone-dev - libcap-ng-dev - libcurl4-gnutls-dev - libdrm-dev
@@ -130,6 +131,15 @@ - ansible_facts['distribution_version'] == '20.04' - ansible_facts['architecture'] == 'aarch64' + - name: Enable EPEL repo on EL8 + dnf: + name: + - epel-release + state: present + when: + - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS'] + - ansible_facts['distribution_major_version'] == '8' + - name: Enable PowerTools repo on CentOS 8 ini_file: path: /etc/yum.repos.d/CentOS-Stream-PowerTools.repo
@@ -148,6 +158,7 @@ name: - bzip2 - bzip2-devel + - capstone-devel - dbus-daemon - diffutils - gcc
Signature · 1 line
2.38.1
PATCH 4/5 scripts/ci: unify package lists for CentOS in build-environment files
In reply to Paolo Bonziniscripts/ci/org.centos/stream/8/build-environment.yml has a slightly different list of packages compared to scripts/ci/setup/build-environment.yaml. Make them the same for simplicity.
--- .../org.centos/stream/8/build-environment.yml | 25 +++++++++++++++++++ scripts/ci/setup/build-environment.yml | 20 ++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-)
scripts/ci/org.centos/stream/8/build-environment.yml +25 -0
@@ -30,13 +30,26 @@ - name: Install basic packages to build QEMU on CentOS Stream 8 dnf: name: + - bzip2 + - bzip2-devel - capstone-devel + - dbus-daemon - device-mapper-multipath-devel + - diffutils + - gcc + - gcc-c++ + - genisoimage + - gettext + - git + - glib2-devel - glusterfs-api-devel - gnutls-devel + - libaio-devel - libcap-ng-devel - libcurl-devel + - libepoxy-devel - libfdt-devel + - libgcrypt-devel - libiscsi-devel - libpmem-devel - librados-devel
@@ -44,13 +57,25 @@ - libseccomp-devel - libssh-devel - libxkbcommon-devel + - lzo-devel + - make + - mesa-libEGL-devel + - nettle-devel - ninja-build + - nmap-ncat - numactl-devel + - pixman-devel + - python36 - python3-sphinx + - rdma-core-devel - redhat-rpm-config - snappy-devel + - spice-glib-devel - spice-server-devel - systemd-devel + - systemtap-sdt-devel + - tar + - zlib-devel state: present when: - centos_stream_8
scripts/ci/setup/build-environment.yml +19 -1
@@ -160,6 +160,7 @@ - bzip2-devel - capstone-devel - dbus-daemon + - device-mapper-multipath-devel - diffutils - gcc - gcc-c++
@@ -167,20 +168,36 @@ - gettext - git - glib2-devel + - glusterfs-api-devel + - gnutls-devel - libaio-devel + - libcap-ng-devel + - libcurl-devel - libepoxy-devel + - libfdt-devel - libgcrypt-devel + - libiscsi-devel + - libpmem-devel + - librados-devel + - librbd-devel + - libseccomp-devel + - libssh-devel + - libxkbcommon-devel - lzo-devel - make - mesa-libEGL-devel - nettle-devel - ninja-build - nmap-ncat - - perl-Test-Harness + - numactl-devel - pixman-devel - python36 + - python3-sphinx - rdma-core-devel + - redhat-rpm-config + - snappy-devel - spice-glib-devel + - systemd-devel - systemtap-sdt-devel - tar - zlib-devel
@@ -194,6 +211,7 @@ # Spice server not available in ppc64le name: - spice-server + - spice-server-devel state: present when: - ansible_facts['distribution_file_variety'] in ['RedHat', 'CentOS']
Signature · 1 line
2.38.1
PATCH 5/5 scripts/ci: bump CentOS Python to 3.8
In reply to Paolo BonziniIn preparation for bumping the minimum requirement for the Python runtime in QEMU 8.0, use the Python 3.8 package in the CentOS Stream 8 build environments. To cover all bases, the "generic" playbook sets up alternatives so that /usr/bin/python3 points to Python 3.8, while the custom runner uses the --python option to configure. The latter is probably more suitable for the task of building an RPM file.
--- .../ci/org.centos/stream/8/build-environment.yml | 2 +- scripts/ci/org.centos/stream/8/x86_64/configure | 1 + scripts/ci/setup/build-environment.yml | 14 +++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-)
scripts/ci/org.centos/stream/8/build-environment.yml +1 -1
@@ -65,7 +65,7 @@ - nmap-ncat - numactl-devel - pixman-devel - - python36 + - python38 - python3-sphinx - rdma-core-devel - redhat-rpm-config
scripts/ci/org.centos/stream/8/x86_64/configure +1 -0
@@ -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" \
scripts/ci/setup/build-environment.yml +13 -1
@@ -191,7 +191,7 @@ - nmap-ncat - numactl-devel - pixman-devel - - python36 + - python38 - python3-sphinx - rdma-core-devel - redhat-rpm-config
@@ -217,3 +217,15 @@ - 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'
Signature · 1 line
2.38.1