Created attachment 1691014 [details]
example of failing spec
Description of problem:
mock fails with network disabled, if trying to resolve the local hostname.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
0. Get attached test.spec
1. rpmbuild -bs test.spec
2. mock ../SRPMS/test-2.10-1.fc30.src.rpm --root=fedora-33-x86_64
a0. compile mpich program in mock
a1. mpirun program
resolve local hostname fails
program should run and exit without error
This is especially annoying as this causing failures in copr.
A workaround is to enable network, but that shouldn't be required.
Weird, I tested gethostbyname in mock, and it seems to work
even in default systemd-nspawn (--isolation=simple is work-around).
<mock-chroot> sh-5.0# cat ~/test.c
int main(int argc, char **argv)
char *hostname = argv;
struct hostent* h = gethostbyname(hostname);
inet_ntop(h->h_addrtype, h->h_addr_list, ip, 1000);
printf("IP of %s is %s\n", hostname, ip);
<mock-chroot> sh-5.0# gcc ~/test.c
<mock-chroot> sh-5.0# ./a.out localhost
IP of localhost is 127.0.0.1
<mock-chroot> sh-5.0# ./a.out f3c93d2243464e9cb0ff764809b4b681
IP of f3c93d2243464e9cb0ff764809b4b681 is 127.0.0.2
It seems mpich is doing something else? What I think isn't correct
is to expect that there's a DNS server doing the translation inside
mock. There are no servers available.
FEDORA-2020-d5c4564da8 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-d5c4564da8
I pushed the update to F33+. Let me know if you need this in lower versions.
FEDORA-2020-d5c4564da8 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-d5c4564da8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-d5c4564da8
See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2020-d5c4564da8 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.
Thanks for fixing. I am not sure what copr runs on, but if it gets fixed at some point, that works for me :-)
It doesn't matter what copr runs *on*. This package is installed in the build root *inside*
of copr. The patch is currently in F33 as mentioned above, so F33 build roots should be
fixed, but lower ones not.