Open daniel-lucio opened 9 months ago
Did you try this approach https://github.com/hhorak/mock-example ? This is what people building SCL usually do.
It fails even without the --defines,
mock --rebuild /home/dieu/rpmbuild/SRPMS/okay-release-1-10.mga9.src.rpm --resultdir=~/rpmbuild/RPMS/"%(dist)s"/"%(target_arch)s"/ -r okay8 --enable-network --trace --disable-plugin=selinux --no-cleanup-after
Fails, I can find some useful log:
INFO: ENTER ['copy_srpm_into_chroot'](<mockbuild.backend.Commands object at 0x7fdc46ca3f40>, '/home/dieu/rpmbuild/SRPMS/okay-release-1-10.mga9.src.rpm')
INFO: ENTER ['make_chroot_path'](<mockbuild.buildroot.Buildroot object at 0x7fdc46cdd720>, '/builddir/build', 'originals')
INFO: ENTER ['install_srpm'](<mockbuild.backend.Commands object at 0x7fdc46ca3f40>, '/builddir/build/originals/okay-release-1-10.mga9.src.rpm')
INFO: ENTER ['nuke_rpm_db'](<mockbuild.buildroot.Buildroot object at 0x7fdc46cdd720>)
INFO: ENTER ['make_chroot_path'](<mockbuild.buildroot.Buildroot object at 0x7fdc46cdd720>, 'var/lib/rpm/__db*')
INFO: ENTER ['make_chroot_path'](<mockbuild.buildroot.Buildroot object at 0x7fdc46cdd720>)
INFO: EXCEPTION: [FileNotFoundError(2, 'No such file or directory')]
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/mockbuild/trace_decorator.py", line 93, in trace
result = func(*args, **kw)
File "/usr/lib/python3.10/site-packages/mockbuild/backend.py", line 662, in install_srpm
output, return_code = self.buildroot.doChroot(
File "/usr/lib/python3.10/site-packages/mockbuild/buildroot.py", line 386, in doChroot
result = util.do_with_status(command, chrootPath=self.make_chroot_path(),
File "/usr/lib/python3.10/site-packages/mockbuild/trace_decorator.py", line 93, in trace
result = func(*args, **kw)
File "/usr/lib/python3.10/site-packages/mockbuild/util.py", line 545, in do_with_status
child = subprocess.Popen(
File "/usr/lib64/python3.10/subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib64/python3.10/subprocess.py", line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/bin/rpm'
I can confirm that '/builddir/build/originals/okay-release-1-10.mga9.src.rpm' exists in the rootjail.
Thank you for the report.
This is weird. How come /bin/rpm
is missing in the build root?
Note the traceback:
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/mockbuild/trace_decorator.py", line 93, in trace
result = func(*args, **kw)
File "/usr/lib/python3.10/site-packages/mockbuild/backend.py", line 662, in install_srpm
output, return_code = self.buildroot.doChroot(
It is very short. Who calls install_srpm
? Anyway, what is happening
here is that Mock tries to call /bin/rpm
in chroot, and that binary is
missing there. One option that comes to my mind is that there's no
/bin -> /usr/bin
symlink and that you, because SCL, override the PATH
variable.
Short description of the problem
Can't build a SRPM. I have tried multiple
Output of
rpm -q mock
Steps to reproduce issue
mock --define "scl php73" --define '_scl_prefix /opt/remi' --rebuild /home/dieu/rpmbuild/SRPMS/signalwire-client-c-2.2.0-1.mga9.src.rpm --resultdir=~/rpmbuild/RPMS/"%(dist)s"/"%(target_arch)s"/ -r okay8 --verbose --verbose --enable-network --trace --yum --no-clean
Do not forget to mention full commandline with the mock command you executed. mock --define "scl php73" --define '_scl_prefix /opt/remi' --rebuild /home/dieu/rpmbuild/SRPMS/signalwire-client-c-2.2.0-1.mga9.src.rpm --resultdir=~/rpmbuild/RPMS/"%(dist)s"/"%(target_arch)s"/ -r okay8 --verbose --verbose --enable-network --trace --yum --no-clean
Any additional notes
Output of `mock --debug-config`