Commit 9c3dd9f
committed
Do not fail (not just) hermetic builds for missing resolv.conf
First, Mock cannot guarantee that the host environment provides a
resolv.conf file. We should simply warn the user instead of triggering
a hard failure.
Second, the check for "simple" isolation was incomplete. We need to
check for USE_NSPAWN, as it accurately reflects the isolation=auto case.
INFO: mock.py version 6.6 starting (python version = 3.14.2, NVR = mock-6.6-1.fc43), args: /usr/libexec/mock/mock --hermetic-build /buildroot/results/buildroot_lock.json /buildroot/results/buildroot_repo --spec /source/libecpg.spec --sources /source --resultdir /results
Traceback (most recent call last):
File "/usr/libexec/mock/mock", line 1132, in <module>
exitStatus = main()
File "/usr/lib/python3.14/site-packages/mockbuild/trace_decorator.py", line 93, in trace
result = func(*args, **kw)
File "/usr/libexec/mock/mock", line 769, in main
util.setup_host_resolv(bootstrap_buildroot_config)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.14/site-packages/mockbuild/trace_decorator.py", line 93, in trace
result = func(*args, **kw)
File "/usr/lib/python3.14/site-packages/mockbuild/util.py", line 890, in setup_host_resolv
shutil.copyfile('/etc/resolv.conf', resolv_path)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/shutil.py", line 313, in copyfile
with open(src, 'rb') as fsrc:
~~~~^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/etc/resolv.conf'
Relates: https://bugzilla.redhat.com/show_bug.cgi?id=2433808
Closes: rpm-software-management#16971 parent 3a77f8c commit 9c3dd9f
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| 863 | + | |
863 | 864 | | |
864 | 865 | | |
865 | 866 | | |
| |||
869 | 870 | | |
870 | 871 | | |
871 | 872 | | |
872 | | - | |
| 873 | + | |
873 | 874 | | |
874 | 875 | | |
875 | 876 | | |
| |||
889 | 890 | | |
890 | 891 | | |
891 | 892 | | |
892 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
893 | 897 | | |
894 | 898 | | |
895 | 899 | | |
| |||
0 commit comments