Open
回合上游补丁 #23
zhangxingrongAdd on Jul 9, 2024
回合上游补丁 #23
Open
zhangxingrongAdd on Jul 9, 2024
Merged fromrefs/pull/23/headintomaster
Total: 2 files changed+112-1
@@ -0,0 +1,106 @@
1+From ef98adbb7a9d48a68f89abf34d763ab302d1cdda Mon Sep 17 00:00:00 2001
2+From: Debarshi Ray <rishi@fedoraproject.org>
3+Date: Tue, 11 Jun 2024 19:26:50 +0200
4+Subject: [PATCH] playbooks: Avoid using potentially broken DNF5
5+ 
6+The Zuul executor got updated from Ansible 2.13.7 to 2.15.10, which now
7+has support for DNF5 [1] and the previous DNF5 Change [2] for Fedora 39
8+is now aiming at Fedora 41 (and Rawhide) [3]. Unfortunately, Ansible's
9+'dnf5' module is still under development and doesn't seem to match the
10+state of DNF5 in Fedora Rawhide, which causes:
11+ TASK [Install RPM packages]
12+ fedora-rawhide | ERROR
13+ fedora-rawhide | {
14+ fedora-rawhide | "failures": [],
15+ fedora-rawhide | "msg": "Could not import the libdnf5 python module
16+ using /usr/bin/python3 (3.12.3 (main, Apr 17 2024, 00:00:00) [GCC
17+ 14.0.1 20240411 (Red Hat 14.0.1-0)]). Please install
18+ python3-libdnf5 package or ensure you have specified the correct
19+ ansible_python_interpreter. (attempted
20+ ['/usr/libexec/platform-python', '/usr/bin/python3',
21+ '/usr/bin/python2', '/usr/bin/python'])"
22+ fedora-rawhide | }
23+ 
24+Trying to explicitly install python3-libdnf5, as suggested above, using
25+Ansible's 'command' module before using the 'package' module to install
26+the Toolbx dependencies, still ends up with:
27+ TASK [Install RPM packages]
28+ fedora-rawhide | MODULE FAILURE:
29+ fedora-rawhide | Traceback (most recent call last):
30+ fedora-rawhide | File "<stdin>", line 107, in <module>
31+ fedora-rawhide | File "<stdin>", line 99, in _ansiballz_main
32+ fedora-rawhide | File "<stdin>", line 47, in invoke_module
33+ fedora-rawhide | File "<frozen runpy>", line 226, in run_module
34+ fedora-rawhide | File "<frozen runpy>", line 98, in _run_module_code
35+ fedora-rawhide | File "<frozen runpy>", line 88, in _run_code
36+ fedora-rawhide | File "/tmp/ansible_ansible.legacy.dnf5_payload_kecazv78/ansible_ansible.legacy.dnf5_payload.zip/ansible/modules/dnf5.py",
37+ line 708, in <module>
38+ fedora-rawhide | File "/tmp/ansible_ansible.legacy.dnf5_payload_kecazv78/ansible_ansible.legacy.dnf5_payload.zip/ansible/modules/dnf5.py",
39+ line 704, in main
40+ fedora-rawhide | File "/tmp/ansible_ansible.legacy.dnf5_payload_kecazv78/ansible_ansible.legacy.dnf5_payload.zip/ansible/modules/dnf5.py",
41+ line 487, in run
42+ fedora-rawhide | AttributeError: 'Base' object has no attribute
43+ 
44+Therefore, force the use of DNF4 when an Ansible job is being attempted
45+more than once [4].
46+ 
47+[1] Ansible commit a81b787a05100986
48+ https://github.com/ansible/ansible/commit/a81b787a05100986
49+ https://github.com/ansible/ansible/issues/78898
50+ 
51+[2] https://fedoraproject.org/wiki/Changes/ReplaceDnfWithDnf5
52+ 
53+[3] https://fedoraproject.org/wiki/Changes/SwitchToDnf5
54+ 
55+[4] https://zuul-ci.org/docs/zuul/latest/job-content.html#var-zuul.attempts
56+ 
57+https://github.com/containers/toolbox/pull/1509
58+ 
59+---
60+ playbooks/dependencies-fedora-restricted.yaml | 3 +++
61+ playbooks/dependencies-fedora.yaml | 1 +
62+ 2 files changed, 4 insertions(+)
63+ 
64+diff --git a/playbooks/dependencies-fedora-restricted.yaml b/playbooks/dependencies-fedora-restricted.yaml
65+index 2567e0c..a8823f9 100644
66+--- a/playbooks/dependencies-fedora-restricted.yaml
67++++ b/playbooks/dependencies-fedora-restricted.yaml
68+@@ -45,6 +45,7 @@
69+ - udisks2
70+ state: present
71+ update_cache: "{{ true if zuul.attempts > 1 else false }}"
72++ use: "{{ 'dnf' if zuul.attempts > 1 else 'auto' }}"
73+
74+ - name: Ensure that podman(1) is absent
75+ become: yes
76+@@ -53,6 +54,7 @@
77+ - podman
78+ state: absent
79+ update_cache: "{{ true if zuul.attempts > 1 else false }}"
80++ use: "{{ 'dnf' if zuul.attempts > 1 else 'auto' }}"
81+
82+ - name: Ensure that skopeo(1) is absent
83+ become: yes
84+@@ -61,6 +63,7 @@
85+ - skopeo
86+ state: absent
87+ update_cache: "{{ true if zuul.attempts > 1 else false }}"
88++ use: "{{ 'dnf' if zuul.attempts > 1 else 'auto' }}"
89+
90+ - name: Download Go modules
91+ command: go mod download -x
92+diff --git a/playbooks/dependencies-fedora.yaml b/playbooks/dependencies-fedora.yaml
93+index 194f4e6..4470901 100644
94+--- a/playbooks/dependencies-fedora.yaml
95++++ b/playbooks/dependencies-fedora.yaml
96+@@ -37,6 +37,7 @@
97+ - skopeo
98+ - systemd
99+ - udisks2
100++ use: "{{ 'dnf' if zuul.attempts > 1 else 'auto' }}"
101+
102+ - name: Download Go modules
103+ command: go mod download -x
104+--
105+2.43.0
106+ 
@@ -5,7 +5,7 @@ Version: 0.0.99.5
5 5 
6%global goipath github.com/containers/%{name}6%global goipath github.com/containers/%{name}
7 7 
8-Release: 48+Release: 5
9Summary: Tool for interactive command line environments on Linux9Summary: Tool for interactive command line environments on Linux
10 10 
11License: Apache-2.011License: Apache-2.0
@@ -14,6 +14,7 @@ URL: https://github.com/containers/toolbox
14Source0: toolbox-0.0.99.5-vendored.tar.xz14Source0: toolbox-0.0.99.5-vendored.tar.xz
15Source1: https://github.com/cpuguy83/go-md2man/archive/v1.0.10.tar.gz15Source1: https://github.com/cpuguy83/go-md2man/archive/v1.0.10.tar.gz
16Patch0: 0001-toolbox-0.0.99.5-add-support-for-loongarch64.patch16Patch0: 0001-toolbox-0.0.99.5-add-support-for-loongarch64.patch
17+Patch1: 0002-playbooks-Avoid-using-potentially-broken-DNF5.patch
17 18 
18BuildRequires: golang >= 1.20 meson >= 0.58.019BuildRequires: golang >= 1.20 meson >= 0.58.0
19BuildRequires: pkgconfig(bash-completion) systemd20BuildRequires: pkgconfig(bash-completion) systemd
@@ -46,6 +47,7 @@ The toolbox-tests package contains system tests for toolbox.
46%prep47%prep
47%setup -q48%setup -q
48%patch0 -p149%patch0 -p1
50+%patch1 -p1
49 51 
50GOBUILDDIR="$(pwd)/_build"52GOBUILDDIR="$(pwd)/_build"
51GOSOURCEDIR="$(pwd)"53GOSOURCEDIR="$(pwd)"
@@ -107,6 +109,9 @@ fi
107%{_datadir}/%{name}109%{_datadir}/%{name}
108 110 
109%changelog111%changelog
112+* Tue Jul 9 2024 zhangxingrong-<zhangxingrong@uniontech.cn> - 0.0.99.5-5
113+- playbooks: Avoid using potentially broken DNF5
114+ 
110* Tue Apr 23 2024 Pengda Dou <doupengda@loongson.cn> - 0.0.99.5-4115* Tue Apr 23 2024 Pengda Dou <doupengda@loongson.cn> - 0.0.99.5-4
111- add support for loongarch64116- add support for loongarch64
112 117